Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time column issue in transform_data() #1

Open
glitt13 opened this issue Dec 19, 2019 · 1 comment
Open

time column issue in transform_data() #1

glitt13 opened this issue Dec 19, 2019 · 1 comment

Comments

@glitt13
Copy link

glitt13 commented Dec 19, 2019

I'm unable to run transform_data() successfully. Running line-by-line, the final line before returning data fails at:

data <- tsibble::as_tsibble(data, index = time_col, regular = regular)

The error states that there are multiple columns named time in data.

I believe this is caused by the following line:
data <- cbind(data, neg_der_log_bounded, time)

I suggest the following, which avoids binding the time column which is already contained in data:
data <- cbind(data, neg_der_log_bounded)

@glitt13
Copy link
Author

glitt13 commented Jan 3, 2020

The following hard-coded time column name in transform_data causes problems if data are not formatted in the same fashion:

time <- as.numeric(data$Timestamp[2:n] - data$Timestamp[1:(n - 
                                                               1)])

I suggest changing to:

time <- as.numeric(data[,time_col][2:n] - data[,time_col][1:(n - 
                                                               1)])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant