ropensci / qualtRics

Download ⬇️ Qualtrics survey data directly into R!
https://docs.ropensci.org/qualtRics
Other
215 stars 70 forks source link

Changed variable names after survey is read in #252

Closed tbritton44 closed 2 years ago

tbritton44 commented 2 years ago

Hi all,

Hoping to crowdsource an issue I am having lately with the qualtRics package. I am a HUGE fan and want to extend a lot of gratitude to the community members who have developed and maintained it.

A research assistant is helping me regularly process some survey data we have coming in daily. The data cleaning script I have written pulls the data directly from Qualtrics using the qualtRics package, then runs a series of code that transforms/cleans variables so I have a nice tidy output.

She has been assisting me with this for the better part of a year, but recently got a new laptop. Upon getting that new laptop, when she runs the script the variable names pulled from Qualtrics are incorrect, and so the script throws an error when asked to manipulate a certain variable for example:

pan_dat_new <- pan_dat_new %>% mutate(inconsistent_choice_girl = case_when( choose2_1 == "On" ~ 1, choose2_2 == "On" ~ 2, TRUE ~ as.numeric(NA)))

Error : ...x object 'choose2_1' not found

When I go to explore variable names, what I notice is that there has been a long string of numbers added to each variable name, and I am guessing this is something that is happening in the process of the interface between Qualtrics and R prior to the survey data "magically" existing as a dataframe in R.

Wondering if others have had this same experience and if they have found a resolution? Or if you have any insights as to what else could be going on? I have had her uninstall and reinstall qulatRics, to no avail.

Thanks in advance for any support you can offer!

juliasilge commented 2 years ago

That sounds pretty frustrating @tbritton44! For us to figure out what is going on, can I get you and/or your research assistant to create a reprex (a minimal reproducible example) for this? The goal of a reprex is to make it easier for us to recreate your problem so that we can understand it and/or fix it. I wonder if this is related to version of R or other packages, so please the session info with session_info = TRUE.

If you've never heard of a reprex before, you may want to start with the tidyverse.org help page. You may already have reprex installed (it comes with the tidyverse package), but if not you can install it with:

install.packages("reprex")

Your output (what you paste here on GitHub) should look like this, but with your info (feel free to censor any PII that shows up by replacing with XXX or similar):

library(qualtRics)
my_survey <- fetch_survey("SV_3gbwq8aJgqPwQDP", force_request = TRUE)
#>   |                                                                              |                                                                      |   0%  |                                                                              |======================================================================| 100%
#> 
#> ── Column specification ────────────────────────────────────────────────────────
#> cols(
#>   .default = col_character(),
#>   StartDate = col_datetime(format = ""),
#>   EndDate = col_datetime(format = ""),
#>   Progress = col_double(),
#>   `Duration (in seconds)` = col_double(),
#>   Finished = col_logical(),
#>   RecordedDate = col_datetime(format = ""),
#>   RecipientLastName = col_logical(),
#>   RecipientFirstName = col_logical(),
#>   RecipientEmail = col_logical(),
#>   ExternalReference = col_logical(),
#>   LocationLatitude = col_double(),
#>   LocationLongitude = col_double(),
#>   SolutionRevision = col_double()
#> )
#> ℹ Use `spec()` for the full column specifications.
#> 'StartDate', 'EndDate', and 'RecordedDate' were converted without a specific timezone
#> * To set a timezone, visit https://www.qualtrics.com/support/survey-platform/managing-your-account/
#> * Timezone information is under 'User Settings'
#> * See https://api.qualtrics.com/instructions/docs/Instructions/dates-and-times.md for more
names(my_survey)
#>  [1] "StartDate"             "EndDate"               "Status"               
#>  [4] "IPAddress"             "Progress"              "Duration (in seconds)"
#>  [7] "Finished"              "RecordedDate"          "ResponseId"           
#> [10] "RecipientLastName"     "RecipientFirstName"    "RecipientEmail"       
#> [13] "ExternalReference"     "LocationLatitude"      "LocationLongitude"    
#> [16] "DistributionChannel"   "UserLanguage"          "Q63"                  
#> [19] "Q16"                   "Q17"                   "Q18"                  
#> [22] "Q19"                   "Q22"                   "SolutionRevision"

Created on 2022-01-20 by the reprex package (v2.0.1)

tbritton44 commented 2 years ago

Hi Julia,

