You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into Error in cut.default(ts, breaks = breaks) : 'x' must be numeric error if using a data frame where the first column -- the time component -- is named differently than "HEADER_TIME_STAMP". Note the documentation does not mention a need to name the first column -- the time component -- in a certain way; it only says df -- dataframe. Input multi-channel accelerometer signal. The first column should be the time component.
Below is an example of generating the error for raw accelerometry data sample included in adeptdata R package. These data were collected continuously for ~20 minutes with ActiGraph Link device at frequency 100 Hz.
Example when it works:
rm(list= ls())
# install.packages("adeptdata")
library(adeptdata)
library(MIMSunit)
library(dplyr)
library(lubridate)
# does work df<-adeptdata::acc_running %>%
filter(loc_id=="left_hip") %>%
select(HEADER_TIME_STAMP=date_time, x, y, z) %>%
mutate(HEADER_TIME_STAMP=lubridate::ymd_hms(HEADER_TIME_STAMP))
mims_out<-MIMSunit::mims_unit(df, epoch="1 min", dynamic_range= c(-8, 8))
mims_out
# does not work
rm(df, mims_out)
df<-adeptdata::acc_running %>%
filter(loc_id=="left_hip") %>%
select(date_time, x, y, z) %>%
mutate(date_time=lubridate::ymd_hms(date_time))
mims_out<-MIMSunit::mims_unit(df, epoch="1 min", dynamic_range= c(-8, 8))
===================================================================================Error in cut.default(ts, breaks = breaks) : 'x' must be numeric
In addition: Warning messages:
1: In regularize.values(x, y, ties, missing(ties)) :
collapsing to unique 'x' values
2: In regularize.values(x, y, ties, missing(ties)) :
collapsing to unique 'x' values
3: In regularize.values(x, y, ties, missing(ties)) :
collapsing to unique 'x' values
4: tz(): Don't know how to compute timezone for object of class NULL; returning "UTC". This warning will become an error in the next major version of lubridate.
The text was updated successfully, but these errors were encountered:
martakarass
changed the title
Error in cut.default(ts, breaks = breaks) : 'x' must be numeric -- if the first column named differently than HEADER_TIME_STAMP?
Error in cut.default(ts, breaks = breaks) : 'x' must be numeric -- if the first column named differently than HEADER_TIME_STAMP
Apr 13, 2021
Thanks for reporting. I spotted the bug in the code. I'll update the codes to fix it. For now, just make sure you used "HEADER_TIME_STAMP" as the column name.
I ran into
Error in cut.default(ts, breaks = breaks) : 'x' must be numeric
error if using a data frame where the first column -- the time component -- is named differently than"HEADER_TIME_STAMP"
. Note the documentation does not mention a need to name the first column -- the time component -- in a certain way; it only saysdf -- dataframe. Input multi-channel accelerometer signal. The first column should be the time component
.Below is an example of generating the error for raw accelerometry data sample included in
adeptdata
R package. These data were collected continuously for ~20 minutes with ActiGraph Link device at frequency 100 Hz.Example when it works:
Session info
The text was updated successfully, but these errors were encountered: