Fix bugs in readable datetime and screen episodes
parent
bb737237d0
commit
4c2f60fffd
|
@ -49,8 +49,8 @@ validate_user_timezones <- function(timezone_parameters){
|
||||||
}
|
}
|
||||||
|
|
||||||
create_mising_temporal_column <- function(data, device_type){
|
create_mising_temporal_column <- function(data, device_type){
|
||||||
if(device_type == "fitbit" && all(data$timestamp == 0)){
|
if(device_type == "fitbit" && all(data$timestamp == 0) && "local_date_time" %in% colnames(data)){
|
||||||
# For fibit we infere timestamp from Fitbit's local date time
|
# For fibit we infere timestamp from Fitbit's local date time only right after pulling it
|
||||||
if(nrow(data) == 0)
|
if(nrow(data) == 0)
|
||||||
return(data %>% mutate(timestamp = NA_real_))
|
return(data %>% mutate(timestamp = NA_real_))
|
||||||
if(any(is.na(parse_date_time(data$local_date_time, orders= c("%Y/%m/%d %H:%M:%S","%Y-%m-%d %H:%M:%S"), exact=T))))
|
if(any(is.na(parse_date_time(data$local_date_time, orders= c("%Y/%m/%d %H:%M:%S","%Y-%m-%d %H:%M:%S"), exact=T))))
|
||||||
|
|
|
@ -56,7 +56,7 @@ get_screen_episodes <- function(screen){
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nrow(screen) < 2){
|
if(nrow(screen) < 2){
|
||||||
episodes <- data.frame(device_id = character(),,
|
episodes <- data.frame(device_id = character(),
|
||||||
episode = character(),
|
episode = character(),
|
||||||
screen_sequence = character(),
|
screen_sequence = character(),
|
||||||
start_timestamp = character(),
|
start_timestamp = character(),
|
||||||
|
|
Loading…
Reference in New Issue