From 4837033d0dbe1e90a02ef7d2c50a7e837f3533fb Mon Sep 17 00:00:00 2001 From: Jeffrey Stevens <51374986+JeffreyRStevens@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:16:05 -0600 Subject: [PATCH 1/5] Spring cleaning 2024 (#18) * Create qualtrics_fetch2 dataset * Update link to iptools * Reassign column names when rename = TRUE Fix bug where column names are wrong when rename = TRUE and column names are specified * Remove .data$ from column references Avoids tidyselect errors but still has "no visible binding for global variable" notes when checking * Revert "Remove .data$ from column references" This reverts commit 98f5b51e230857cd71aba2ba2241bc89b277f0ea. * Remove .data from selections * Fix tests with rename = FALSE * Tidy up DESCRIPTION --- DESCRIPTION | 47 ++++++++++++-------------- R/duplicates.R | 10 +++--- R/duration.R | 5 +-- R/ip.R | 8 +++-- R/location.R | 8 +++-- R/preview.R | 6 ++-- R/progress.R | 5 +-- R/qualtrics_data.R | 55 +++++++++++++++++++++++++++---- R/rename_columns.R | 18 +++++----- R/resolution.R | 7 ++-- data/qualtrics_fetch2.rda | Bin 0 -> 6947 bytes man/qualtrics_fetch.Rd | 5 ++- man/qualtrics_fetch2.Rd | 55 +++++++++++++++++++++++++++++++ man/qualtrics_numeric.Rd | 3 +- man/qualtrics_raw.Rd | 1 + man/qualtrics_text.Rd | 3 +- tests/testthat/test-duplicates.R | 2 ++ tests/testthat/test-duration.R | 2 ++ tests/testthat/test-ip.R | 2 ++ tests/testthat/test-location.R | 2 ++ tests/testthat/test-preview.R | 2 ++ tests/testthat/test-progress.R | 2 ++ tests/testthat/test-resolution.R | 2 ++ tests/testthat/test-utils.R | 9 ++--- 24 files changed, 190 insertions(+), 69 deletions(-) create mode 100644 data/qualtrics_fetch2.rda create mode 100644 man/qualtrics_fetch2.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 7c54262..eb6f8e9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,32 +1,24 @@ Package: excluder Title: Checks for Exclusion Criteria in Online Data Version: 0.5.0 -Authors@R: - c(person(given = "Jeffrey R.", - family = "Stevens", - role = c("aut", "cre", "cph"), - email = "jeffrey.r.stevens@protonmail.com", +Authors@R: c( + person("Jeffrey R.", "Stevens", , "jeffrey.r.stevens@protonmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0003-2375-1360")), - person(given = "Joseph", - family = "O'Brien", - role = c("rev"), - comment = c(ORCID = "0000-0001-9851-5077")), - person(given = "Julia", - family = "Silge", - role = c("rev"), - email = "julia.silge@gmail.com", - comment = c(ORCID = "0000-0002-3671-836X"))) -Description: Data that are collected through online sources such as Mechanical - Turk may require excluding rows because of IP address duplication, - geolocation, or completion duration. This package facilitates - exclusion of these data for Qualtrics datasets. + person("Joseph", "O'Brien", role = "rev", + comment = c(ORCID = "0000-0001-9851-5077")), + person("Julia", "Silge", , "julia.silge@gmail.com", role = "rev", + comment = c(ORCID = "0000-0002-3671-836X")) + ) +Description: Data that are collected through online sources such as + Mechanical Turk may require excluding rows because of IP address + duplication, geolocation, or completion duration. This package + facilitates exclusion of these data for Qualtrics datasets. License: GPL (>= 3) -Encoding: UTF-8 -LazyData: true -Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 -URL: https://docs.ropensci.org/excluder/, https://github.com/ropensci/excluder/ +URL: https://docs.ropensci.org/excluder/, + https://github.com/ropensci/excluder/ BugReports: https://github.com/ropensci/excluder/issues/ +Depends: + R (>= 3.5.0) Imports: cli, curl, @@ -40,8 +32,6 @@ Imports: stringr, tidyr, tidyselect -Depends: - R (>= 3.5.0) Suggests: covr, knitr, @@ -50,5 +40,10 @@ Suggests: rmarkdown, testthat (>= 3.0.0), withr +VignetteBuilder: + knitr Config/testthat/edition: 3 -VignetteBuilder: knitr +Encoding: UTF-8 +LazyData: true +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.2.3 diff --git a/R/duplicates.R b/R/duplicates.R index 9e71b76..74f3b9f 100644 --- a/R/duplicates.R +++ b/R/duplicates.R @@ -77,6 +77,8 @@ mark_duplicates <- function(x, # Rename columns if (rename) { x <- rename_columns(x, alert = FALSE) + id_col <- "ResponseId" + ip_col <- "IPAddress" } # Check for presence of required columns @@ -100,7 +102,7 @@ mark_duplicates <- function(x, no_nas_ip <- tidyr::drop_na(x, tidyselect::all_of(ip_col)) n_nas_ip <- nrow(x) - nrow(no_nas_ip) same_ip <- janitor::get_dupes(no_nas_ip, tidyselect::all_of(ip_col)) %>% - dplyr::select(-.data$dupe_count) + dplyr::select(-"dupe_count") n_same_ip <- nrow(same_ip) if (identical(quiet, FALSE)) { cli::cli_alert_info( @@ -125,7 +127,7 @@ mark_duplicates <- function(x, no_nas_loc, tidyselect::all_of(location_col) ) %>% - dplyr::select(-.data$dupe_count) + dplyr::select(-"dupe_count") n_same_location <- nrow(same_location) if (identical(quiet, FALSE)) { cli::cli_alert_info( @@ -244,7 +246,7 @@ check_duplicates <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_duplicates == "duplicates") %>% - keep_marked_column(.data$exclusion_duplicates, keep) + keep_marked_column("exclusion_duplicates", keep) # Determine whether to print results print_data(exclusions, print) @@ -316,7 +318,7 @@ exclude_duplicates <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_duplicates != "duplicates") %>% - dplyr::select(-.data$exclusion_duplicates) + dplyr::select(-"exclusion_duplicates") # Print exclusion statement if (identical(silent, FALSE)) { diff --git a/R/duration.R b/R/duration.R index 6b3073a..364183d 100644 --- a/R/duration.R +++ b/R/duration.R @@ -61,6 +61,7 @@ mark_duration <- function(x, # Rename columns if (rename) { x <- rename_columns(x, alert = FALSE) + id_col <- "ResponseId" } # Check for presence of required columns @@ -192,7 +193,7 @@ check_duration <- function(x, ) %>% dplyr::filter(.data$exclusion_duration == "duration_quick" | .data$exclusion_duration == "duration_slow") %>% - keep_marked_column(.data$exclusion_duration, keep) + keep_marked_column("exclusion_duration", keep) # Determine whether to print results print_data(exclusions, print) @@ -256,7 +257,7 @@ exclude_duration <- function(x, ) %>% dplyr::filter(.data$exclusion_duration != "duration_quick" & .data$exclusion_duration != "duration_slow") %>% - dplyr::select(-.data$exclusion_duration) + dplyr::select(-"exclusion_duration") # Print exclusion statement diff --git a/R/ip.R b/R/ip.R index 40dd53a..9bdf36d 100644 --- a/R/ip.R +++ b/R/ip.R @@ -75,6 +75,8 @@ mark_ip <- function(x, # Rename columns if (rename) { x <- rename_columns(x, alert = FALSE) + id_col <- "ResponseId" + ip_col <- "IPAddress" } # Check for presence of required column @@ -123,7 +125,7 @@ mark_ip <- function(x, outside_country <- !ipaddress::is_within_any(survey_ips, country_ip_ranges) filtered_data <- dplyr::bind_cols(filtered_data, outside = outside_country) filtered_data <- dplyr::filter(filtered_data, .data$outside == TRUE) %>% - dplyr::select(-.data$outside) + dplyr::select(-"outside") n_outside_country <- nrow(filtered_data) # Filter NAs when requested @@ -231,7 +233,7 @@ check_ip <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_ip == "ip") %>% - keep_marked_column(.data$exclusion_ip, keep) + keep_marked_column("exclusion_ip", keep) # Determine whether to print results print_data(exclusions, print) @@ -300,7 +302,7 @@ exclude_ip <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_ip != "ip") %>% - dplyr::select(-.data$exclusion_ip) + dplyr::select(-"exclusion_ip") # Print exclusion statement if (identical(silent, FALSE)) { diff --git a/R/location.R b/R/location.R index 8387a87..fa05067 100644 --- a/R/location.R +++ b/R/location.R @@ -65,6 +65,8 @@ mark_location <- function(x, # Rename columns if (rename) { x <- rename_columns(x, alert = FALSE) + id_col <- "ResponseId" + location_col <- c("LocationLatitude", "LocationLongitude") } # Check for presence of required column @@ -91,7 +93,7 @@ mark_location <- function(x, # Determine if geolocation is within US no_nas$country <- maps::map.where(database = "usa", longitude, latitude) outside_us <- dplyr::filter(no_nas, is.na(.data$country)) %>% - dplyr::select(-.data$country) + dplyr::select(-"country") n_outside_us <- nrow(outside_us) # Combine no location with outside US @@ -189,7 +191,7 @@ check_location <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_location == "location") %>% - keep_marked_column(.data$exclusion_location, keep) + keep_marked_column("exclusion_location", keep) # Determine whether to print results print_data(exclusions, print) @@ -249,7 +251,7 @@ exclude_location <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_location != "location") %>% - dplyr::select(-.data$exclusion_location) + dplyr::select(-"exclusion_location") # Print exclusion statement if (identical(silent, FALSE)) { diff --git a/R/preview.R b/R/preview.R index 9465d72..e85b37d 100644 --- a/R/preview.R +++ b/R/preview.R @@ -51,6 +51,8 @@ mark_preview <- function(x, # Rename columns if (rename) { x <- rename_columns(x, alert = FALSE) + id_col <- "ResponseId" + preview_col <- "Status" } # Check for presence of required column @@ -148,7 +150,7 @@ check_preview <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_preview == "preview") %>% - keep_marked_column(.data$exclusion_preview, keep) + keep_marked_column("exclusion_preview", keep) # Determine whether to print results print_data(exclusions, print) @@ -205,7 +207,7 @@ exclude_preview <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_preview != "preview") %>% - dplyr::select(-.data$exclusion_preview) + dplyr::select(-"exclusion_preview") # Print exclusion statement if (identical(silent, FALSE)) { diff --git a/R/progress.R b/R/progress.R index 8b6d3a6..8f3bf4f 100644 --- a/R/progress.R +++ b/R/progress.R @@ -64,6 +64,7 @@ mark_progress <- function(x, # Rename columns if (rename) { x <- rename_columns(x, alert = FALSE) + id_col <- "ResponseId" } # Check for presence of required column @@ -185,7 +186,7 @@ check_progress <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_progress == "progress") %>% - keep_marked_column(.data$exclusion_progress, keep) + keep_marked_column("exclusion_progress", keep) # Determine whether to print results print_data(exclusions, print) @@ -253,7 +254,7 @@ exclude_progress <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_progress != "progress") %>% - dplyr::select(-.data$exclusion_progress) + dplyr::select(-"exclusion_progress") # Print exclusion statement if (identical(silent, FALSE)) { diff --git a/R/qualtrics_data.R b/R/qualtrics_data.R index 3dbeec0..9c2789e 100644 --- a/R/qualtrics_data.R +++ b/R/qualtrics_data.R @@ -38,7 +38,8 @@ #' #' A dataset containing the metadata from a standard Qualtrics survey with #' browser metadata collected and exported with "Use numeric values". -#' These data were randomly generated using [iptools::ip_random()] and +#' These data were randomly generated using [iptools::ip_random()]( +#' https://hrbrmstr.github.io/iptools/reference/ip_random.html) and #' [rgeolocate::ip2location()]( #' https://cran.r-project.org/package=rgeolocate) functions. #' @@ -71,7 +72,8 @@ #' #' A dataset containing the metadata from a standard Qualtrics survey with #' browser metadata collected and exported with "Use choice text". -#' These data were randomly generated using [iptools::ip_random()] and +#' These data were randomly generated using [iptools::ip_random()]( +#' https://hrbrmstr.github.io/iptools/reference/ip_random.html) and #' [rgeolocate::ip2location()]( #' https://cran.r-project.org/package=rgeolocate) functions. #' @@ -108,10 +110,8 @@ #' were imported using #' [`qualtRics::fetch_survey()`]( #' https://docs.ropensci.org/qualtRics/reference/fetch_survey.html). -#' and then the secondary labels were assigned as column names with -#' [`sjlabelled::get_label()`]( -#' https://strengejacke.github.io/sjlabelled/reference/get_label.html). -#' These data were randomly generated using [iptools::ip_random()] and +#' These data were randomly generated using [iptools::ip_random()]( +#' https://hrbrmstr.github.io/iptools/reference/ip_random.html) and #' [rgeolocate::ip2location()]( #' https://cran.r-project.org/package=rgeolocate) functions. #' @@ -141,3 +141,46 @@ #' } #' @family data "qualtrics_fetch" + +#' Example numeric metadata imported with `qualtRics::fetch_survey()` from +#' simulated Qualtrics study but with labels included as column names +#' +#' A dataset containing the metadata from a standard Qualtrics survey with +#' browser metadata collected and exported with "Use numeric values". The data +#' were imported using +#' [`qualtRics::fetch_survey()`]( +#' https://docs.ropensci.org/qualtRics/reference/fetch_survey.html). +#' and then the secondary labels were assigned as column names with +#' [`sjlabelled::get_label()`]( +#' https://strengejacke.github.io/sjlabelled/reference/get_label.html). +#' These data were randomly generated using [iptools::ip_random()]( +#' https://hrbrmstr.github.io/iptools/reference/ip_random.html) and +#' [rgeolocate::ip2location()]( +#' https://cran.r-project.org/package=rgeolocate) functions. +#' +#' @format A data frame with 100 rows and 17 variables: +#' \describe{ +#' \item{Start Date}{date and time data collection started, in ISO 8601 format} +#' \item{End Date}{date and time data collection ended, in ISO 8601 format} +#' \item{Response Type}{numeric flag for preview (1) vs. implemented survey (0) +#' entries} +#' \item{IP Address}{participant IP address (truncated for anonymity)} +#' \item{Progress}{percentage of survey completed} +#' \item{Duration (in seconds)}{duration of time required to complete survey, +#' in seconds} +#' \item{Finished}{numeric flag for whether survey was completed (1) or +#' progress was < 100 (0)} +#' \item{Recorded Date}{date and time survey was recorded, in ISO 8601 format} +#' \item{Response ID}{random ID for participants} +#' \item{Location Latitude}{latitude geolocated from IP address} +#' \item{Location Longitude}{longitude geolocated from IP address} +#' \item{User Language}{language set in Qualtrics} +#' \item{Click to write the question text - Browser}{user web browser type} +#' \item{Click to write the question text - Version}{user web browser version} +#' \item{Click to write the question text - Operating System}{user operating system} +#' \item{Click to write the question text - Resolution}{user screen resolution} +#' \item{like}{response to question about whether the user liked the survey +#' (1 = Yes, 0 = No)} +#' } +#' @family data +"qualtrics_fetch2" diff --git a/R/rename_columns.R b/R/rename_columns.R index 0064a05..750ec24 100644 --- a/R/rename_columns.R +++ b/R/rename_columns.R @@ -58,15 +58,15 @@ rename_columns <- function(x, alert = TRUE) { # Rename columns x %>% dplyr::rename( - StartDate = .data$`Start Date`, - EndDate = .data$`End Date`, - Status = .data$`Response Type`, - IPAddress = .data$`IP Address`, - RecordedDate = .data$`Recorded Date`, - ResponseId = .data$`Response ID`, - LocationLatitude = .data$`Location Latitude`, - LocationLongitude = .data$`Location Longitude`, - UserLanguage = .data$`User Language` + StartDate = "Start Date", + EndDate = "End Date", + Status = "Response Type", + IPAddress = "IP Address", + RecordedDate = "Recorded Date", + ResponseId = "Response ID", + LocationLatitude = "Location Latitude", + LocationLongitude = "Location Longitude", + UserLanguage = "User Language" ) %>% dplyr::rename_with(~ gsub(throwaway, "", .x), dplyr::contains(throwaway)) } else if (any(grepl("_Resolution", column_names))) { diff --git a/R/resolution.R b/R/resolution.R index 3f2652b..7031501 100644 --- a/R/resolution.R +++ b/R/resolution.R @@ -58,6 +58,7 @@ mark_resolution <- function(x, # Rename columns if (rename) { x <- rename_columns(x, alert = FALSE) + id_col <- "ResponseId" } # Check for presence of required column @@ -96,7 +97,7 @@ mark_resolution <- function(x, height = readr::parse_number(.data$height) ) %>% dplyr::rowwise() %>% - dplyr::mutate(max_res = max(dplyr::across(c(.data$width, .data$height)))) %>% + dplyr::mutate(max_res = max(dplyr::across(c("width", "height")))) %>% dplyr::filter(.data$max_res < res_min | .data$width < width_min | .data$height < height_min) n_wrong_resolution <- nrow(filtered_data) @@ -184,7 +185,7 @@ check_resolution <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_resolution == "resolution") %>% - keep_marked_column(.data$exclusion_resolution, keep) + keep_marked_column("exclusion_resolution", keep) # Determine whether to print results print_data(exclusions, print) @@ -243,7 +244,7 @@ exclude_resolution <- function(x, quiet = quiet ) %>% dplyr::filter(.data$exclusion_resolution != "resolution") %>% - dplyr::select(-.data$exclusion_resolution) + dplyr::select(-"exclusion_resolution") # Print exclusion statement if (identical(silent, FALSE)) { diff --git a/data/qualtrics_fetch2.rda b/data/qualtrics_fetch2.rda new file mode 100644 index 0000000000000000000000000000000000000000..82dc37ed10fa2f77ff9ff2835f2adf67a6d323d9 GIT binary patch literal 6947 zcmaiyRaBG>z^&hbVHjXQx=vLbZX_ zqR|+oPlO_B$fT=L5dxJ4lj5SZmztl7t`^l67Jkd5J8}?a=SE7!X>p#%DI)h?Q#~ns z&6<_Yfxe1?k2zp{loPLoU((L0l)y0r`3MMV299H9V`ed8!&SqzYaxI&D~>$ON>oEe z=FF>sCKl%S)XJ_HU5c+0evj}k)e8c0^M`r$Kvdw`5 z5EL*2_=X^6W^?{m{cr!ju$F*(I5_0N0~Z8E9H|t_929Kw6hJCK4=5x0Oa%)}fV39~ zH~@eIfK&?b6%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2!vDp69&U zqnfX--7kL?EQt`2H_`m2v~6zo7KgKD=qXXF= zr_U6Ww6>#PjAV{(|KjhYe7Js+_K|GVr8q$8&?_Lju~k*DoS3Az(`PTB${&+0+5d2E zAtU5#6+ka)reLqfs~o9$m-0H^F%j~mv+{XIXiu-#^h&9{tvxQcuNk-Kc%z~u<1sw& zi4ySvpf(<#ko7j+c1Pw zs)>qn+}1vY)AD#ywZ+&{hTZkaA9@|$X~#$LLi(>gq5}d0=Q8RiD#~chKa$gP4L2ie zZ0CNHCSOR%EN?E~eDwZpNYz~T!R`!Vojf;sqxF6)Kg969Hj^z)Hz6+1HoKc|YV-M{ zwg~z9EoWXlCIuoh2okZ^tgF8Kw8Pl3M~R2nE+Rc6+7EyHL9oL6r4LY2OeJkvQL&=JY79+^GJzya3w~rm-Xzz#+|`> zU}okg#z%Eti)ce5!YT#X&(Wxy;z_$^@wtHwY+20d?O(Xf|W~r)x|D{xIc<&*xK|N%@BjlW)*2fyV`NE<8TI=r( zv#X*i5?Raz-EcEyQjg6TCk|`al-ZYtvb9*Y@4f7o@?%;(N$KRBEDpJN`7@HG(CTu6 z((BOCBISgc6e56(^-NhzCA%tzB4`u Date: Sat, 13 Jan 2024 11:18:43 -0600 Subject: [PATCH 2/5] Update to version 0.5.1 --- CRAN-SUBMISSION | 3 +++ DESCRIPTION | 2 +- NEWS.md | 46 ++++++++++++++++++++++++++++++++++------------ 3 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 CRAN-SUBMISSION diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION new file mode 100644 index 0000000..be42bd0 --- /dev/null +++ b/CRAN-SUBMISSION @@ -0,0 +1,3 @@ +Version: 0.5.0 +Date: 2023-02-13 03:14:16 UTC +SHA: 8fbdec232b95bb5ba6b2a53a5d3cd04b2c2136d7 diff --git a/DESCRIPTION b/DESCRIPTION index eb6f8e9..dc364ae 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: excluder Title: Checks for Exclusion Criteria in Online Data -Version: 0.5.0 +Version: 0.5.1 Authors@R: c( person("Jeffrey R.", "Stevens", , "jeffrey.r.stevens@protonmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0003-2375-1360")), diff --git a/NEWS.md b/NEWS.md index e428640..ee10f25 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,27 +1,49 @@ -# excluder 0.5.0 +# excluder 0.5.1 (2024-01-13) + +### NEW FEATURES + +* Added new `qualtrics_fetch2` dataset that includes labels as column names. + +### PACKAGE DEVELOPMENT + +* The {tidyselect} package has deprecated using the `.data` pronoun in tidy selections. So `.data` is no longer used in `select()` or other selection functions. +* We used the `usethis::use_tidy_description()` to tidy up DESCRIPTION file. + +### BUG FIXES + +* Fixed bug to now reassign column names when `rename = TRUE`. + +### DOCUMENTATION UPDATES + +* We have switched from the {devtools} to the {remotes} version of `install_github()` in the README to reduce dependencies. +* Because the {iptools} package has been removed from CRAN, the links to {iptools} functions now refer to the GitHub site. + + +# excluder 0.5.0 (2023-02-13) ### PACKAGE DEVELOPMENT * The `{iptools}` package has been replaced with the [`{ipaddress}`](https://github.com/davidchall/ipaddress) package. -## DOCUMENTATION UPDATES +### DOCUMENTATION UPDATES * The _Getting started_ vignette has been renamed _excluder_. * The data sets have been added to the References page. -# excluder 0.4.0 -## NEW FEATURES +# excluder 0.4.0 (2022-06-22) + +### NEW FEATURES * The `use_labels()` function extracts the Qualtrics question labels included when importing with `qualtRics::fetch_survey()` and renames the column names with these labels. * The `qualtrics_fetch` data set offers an example data set that is imported using the `qualtRics::fetch_survey()` function. * The `rename_columns()` function renames the columns to match standard Qualtrics column names. This is primarily a utility function for the `mark_*()` functions but may be useful to users in some circumstances. -## MINOR IMPROVEMENTS +### MINOR IMPROVEMENTS * For excluding based on screen resolution, previously you had to provide a minimum width or height. This works fine if all screens are in the same orientation, but if screens differ in their orientation, this isn't sufficient. Now there is an overall minimum argument `res_min` that will apply to both width and height. That is, now you can test if at least one of the dimensions has a resolution greater than `res_min`. (#9) -## DOCUMENTATION UPDATES +### DOCUMENTATION UPDATES * To use several of the exclusion criteria, you must collect non-anonymized data and/or computer metadata. The documentation now points to the Qualtrics documentation about non-anonymized data and computer metadata. @@ -32,17 +54,17 @@ * Tests for helper functions have been improved. -# excluder 0.3.3 +# excluder 0.3.3 (2021-12-03) -## BUG FIXES +### BUG FIXES * Updating `{dplyr}` to 1.0.8 caught problem with using `across()` inside `is.na()`. Instead, it now uses `if_all()` with `is.na()` as argument. Thanks to [@romainfrancois](https://github.com/romainfrancois) for pull request [\#7](https://github.com/ropensci/excluder/pull/7). * `remove_label_rows()` now properly converts numeric data in Status and Finished columns. -# excluder 0.3.2 +# excluder 0.3.2 (2021-11-10) -## MINOR IMPROVEMENTS +### MINOR IMPROVEMENTS * The `remove_label_rows()` function can now rename columns to match the default column names used in all of the verb function arguments. * The `mark_ip_()` function now checks for (1) internet connectivity, (2) whether the IP address data can be downloaded from https://www.iwik.org/ipcountry/, and (3) if the country code is valid. The function fails gracefully if any of these are not met. @@ -59,7 +81,7 @@ * Clean up package in preparation for submission to CRAN. -# excluder 0.3.1 +# excluder 0.3.1 (2021-11-04) ### MINOR IMPROVEMENTS @@ -79,7 +101,7 @@ * The `{excluder}` package has now been approved by and transferred to [rOpenSci](https://ropensci.org/). The package was peer reviewed by Joseph O'Brien ([@jmobrien](https://github.com/jmobrien)) and Julia Silge ([@juliasilge](https://github.com/juliasilge)), who are now listed as reviewers in the DESCRIPTION file. -# excluder 0.3.0 +# excluder 0.3.0 (2021-10-13) ### NEW FEATURES From db7b2220d25d0b6e4ada66fd0235d9699280ac9e Mon Sep 17 00:00:00 2001 From: Jeffrey Stevens <51374986+JeffreyRStevens@users.noreply.github.com> Date: Sat, 13 Jan 2024 11:39:23 -0600 Subject: [PATCH 3/5] Update cran-comments.md --- cran-comments.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cran-comments.md b/cran-comments.md index 43ecf73..908cac3 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,9 +1,3 @@ -## Resubmission -This is a resubmission. In this version I have: - -* Update the CITATION style replacing personList() with c() and citEntry() with bibentry() - -* Removed the 'rstudio' file ## R CMD check results There were no ERRORs or WARNINGs. From f6b1570fed8084d72504560612d59bffc497fab0 Mon Sep 17 00:00:00 2001 From: "Jeffrey R. Stevens" Date: Sun, 14 Jan 2024 17:09:17 -0600 Subject: [PATCH 4/5] Update codemeta.json --- codemeta.json | 54 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/codemeta.json b/codemeta.json index 7ac5af0..9b3ba8a 100644 --- a/codemeta.json +++ b/codemeta.json @@ -4,17 +4,17 @@ "identifier": "excluder", "description": "Data that are collected through online sources such as Mechanical Turk may require excluding rows because of IP address duplication, geolocation, or completion duration. This package facilitates exclusion of these data for Qualtrics datasets.", "name": "excluder: Checks for Exclusion Criteria in Online Data", - "relatedLink": "https://docs.ropensci.org/excluder/", + "relatedLink": ["https://docs.ropensci.org/excluder/", "https://CRAN.R-project.org/package=excluder"], "codeRepository": "https://github.com/ropensci/excluder/", "issueTracker": "https://github.com/ropensci/excluder/issues/", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.5.0", + "version": "0.5.1", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.2.2 Patched (2022-11-10 r83330)", + "runtimePlatform": "R version 4.3.2 (2023-10-31)", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -137,6 +137,12 @@ ], "softwareRequirements": { "1": { + "@type": "SoftwareApplication", + "identifier": "R", + "name": "R", + "version": ">= 3.5.0" + }, + "2": { "@type": "SoftwareApplication", "identifier": "cli", "name": "cli", @@ -148,7 +154,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=cli" }, - "2": { + "3": { "@type": "SoftwareApplication", "identifier": "curl", "name": "curl", @@ -160,7 +166,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=curl" }, - "3": { + "4": { "@type": "SoftwareApplication", "identifier": "dplyr", "name": "dplyr", @@ -172,7 +178,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=dplyr" }, - "4": { + "5": { "@type": "SoftwareApplication", "identifier": "ipaddress", "name": "ipaddress", @@ -184,7 +190,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=ipaddress" }, - "5": { + "6": { "@type": "SoftwareApplication", "identifier": "janitor", "name": "janitor", @@ -196,7 +202,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=janitor" }, - "6": { + "7": { "@type": "SoftwareApplication", "identifier": "lubridate", "name": "lubridate", @@ -208,7 +214,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=lubridate" }, - "7": { + "8": { "@type": "SoftwareApplication", "identifier": "magrittr", "name": "magrittr", @@ -220,7 +226,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=magrittr" }, - "8": { + "9": { "@type": "SoftwareApplication", "identifier": "maps", "name": "maps", @@ -232,7 +238,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=maps" }, - "9": { + "10": { "@type": "SoftwareApplication", "identifier": "rlang", "name": "rlang", @@ -244,7 +250,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=rlang" }, - "10": { + "11": { "@type": "SoftwareApplication", "identifier": "stringr", "name": "stringr", @@ -256,7 +262,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=stringr" }, - "11": { + "12": { "@type": "SoftwareApplication", "identifier": "tidyr", "name": "tidyr", @@ -268,7 +274,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=tidyr" }, - "12": { + "13": { "@type": "SoftwareApplication", "identifier": "tidyselect", "name": "tidyselect", @@ -280,15 +286,9 @@ }, "sameAs": "https://CRAN.R-project.org/package=tidyselect" }, - "13": { - "@type": "SoftwareApplication", - "identifier": "R", - "name": "R", - "version": ">= 3.5.0" - }, "SystemRequirements": null }, - "fileSize": "335.041KB", + "fileSize": "360.275KB", "citation": [ { "@type": "ScholarlyArticle", @@ -317,5 +317,15 @@ } } } - ] + ], + "releaseNotes": "https://github.com/ropensci/excluder/blob/master/NEWS.md", + "readme": "https://github.com/ropensci/excluder/blob/main/README.md", + "contIntegration": ["https://github.com/ropensci/excluder/actions", "https://app.codecov.io/gh/jeffreyrstevens/excluder?branch=main"], + "developmentStatus": ["https://www.repostatus.org/#active", "https://lifecycle.r-lib.org/articles/stages.html#stable"], + "review": { + "@type": "Review", + "url": "https://github.com/ropensci/software-review/issues/455", + "provider": "https://ropensci.org" + }, + "keywords": ["qualtrics", "mturk", "datacleaning", "exclusion", "r", "rstats", "r-package"] } From aff35aa21e3a8d0bcbb2d9ee4a897af6e5a22fba Mon Sep 17 00:00:00 2001 From: "Jeffrey R. Stevens" Date: Sun, 14 Jan 2024 17:15:57 -0600 Subject: [PATCH 5/5] Delete CRAN-SUBMISSION --- CRAN-SUBMISSION | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 CRAN-SUBMISSION diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION deleted file mode 100644 index be42bd0..0000000 --- a/CRAN-SUBMISSION +++ /dev/null @@ -1,3 +0,0 @@ -Version: 0.5.0 -Date: 2023-02-13 03:14:16 UTC -SHA: 8fbdec232b95bb5ba6b2a53a5d3cd04b2c2136d7