Open nanokelvin opened 4 years ago
Hello everyone. So (for those who remember me) I managed to create reports in the past. But now I'm working on another computer. I was working remotely from home on MacOS. Now I am at work on Windows. And the eCRF changed in REDCap... We adapted our own local eCRF to reflect ISARIC_nCoV. I think we did a good job because I already succesfully imported our data into the ISARIC database.
But now with the code I'm having trouble already at the import.data step too... See the log in attachment. Can you see the source of the problem?
If that matters, I think the "tinytex::install_tinytex()" didn't work correctly here...
Thank you for your help! Log 20200526.pdf
Same error on my Mac (where the code used to work before the eCRF update) when trying to import data. Did it work for ayone?
Hi @jasonbouziotis - moved this to a new issue (#4)
Hi @nanokelvin - is there any chance you could privately provide your data so I can hunt this down?
I've been able to install the COVIDreportwriter package successfully but am getting an error when running import.and.process.data. Not sure where the problem is.
imported.data <-import.and.process.data("Z:/DATA/COREG/Data/KW/COREGMcMasterKWRegio_DATA_2020-05-18_1441.csv", "Z:/DATA/COREG/Data/KW/COREGMcMasterKWRegion_DataDictionary_2020-05-14.csv")
Error: Columns 1 and 2 must be named. Run
rlang::last_error()
to see where the error occurred.UPDATE:
I didn't get a reply so tried debugging line by line. I found that this problem was being caused by not having "4"s in front of fields for admission_signs_and_symptoms. So I fixed that but ran into another problem.
Reading data... Importing data... Identifying symptoms, comorbidities and treatments... Renaming columns... Setting future dates to NA... Manually adjusting some fields... Making patient data frame... Joining events tables... Adding new columns... Wrangling dates for treatment modalities... Untangling SARS-CoV-2 test results... Error: Result 5 must be a single double, not a double vector of length 2 Run
rlang::last_error()
to see where the error occurred. In addition: There were 25 warnings (use warnings() to see them)I've isolated the problem to this line of code but cannot figure out what is wrong.
patient.data <- patient.data %>% mutate(cov.test.result = map_dbl(patient.data$events, function(x) extract.named.column.from.events(events.tibble = x, column.name = "corna_mbcat"))) %>%
Any help would be appreciated. Otherwise I am stuck.