Thanks so much for your help with this! I admit I have never created a reprex() before, but was able to read and understand the documentation. My RA is working remotely so I was helping her navigate creating a reprex via screen share/remote screen control which presented some challenges, namely although it seemed that the code was successfully copied to the clipboard it was not appearing in the Viewer tab in RStudio and she was not able to find it on her device. I am certain this is partly due to my own lack of experience. I have attached screen shots of what you have outlined above. However, it doesn't provide us any session_info.

You can notice in the list of names(), how some of the names end with a long string of numbers. These are the variables that are creating problems as she runs the cleaning script, because their name in the script and in Qualtrics do not have that long string of numbers attached. She is working on a PC, has R version 4.1.2 installed. Hopefully, this information helps. I could try having her download a later version of R?

Screen Shot 2022-01-24 at 2 23 40 PM Screen Shot 2022-01-24 at 2 24 09 PM
juliasilge commented 2 years ago

It sounds like you all have a pretty up-to-date version of R so I don't think that's the problem. It definitely could be an issue with the versions of packages that you are working with. Could you try again to get reprex to work so I can see session info? That is super important information here with this kind of problem. I don't think you need to use reprex_clean() but instead make a little bit of code that looks like this (in an R file somewhere):

library(qualtRics)
my_survey <- fetch_survey("SV_3gbwq8aJgqPwQDP", force_request = TRUE)
names(my_survey)

Then copy it (so it is on your clipboard) and call reprex(session_info = TRUE). If you want to see someone walk through how to do this, you can watch this video for a few minutes starting here.

Can you also share the text output instead of a screenshot? I can't do much with a screenshot, such as look for patterns in which column names are getting those integers added. Are these duplicate column names possibly?

tbritton44 commented 2 years ago

The column names are not duplicates, although I can understand how they would look that way. There are a number of iterations of very similarly-named columns with minor differences (e.g. inclusion1_1_2, inclusion1_1_3, etc).

The video was extremely helpful thank you for sending. I went back and worked with my RA, but encountered the same problem. I receive a note in her console that says "Rendered reprex is on the clipboard.", but nothing appears in the viewer. When I ask her to try pasting from her clipboard--to me in Slack--it does not appear that the output has been successfully copied. There is of course the added challenge of remote screen control (I am limited in how I am able to navigate her device).

Below is the copy and pasted reprex output from my session--though not sure how useful this is given that everything is working perfectly well on my device.

I think I understand your logic, and can see based on my session_info the version of the packages loaded on my device. I am going to check the packageVersion() loaded on her device and see if that can't bring us to some sort of conclusion.

library(qualtRics)
surveys <- all_surveys()
pan_dat_new <- fetch_survey(surveyID = surveys$id[26], force_request = T)
#>   |                                                                              |                                                                      |   0%  |                                                                              |====                                                                  |   6%  |                                                                              |=============                                                         |  19%  |                                                                              |======================                                                |  32%  |                                                                              |===========================                                           |  38%  |                                                                              |====================================                                  |  51%  |                                                                              |=============================================                         |  64%  |                                                                              |======================================================                |  77%  |                                                                              |===================================================================   |  96%  |                                                                              |======================================================================| 100%
#> 
#> ── Column specification ────────────────────────────────────────────────────────
#> cols(
#>   .default = col_double(),
#>   StartDate = col_datetime(format = ""),
#>   EndDate = col_datetime(format = ""),
#>   Status = col_character(),
#>   IPAddress = col_character(),
#>   Finished = col_logical(),
#>   RecordedDate = col_datetime(format = ""),
#>   ResponseId = col_character(),
#>   RecipientLastName = col_logical(),
#>   RecipientFirstName = col_logical(),
#>   RecipientEmail = col_logical(),
#>   ExternalReference = col_logical(),
#>   DistributionChannel = col_character(),
#>   UserLanguage = col_character(),
#>   Qgender = col_character(),
#>   nice_bg_1 = col_character(),
#>   nice_bg_2 = col_character(),
#>   nice_bg_3 = col_character(),
#>   nice_bg_4 = col_character(),
#>   nice_bg_5 = col_character(),
#>   nice_bg_6 = col_character()
#>   # ... with 230 more columns
#> )
#> ℹ Use `spec()` for the full column specifications.
#> Warning in infer_data_types(data, surveyID): The 'StartDate', 'EndDate' and 'RecordedDate' variables were converted without passing
#> a specific timezone. If you like to set these timestamps to your own timezone, please
#> visit https://www.qualtrics.com/support/survey-platform/getting-started/managing-your-account/
#> (under 'User Settings'). See https://api.qualtrics.com/docs/dates-and-times for more
#> information about how the Qualtrics API handles dates and times.
names(pan_dat_new)
#>   [1] "StartDate"              "EndDate"                "Status"                
#>   [4] "IPAddress"              "Progress"               "Duration (in seconds)" 
#>   [7] "Finished"               "RecordedDate"           "ResponseId"            
#>  [10] "RecipientLastName"      "RecipientFirstName"     "RecipientEmail"        
#>  [13] "ExternalReference"      "LocationLatitude"       "LocationLongitude"     
#>  [16] "DistributionChannel"    "UserLanguage"           "Q998_First Click"      
#>  [19] "Q998_Last Click"        "Q998_Page Submit"       "Q998_Click Count"      
#>  [22] "Q1014_First Click"      "Q1014_Last Click"       "Q1014_Page Submit"     
#>  [25] "Q1014_Click Count"      "Q1018_First Click"      "Q1018_Last Click"      
#>  [28] "Q1018_Page Submit"      "Q1018_Click Count"      "Q1022_First Click"     
#>  [31] "Q1022_Last Click"       "Q1022_Page Submit"      "Q1022_Click Count"     
#>  [34] "Q1026_First Click"      "Q1026_Last Click"       "Q1026_Page Submit"     
#>  [37] "Q1026_Click Count"      "Q1030_First Click"      "Q1030_Last Click"      
#>  [40] "Q1030_Page Submit"      "Q1030_Click Count"      "Qgender"               
#>  [43] "Q1036_First Click"      "Q1036_Last Click"       "Q1036_Page Submit"     
#>  [46] "Q1036_Click Count"      "Q1040_First Click"      "Q1040_Last Click"      
#>  [49] "Q1040_Page Submit"      "Q1040_Click Count"      "Q689_First Click"      
#>  [52] "Q689_Last Click"        "Q689_Page Submit"       "Q689_Click Count"      
#>  [55] "nice_bg_1"              "nice_bg_2"              "nice_bg_3"             
#>  [58] "nice_bg_4"              "nice_bg_5"              "nice_bg_6"             
#>  [61] "nice_bg_7"              "Q692_First Click"       "Q692_Last Click"       
#>  [64] "Q692_Page Submit"       "Q692_Click Count"       "like_bg_1"             
#>  [67] "like_bg_2"              "like_bg_3"              "like_bg_4"             
#>  [70] "like_bg_5"              "like_bg_6"              "Q695_First Click"      
#>  [73] "Q695_Last Click"        "Q695_Page Submit"       "Q695_Click Count"      
#>  [76] "neighbor_bg_1"          "neighbor_bg_2"          "neighbor_bg_3"         
#>  [79] "neighbor_bg_4"          "neighbor_bg_5"          "Qtimer_First Click"    
#>  [82] "Qtimer_Last Click"      "Qtimer_Page Submit"     "Qtimer_Click Count"    
#>  [85] "nice_wg_1"              "nice_wg_2"              "nice_wg_3"             
#>  [88] "nice_wg_4"              "nice_wg_5"              "nice_wg_6"             
#>  [91] "Qtimer_First Click_1"   "Qtimer_Last Click_1"    "Qtimer_Page Submit_1"  
#>  [94] "Qtimer_Click Count_1"   "like_wg_1"              "like_wg_2"             
#>  [97] "like_wg_3"              "like_wg_4"              "like_wg_5"             
#> [100] "like_wg_6"              "Qtimer_First Click_2"   "Qtimer_Last Click_2"   
#> [103] "Qtimer_Page Submit_2"   "Qtimer_Click Count_2"   "neighbor_wg_1"         
#> [106] "neighbor_wg_2"          "neighbor_wg_3"          "neighbor_wg_4"         
#> [109] "neighbor_wg_5"          "Q563_First Click"       "Q563_Last Click"       
#> [112] "Q563_Page Submit"       "Q563_Click Count"       "Qtimer_First Click_3"  
#> [115] "Qtimer_Last Click_3"    "Qtimer_Page Submit_3"   "Qtimer_Click Count_3"  
#> [118] "inclusion1_1"           "inclusion1_2"           "inclusion1_3"          
#> [121] "inclusion1_4"           "Qtimer_First Click_4"   "Qtimer_Last Click_4"   
#> [124] "Qtimer_Page Submit_4"   "Qtimer_Click Count_4"   "inclusion2a_1"         
#> [127] "inclusion2a_2"          "inclusion2a_3"          "Qtimer_First Click_5"  
#> [130] "Qtimer_Last Click_5"    "Qtimer_Page Submit_5"   "Qtimer_Click Count_5"  
#> [133] "inclusion2b_1"          "inclusion2b_2"          "inclusion2b_3"         
#> [136] "Qtimer_First Click_6"   "Qtimer_Last Click_6"    "Qtimer_Page Submit_6"  
#> [139] "Qtimer_Click Count_6"   "inclusion2c_1"          "inclusion2c_2"         
#> [142] "inclusion2c_3"          "Qtimer_First Click_7"   "Qtimer_Last Click_7"   
#> [145] "Qtimer_Page Submit_7"   "Qtimer_Click Count_7"   "inclusion2d_1"         
#> [148] "inclusion2d_2"          "inclusion2d_3"          "Qtimer_First Click_8"  
#> [151] "Qtimer_Last Click_8"    "Qtimer_Page Submit_8"   "Qtimer_Click Count_8"  
#> [154] "group_1"                "group_2"                "group_3"               
#> [157] "Qtimer_First Click_9"   "Qtimer_Last Click_9"    "Qtimer_Page Submit_9"  
#> [160] "Qtimer_Click Count_9"   "Qtimer_First Click_10"  "Qtimer_Last Click_10"  
#> [163] "Qtimer_Page Submit_10"  "Qtimer_Click Count_10"  "peer1_1"               
#> [166] "peer1_2"                "peer1_3"                "peer1_4"               
#> [169] "Qtimer_First Click_11"  "Qtimer_Last Click_11"   "Qtimer_Page Submit_11" 
#> [172] "Qtimer_Click Count_11"  "peer2a_1"               "peer2a_2"              
#> [175] "peer2a_3"               "Qtimer_First Click_12"  "Qtimer_Last Click_12"  
#> [178] "Qtimer_Page Submit_12"  "Qtimer_Click Count_12"  "peer2b_1"              
#> [181] "peer2b_2"               "peer2b_3"               "Qtimer_First Click_13" 
#> [184] "Qtimer_Last Click_13"   "Qtimer_Page Submit_13"  "Qtimer_Click Count_13" 
#> [187] "peer2c_1"               "peer2c_2"               "peer2c_3"              
#> [190] "Qtimer_First Click_14"  "Qtimer_Last Click_14"   "Qtimer_Page Submit_14" 
#> [193] "Qtimer_Click Count_14"  "peer2d_1"               "peer2d_2"              
#> [196] "peer2d_3"               "Q762_First Click"       "Q762_Last Click"       
#> [199] "Q762_Page Submit"       "Q762_Click Count"       "ambiguous_girl_1"      
#> [202] "ambiguous_girl_2"       "ambiguous_girl_3"       "ambiguous_girl_4"      
#> [205] "ambiguous_girl_5"       "ambiguous_girl_6"       "Qtimer_First Click_15" 
#> [208] "Qtimer_Last Click_15"   "Qtimer_Page Submit_15"  "Qtimer_Click Count_15" 
#> [211] "Qtimer_First Click_16"  "Qtimer_Last Click_16"   "Qtimer_Page Submit_16" 
#> [214] "Qtimer_Click Count_16"  "Qtimer_First Click_17"  "Qtimer_Last Click_17"  
#> [217] "Qtimer_Page Submit_17"  "Qtimer_Click Count_17"  "Q565_First Click"      
#> [220] "Q565_Last Click"        "Q565_Page Submit"       "Q565_Click Count"      
#> [223] "structural_1"           "structural_2"           "structural_3"          
#> [226] "structural_4"           "structural_5"           "Q567_First Click"      
#> [229] "Q567_Last Click"        "Q567_Page Submit"       "Q567_Click Count"      
#> [232] "essentialist_1"         "essentialist_2"         "essentialist_3"        
#> [235] "essentialist_4"         "essentialist_5"         "Qtimer_First Click_18" 
#> [238] "Qtimer_Last Click_18"   "Qtimer_Page Submit_18"  "Qtimer_Click Count_18" 
#> [241] "choose1_1"              "choose1_2"              "Qtimer_First Click_19" 
#> [244] "Qtimer_Last Click_19"   "Qtimer_Page Submit_19"  "Qtimer_Click Count_19" 
#> [247] "Qtimer_First Click_20"  "Qtimer_Last Click_20"   "Qtimer_Page Submit_20" 
#> [250] "Qtimer_Click Count_20"  "choose2_1"              "choose2_2"             
#> [253] "Q20e_First Click"       "Q20e_Last Click"        "Q20e_Page Submit"      
#> [256] "Q20e_Click Count"       "status_high_1"          "status_high_2"         
#> [259] "Qtimer_First Click_21"  "Qtimer_Last Click_21"   "Qtimer_Page Submit_21" 
#> [262] "Qtimer_Click Count_21"  "Qtimer_First Click_22"  "Qtimer_Last Click_22"  
#> [265] "Qtimer_Page Submit_22"  "Qtimer_Click Count_22"  "parent1_1"             
#> [268] "parent1_2"              "parent1_3"              "parent1_4"             
#> [271] "parent2a_1"             "parent2a_2"             "parent2a_3"            
#> [274] "Qtimer_First Click_23"  "Qtimer_Last Click_23"   "Qtimer_Page Submit_23" 
#> [277] "Qtimer_Click Count_23"  "parent2b_1"             "parent2b_2"            
#> [280] "parent2b_3"             "Qtimer_First Click_24"  "Qtimer_Last Click_24"  
#> [283] "Qtimer_Page Submit_24"  "Qtimer_Click Count_24"  "parent2c_1"            
#> [286] "parent2c_2"             "parent2c_3"             "Q546_First Click"      
#> [289] "Q546_Last Click"        "Q546_Page Submit"       "Q546_Click Count"      
#> [292] "parent2d_1"             "parent2d_2"             "parent2d_3"            
#> [295] "Q1500_First Click"      "Q1500_Last Click"       "Q1500_Page Submit"     
#> [298] "Q1500_Click Count"      "Q1501_15"               "Q1501_14"              
#> [301] "Q1501_7"                "Q1501_8"                "Q1501_9"               
#> [304] "Q1501_10"               "Q1501_11"               "Q1501_12"              
#> [307] "Q1501_13"               "Q1501_16"               "Q1501_23"              
#> [310] "Q1501_17"               "Q1501_19"               "Q1501_20"              
#> [313] "Q1501_21"               "Q1501_22"               "Q1501_18"              
#> [316] "Q1501_13_TEXT"          "Q1502"                  "Q1503"                 
#> [319] "Q1504_Id"               "Q1504_Name"             "Q1504_Size"            
#> [322] "Q1504_Type"             "Q1893_First Click"      "Q1893_Last Click"      
#> [325] "Q1893_Page Submit"      "Q1893_Click Count"      "Q150_First Click"      
#> [328] "Q150_Last Click"        "Q150_Page Submit"       "Q150_Click Count"      
#> [331] "nice_whiteb_1"          "nice_whiteb_2"          "nice_whiteb_3"         
#> [334] "nice_whiteb_4"          "nice_whiteb_5"          "nice_whiteb_6"         
#> [337] "Q153_First Click"       "Q153_Last Click"        "Q153_Page Submit"      
#> [340] "Q153_Click Count"       "like_whiteb_1"          "like_whiteb_2"         
#> [343] "like_whiteb_3"          "like_whiteb_4"          "like_whiteb_5"         
#> [346] "like_whiteb_6"          "Q156_First Click"       "Q156_Last Click"       
#> [349] "Q156_Page Submit"       "Q156_Click Count"       "neighborhood_whiteb_1" 
#> [352] "neighborhood_whiteb_2"  "neighborhood_whiteb_3"  "neighborhood_whiteb_4" 
#> [355] "neighborhood_whiteb_5"  "Q727_First Click"       "Q727_Last Click"       
#> [358] "Q727_Page Submit"       "Q727_Click Count"       "nice_blackb_1"         
#> [361] "nice_blackb_2"          "nice_blackb_3"          "nice_blackb_4"         
#> [364] "nice_blackb_5"          "nice_blackb_6"          "Q730_First Click"      
#> [367] "Q730_Last Click"        "Q730_Page Submit"       "Q730_Click Count"      
#> [370] "like_blackb_1"          "like_blackb_2"          "like_blackb_3"         
#> [373] "like_blackb_4"          "like_blackb_5"          "like_blackb_6"         
#> [376] "Q733_First Click"       "Q733_Last Click"        "Q733_Page Submit"      
#> [379] "Q733_Click Count"       "neighborhood_blackb_1"  "neighborhood_blackb_2" 
#> [382] "neighborhood_blackb_3"  "neighborhood_blackb_4"  "neighborhood_blackb_5" 
#> [385] "Q194_First Click"       "Q194_Last Click"        "Q194_Page Submit"      
#> [388] "Q194_Click Count"       "inclusion1_1_1"         "inclusion1_2_1"        
#> [391] "inclusion1_3_1"         "inclusion1_4_1"         "Q197_First Click"      
#> [394] "Q197_Last Click"        "Q197_Page Submit"       "Q197_Click Count"      
#> [397] "inclusion2a_1_1"        "inclusion2a_2_1"        "inclusion2a_3_1"       
#> [400] "Q200_First Click"       "Q200_Last Click"        "Q200_Page Submit"      
#> [403] "Q200_Click Count"       "inclusion2b_1_1"        "inclusion2b_2_1"       
#> [406] "inclusion2b_3_1"        "Q203_First Click"       "Q203_Last Click"       
#> [409] "Q203_Page Submit"       "Q203_Click Count"       "inclusion2c_1_1"       
#> [412] "inclusion2c_2_1"        "inclusion2c_3_1"        "Q206_First Click"      
#> [415] "Q206_Last Click"        "Q206_Page Submit"       "Q206_Click Count"      
#> [418] "inclusion2d_1_1"        "inclusion2d_2_1"        "inclusion2d_3_1"       
#> [421] "Q212_First Click"       "Q212_Last Click"        "Q212_Page Submit"      
#> [424] "Q212_Click Count"       "Q214_First Click"       "Q214_Last Click"       
#> [427] "Q214_Page Submit"       "Q214_Click Count"       "peer1_1_1"             
#> [430] "peer1_2_1"              "peer1_3_1"              "peer1_4_1"             
#> [433] "Q217_First Click"       "Q217_Last Click"        "Q217_Page Submit"      
#> [436] "Q217_Click Count"       "peer2a_1_1"             "peer2a_2_1"            
#> [439] "peer2a_3_1"             "Q220_First Click"       "Q220_Last Click"       
#> [442] "Q220_Page Submit"       "Q220_Click Count"       "peer2b_1_1"            
#> [445] "peer2b_2_1"             "peer2b_3_1"             "Q223_First Click"      
#> [448] "Q223_Last Click"        "Q223_Page Submit"       "Q223_Click Count"      
#> [451] "peer2c_1_1"             "peer2c_2_1"             "peer2c_3_1"            
#> [454] "Q226_First Click"       "Q226_Last Click"        "Q226_Page Submit"      
#> [457] "Q226_Click Count"       "peer2d_1_1"             "peer2d_2_1"            
#> [460] "peer2d_3_1"             "Q766_First Click"       "Q766_Last Click"       
#> [463] "Q766_Page Submit"       "Q766_Click Count"       "ambiguous_boy_1"       
#> [466] "ambiguous_boy_2"        "ambiguous_boy_3"        "ambiguous_boy_4"       
#> [469] "ambiguous_boy_5"        "ambiguous_boy_6"        "Q509_First Click"      
#> [472] "Q509_Last Click"        "Q509_Page Submit"       "Q509_Click Count"      
#> [475] "Q511_First Click"       "Q511_Last Click"        "Q511_Page Submit"      
#> [478] "Q511_Click Count"       "Q513_First Click"       "Q513_Last Click"       
#> [481] "Q513_Page Submit"       "Q513_Click Count"       "Q577_First Click"      
#> [484] "Q577_Last Click"        "Q577_Page Submit"       "Q577_Click Count"      
#> [487] "structural_1_1"         "structural_2_1"         "structural_3_1"        
#> [490] "structural_4_1"         "structural_5_1"         "Q580_First Click"      
#> [493] "Q580_Last Click"        "Q580_Page Submit"       "Q580_Click Count"      
#> [496] "essentialist_1_1"       "essentialist_2_1"       "essentialist_3_1"      
#> [499] "essentialist_4_1"       "essentialist_5_1"       "Q515_First Click"      
#> [502] "Q515_Last Click"        "Q515_Page Submit"       "Q515_Click Count"      
#> [505] "choose1_1_1"            "choose1_2_1"            "Q518_First Click"      
#> [508] "Q518_Last Click"        "Q518_Page Submit"       "Q518_Click Count"      
#> [511] "Q522_First Click"       "Q522_Last Click"        "Q522_Page Submit"      
#> [514] "Q522_Click Count"       "choose2_1_1"            "choose2_2_1"           
#> [517] "Q544_First Click"       "Q544_Last Click"        "Q544_Page Submit"      
#> [520] "Q544_Click Count"       "status_high_1_1"        "status_high_2_1"       
#> [523] "Q229_First Click"       "Q229_Last Click"        "Q229_Page Submit"      
#> [526] "Q229_Click Count"       "Q231_First Click"       "Q231_Last Click"       
#> [529] "Q231_Page Submit"       "Q231_Click Count"       "parent1_1_1"           
#> [532] "parent1_2_1"            "parent1_3_1"            "parent1_4_1"           
#> [535] "Q234_First Click"       "Q234_Last Click"        "Q234_Page Submit"      
#> [538] "Q234_Click Count"       "parent2a_1_1"           "parent2a_2_1"          
#> [541] "parent2a_3_1"           "Q237_First Click"       "Q237_Last Click"       
#> [544] "Q237_Page Submit"       "Q237_Click Count"       "parent2b_1_1"          
#> [547] "parent2b_2_1"           "parent2b_3_1"           "Q240_First Click"      
#> [550] "Q240_Last Click"        "Q240_Page Submit"       "Q240_Click Count"      
#> [553] "parent2c_1_1"           "parent2c_2_1"           "parent2c_3_1"          
#> [556] "Q243_First Click"       "Q243_Last Click"        "Q243_Page Submit"      
#> [559] "Q243_Click Count"       "parent2d_1_1"           "parent2d_2_1"          
#> [562] "parent2d_3_1"           "ID"                     "Q_TotalDuration"       
#> [565] "ia female onset"        "inc female onset"       "group female onset"    
#> [568] "peer female onset"      "ambig female onset"     "status female onset"   
#> [571] "parent female onset"    "female offset"          "ia male onset"         
#> [574] "inc male onset"         "group male onset"       "peer male onset"       
#> [577] "ambig male onset"       "status male onset"      "parent male onset"     
#> [580] "male offset"            "ia neither onset"       "inc neither onset"     
#> [583] "group neither onset"    "peer neither onset"     "ambig neither onset"   
#> [586] "status neither onset"   "parent neither onset"   "neither offset"        
#> [589] "FL_84_DO_IA-BG-Female"  "FL_84_DO_IA-WG-Female"  "FL_61_DO_IA-WB-Male"   
#> [592] "FL_61_DO_IA-BB-Male"    "FL_124_DO_IA-BG-Female" "FL_124_DO_IA-WG-Female"

