ropensci / qualtRics

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

Automatic coercion from logical to character was deprecated in purrr 1.0.0. #313

Closed Allan-Engelhardt-BW closed 1 year ago

Allan-Engelhardt-BW commented 1 year ago

Calling qualtRics::fetch_survey() generates a deprecated warning (here converted to error):

Error in `map()`:
ℹ In index: 1.
Caused by error in `purrr::map_chr()`:
ℹ In index: 1.
Caused by error:
! (converted from warning) Automatic coercion from logical to character was deprecated in purrr 1.0.0.
ℹ Please use an explicit call to `as.character()` within `map_chr()` instead.
ℹ The deprecated feature was likely used in the qualtRics package.
  Please report the issue at <https://github.com/ropensci/qualtRics/issues>.
Backtrace:
  1. purrr::list_rbind(...)
 19. purrr:::deprecate_to_char("logical")
 20. lifecycle::deprecate_warn(...)
 21. lifecycle:::deprecate_warn0(...)
 25. base::warning(wrn)

The call is:

    qualtRics::fetch_survey(
      survey_id,
      time_zone = "Europe/London",
      label = TRUE,
      convert = TRUE,
      force_request = TRUE,
      verbose = FALSE
    )

I am using version 3.1.7 of the package:

> packageVersion("qualtRics")
[1] ‘3.1.7’
juliasilge commented 1 year ago

This problem has been solved already in the development version of the package, which you can install via remotes::install_github("ropensci/qualtRics"). You will no longer see that warning if you install from GitHub:

library(qualtRics)
fetch_survey("SV_XXXXXXXX", 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
#> # A tibble: 26 × 24
#>    StartDate           EndDate             Status         IPAddress     Progress
#>    <dttm>              <dttm>              <chr>          <chr>            <dbl>
#>  1 2020-02-19 18:16:42 2020-02-19 18:17:19 Survey Preview <NA>               100
#>  2 2020-02-19 18:30:55 2020-02-19 18:34:37 IP Address     98.14.36.23        100
#>  3 2020-02-19 18:49:48 2020-02-19 18:50:23 IP Address     75.82.50.44        100
#>  4 2020-02-19 19:46:41 2020-02-19 19:47:01 IP Address     75.172.11.120      100
#>  5 2020-02-19 19:56:28 2020-02-19 19:59:15 IP Address     194.59.251.2…      100
#>  6 2020-02-20 05:22:10 2020-02-20 05:22:58 IP Address     66.168.182.1…      100
#>  7 2020-02-20 05:31:28 2020-02-20 05:32:06 IP Address     35.138.90.71       100
#>  8 2020-02-20 05:52:59 2020-02-20 05:53:26 IP Address     24.254.16.188      100
#>  9 2020-02-20 10:09:48 2020-02-20 10:10:12 IP Address     99.88.198.1        100
#> 10 2020-02-20 19:52:01 2020-02-20 19:52:02 Survey Test    <NA>               100
#> # ℹ 16 more rows
#> # ℹ 19 more variables: `Duration (in seconds)` <dbl>, Finished <lgl>,
#> #   RecordedDate <dttm>, ResponseId <chr>, RecipientLastName <lgl>,
#> #   RecipientFirstName <lgl>, RecipientEmail <lgl>, ExternalReference <lgl>,
#> #   LocationLatitude <dbl>, LocationLongitude <dbl>, DistributionChannel <chr>,
#> #   UserLanguage <chr>, Q63 <ord>, Q16 <ord>, Q17 <chr>, Q18 <ord>, Q19 <chr>,
#> #   Q22 <chr>, SolutionRevision <dbl>

Created on 2023-04-25 with reprex v2.0.2