I hope this post finds you well. I encounter several similar error messages when I use my R code. The RStudio shows the following message when I run my code under the “REMOVE BAD DATA” section.
Error in vapply(as.character(key.urls), function(i) which(randomized.urls == :
** values must be length 1,**
but FUN(X[[1]]) result is length 0
The similar error message was displayed when I run the code under the “PARSE CURSOR DATA” section.
Error in vapply(as.character(key.urls), function(i) which(randomized.urls == : **
** values must be length 1,
** but FUN(X[[1]]) result is length 8**
I have been suffering from these errors and try to figure out any solutions to address them. I have attached my R code and data file (named “data”) and you can download them from the link.
Do everyone have any thoughts about this issue, and if so, would you mind checking the error for me? If not, I definitely understand, and would greatly appreciate any pointers you might have about this issue.
I downloaded your zip file and had a look at data.csv which I named dat1
I think you have something seriously wrong with that file.
For example
dat1[1:3,1:4]
gives me
1 Start Date
2 {"ImportId":"startDate","timeZone":"America/Chicago"}
3 2021-01-19 14:10:32
EndDate Status
1 End Date Response Type
2 {"ImportId":"endDate","timeZone":"America/Chicago"} {"ImportId":"status"}
3 2021-01-19 14:15:20 0
IPAddress
1 IP Address
2 {"ImportId":"ipAddress"}
3 24.162.183.119
Thank you very much for your kind comment. I really appreciate that. I upload a clean data with one three subjects' data and upload the file data_prep.R. You can download them the link.
Using the clean data, I still encounter the same error message.
Error in vapply(as.character(key.urls), function(i) which(randomized.urls == :
values must be length 1,
but FUN(X[[1]]) result is length 8
Any comment on this error message will be greatly appreciate. Again, thank you so much for your time on this matter.!
This is not what I understand to be a data file. I recommend that you open the file in a text editor and have a look at it. It seems to be some kind of a mix of an R header line, some text which looks like a questionnaire and,what I am guessing, is some html.