Created on 2022-01-25 by the reprex package (v1.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.3 (2020-10-10) #> os macOS Big Sur 10.16 #> system x86_64, darwin17.0 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Los_Angeles #> date 2022-01-25 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.2) #> backports 1.2.1 2020-12-09 [1] CRAN (R 4.0.2) #> cli 3.0.1 2021-07-17 [1] CRAN (R 4.0.2) #> crayon 1.4.1 2021-02-08 [1] CRAN (R 4.0.2) #> curl 4.3.2 2021-06-23 [1] CRAN (R 4.0.2) #> DBI 1.1.0 2019-12-15 [1] CRAN (R 4.0.2) #> digest 0.6.27 2020-10-24 [1] CRAN (R 4.0.2) #> dplyr 1.0.4 2021-02-02 [1] CRAN (R 4.0.2) #> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.0.2) #> evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.1) #> fansi 0.5.0 2021-05-25 [1] CRAN (R 4.0.2) #> fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.2) #> generics 0.1.0 2020-10-31 [1] CRAN (R 4.0.2) #> glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2) #> highr 0.8 2019-03-20 [1] CRAN (R 4.0.2) #> hms 0.5.3 2020-01-08 [1] CRAN (R 4.0.2) #> htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.2) #> httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.2) #> insight 0.11.1 2020-12-08 [1] CRAN (R 4.0.2) #> jsonlite 1.7.2 2020-12-09 [1] CRAN (R 4.0.3) #> knitr 1.37 2021-12-16 [1] CRAN (R 4.0.2) #> lifecycle 1.0.0 2021-02-15 [1] CRAN (R 4.0.2) #> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.0.2) #> pillar 1.6.2 2021-07-29 [1] CRAN (R 4.0.3) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.2) #> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.2) #> qualtRics * 3.1.3 2020-05-22 [1] CRAN (R 4.0.2) #> R6 2.5.0 2020-10-28 [1] CRAN (R 4.0.2) #> readr 1.4.0 2020-10-05 [1] CRAN (R 4.0.2) #> reprex 1.0.0 2021-01-27 [1] CRAN (R 4.0.2) #> rlang 0.4.11 2021-04-30 [1] CRAN (R 4.0.2) #> rmarkdown 2.5 2020-10-21 [1] CRAN (R 4.0.3) #> rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.0.2) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.2) #> sjlabelled 1.1.7 2020-09-24 [1] CRAN (R 4.0.2) #> stringi 1.5.3 2020-09-09 [1] CRAN (R 4.0.2) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.2) #> styler 1.5.1 2021-07-13 [1] CRAN (R 4.0.2) #> tibble 3.1.3 2021-07-23 [1] CRAN (R 4.0.2) #> tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.2) #> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.0.2) #> vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.0.2) #> withr 2.4.2 2021-04-18 [1] CRAN (R 4.0.2) #> xfun 0.29 2021-12-14 [1] CRAN (R 4.0.2) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.2) #> #> [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library ```
`
juliasilge commented 2 years ago

Yes, it seems like we really need the session info from your RA's computer to figure out what is happening. I recommend using sessioninfo::session_info() and then pasting the results here for us to see.

Has she updated all her packages via update.packages() lately?

aek501 commented 2 years ago

Here is the reprex:

my_survey <- fetch_survey(surveyID = surveys$id[23], force_request = T)
#> Error in fetch_survey(surveyID = surveys$id[23], force_request = T): could not find function "fetch_survey"

Created on 2022-02-11 by the reprex package (v2.0.1)

juliasilge commented 2 years ago

@aek501 You need to load the qualtRics package within your reprex, as well as do whatever you need to get the surveyID. Your reprex will look something like this:

library(qualtRics)
my_survey <- fetch_survey("SV_3gbwq8aJgqPwQDP", force_request = TRUE)
#>   |                                                                              |                                                                      |   0%  |                                                                              |======================================================================| 100%
#> 
#> ── Column specification ────────────────────────────────────────────────────────
#> cols(
#>   .default = col_character(),
#>   StartDate = col_datetime(format = ""),
#>   EndDate = col_datetime(format = ""),
#>   Progress = col_double(),
#>   `Duration (in seconds)` = col_double(),
#>   Finished = col_logical(),
#>   RecordedDate = col_datetime(format = ""),
#>   RecipientLastName = col_logical(),
#>   RecipientFirstName = col_logical(),
#>   RecipientEmail = col_logical(),
#>   ExternalReference = col_logical(),
#>   LocationLatitude = col_double(),
#>   LocationLongitude = col_double(),
#>   SolutionRevision = col_double()
#> )
#> ℹ Use `spec()` for the full column specifications.
#> 'StartDate', 'EndDate', and 'RecordedDate' were converted without a specific timezone
#> • To set a timezone, visit https://www.qualtrics.com/support/survey-platform/managing-your-account/
#> • Timezone information is under 'User Settings'
#> • See https://api.qualtrics.com/instructions/docs/Instructions/dates-and-times.md for more
names(my_survey)
#>  [1] "StartDate"             "EndDate"               "Status"               
#>  [4] "IPAddress"             "Progress"              "Duration (in seconds)"
#>  [7] "Finished"              "RecordedDate"          "ResponseId"           
#> [10] "RecipientLastName"     "RecipientFirstName"    "RecipientEmail"       
#> [13] "ExternalReference"     "LocationLatitude"      "LocationLongitude"    
#> [16] "DistributionChannel"   "UserLanguage"          "Q63"                  
#> [19] "Q16"                   "Q17"                   "Q18"                  
#> [22] "Q19"                   "Q22"                   "SolutionRevision"

Created on 2022-02-15 by the reprex package (v2.0.1)

If you are having trouble using reprex, check out this article along with the others on that site.

juliasilge commented 2 years ago

Let us know if you have further questions! 🙌