I am trying to run a t-test on pupillometry data. Using the PupillometryR pipeline I have completed the "create_difference_data" step. However, I am running into problems when trying to do the next step, "create_functional_data". The error "replacement has [x] rows, data has [y] keeps occurring".
I have 49,777 rows of data, but it is telling me that the functional_data should have 50,412. I am using basis 10 and order 4, and using the same code (changed data) provided in the CRAN documentation (linked below).
The steps that I have tried are to input NA rows, although this made the code stop working altogether, I removed all of the NA's in the pupillometryR data frame (as the CRAN example had none), and I also ensured that the class of columns used were the same as the CRAN example.
However, I think that the code is running just that it will not be put into the pupillometryR data frame as the first mean pupil given in the error and it is different than the difference_data
https://cran.r-project.org/web/packages/PupillometryR/vignettes/PupillometryR.html
Edit I tried to make all of the conditions have the same amount of time, cutting down the time column so that they were all equal. However, this did not work and I got the same error message.
One thing I did try was to enter another column with values. Doing the
DF$NewValues <- NA
I got the error message
replacement has [X] rows, data has [Y]
So I solved this by cutting the time to be equal in all conditions before subsetting the data frame into two conditions. I have no clue why this worked whereas cutting after did not.