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

Question/ comment about the documentation #341

Open
zaslove opened this issue Apr 14, 2024 · 3 comments
Open

Question/ comment about the documentation #341

zaslove opened this issue Apr 14, 2024 · 3 comments

Comments

@zaslove
Copy link

zaslove commented Apr 14, 2024

Hallo,
I very much like your package!

I have a question. Not about a bug but a comment on the documentation.

I was wondering why all of the examples that are used in the documentation use the location: my_survey <- fetch_survey(surveyID = surveys$id[6]) instead of the string and the Unique ID. Like this: fetch_survey(surveyID = "SV_brr7rymdAnaGekS",

In the documentation, the use of the string and the Unique ID is explained:

surveyID
String. Unique ID for the survey you want to download. Returned as id by the all_surveys function.

However, all of the examples use the surveys$id[6].

I would imagine that using the unique id (fetch_survey(surveyID = "SV_brr7rymdAnaGekS", ) would be preferred to the location, due to precision and due to consistency over time.

Or am I missing something?

@juliasilge
Copy link
Collaborator

That is intended to show folks one possible way to get their survey ID, i.e. you can find all your surveys with all_surveys():

library(qualtRics)
surveys <- all_surveys()
surveys
#> # A tibble: 6 × 6
#>   id                 name             ownerId lastModified creationDate isActive
#>   <chr>              <chr>            <chr>   <chr>        <chr>        <lgl>   
#> 1 SV_3gbwq8aJgqPwQDP Beskar Armor     UR_8wf… 2023-07-20T… 2020-02-20T… TRUE    
#> 2 SV_3gtKaK8G1Z1JC50 Priorities for … UR_8wf… 2024-02-23T… 2021-10-04T… FALSE   
#> 3 SV_56icaa9YAafpAqx Cats Can Have a… UR_8wf… 2020-06-10T… 2020-02-11T… TRUE    
#> 4 SV_5BJRo2RGHajIlOB Sourdough Bread  UR_8wf… 2021-07-06T… 2020-03-29T… TRUE    
#> 5 SV_aWw8ocGN5aPgeZE Priorities for … UR_8wf… 2024-02-28T… 2024-02-23T… TRUE    
#> 6 SV_ezYI0F3V9K5Tr3D Priorities for … UR_8wf… 2021-10-04T… 2020-04-23T… FALSE

## that makes this a vector of survey IDs:
surveys$id
#> [1] "SV_3gbwq8aJgqPwQDP" "SV_3gtKaK8G1Z1JC50" "SV_56icaa9YAafpAqx"
#> [4] "SV_5BJRo2RGHajIlOB" "SV_aWw8ocGN5aPgeZE" "SV_ezYI0F3V9K5Tr3D"

## here is one example survey:
surveys$id[6]
#> [1] "SV_ezYI0F3V9K5Tr3D"

## or I could use a different one:
surveys$id[2]
#> [1] "SV_3gtKaK8G1Z1JC50"

Created on 2024-04-15 with reprex v2.1.0

The specific number 6 isn't meaningful (just a way to get an element out of the vector of survey IDs) and when I analyze a survey myself, I do often hard code the "SV_xxxxxxx" string in my code.

@zaslove
Copy link
Author

zaslove commented Apr 16, 2024

Hallo,
Thanks for the quick response. Maybe my point was too simple or obvious. :-)

I thought it would be nice to also show the hard code option in the documentation. Just to explicitly show that this is also an option.

my_survey <- fetch_survey(surveyID = surveys$id[6],
verbose = TRUE)

my_survey <- fetch_survey(surveyID = "SV_xxxxxxx", # assuming that "SV_xxxxxxx" is the unique id from surveys$id[6]
verbose = TRUE)

@juliasilge
Copy link
Collaborator

Ah, I understand! Yes, we could add something like that to the documentation. 👍

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

2 participants