You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`mark` functions add a new column to the original data frame that labels the rows meeting the exclusion criteria. This is useful to label the potential exclusions for future processing without changing the original data frame.
44
45
*`check` functions search for the exclusion criteria and output a message with the number of rows meeting the criteria and a data frame of the rows meeting the criteria. This is useful for viewing the potential exclusions.
45
46
*`exclude` functions remove rows meeting the exclusion criteria. This is safest to do after checking the rows to ensure the exclusions are correct.
46
-
*`mark` functions add a new column to the original data frame that labels the rows meeting the exclusion criteria. This is useful to label the potential exclusions for future processing without changing the original data frame.
47
47
48
48
## Exclusion types
49
49
This package provides seven types of exclusions based on Qualtrics metadata. If you have ideas for other metadata exclusions, please submit them as [issues](https://github.com/jeffreyrstevens/excluder/issues). Note, the intent of this package is not to develop functions for excluding rows based on survey-specific data but on general, frequently used metadata.
@@ -59,14 +59,35 @@ This package provides seven types of exclusions based on Qualtrics metadata. If
59
59
60
60
## Usage
61
61
62
-
The verbs and exclusion types combine with `_` to create the functions, such as [`check_duplicates()`](https://jeffreyrstevens.github.io/excluder/reference/check_duplicates.html), [`exclude_ip()`](https://jeffreyrstevens.github.io/excluder/reference/exclude_ip.html), and [`mark_duration()`](https://jeffreyrstevens.github.io/excluder/reference/mark_duration.html). Multiple functions can be linked together using the [`{magrittr}`](https://magrittr.tidyverse.org/) pipe `%>%`. For datasets downloaded directly from Qualtrics, use [`remove_label_rows()`](https://jeffreyrstevens.github.io/excluder/reference/remove_label_rows.html) to remove the first two rows of labels and convert date and numeric columns in the metadata and use [`deidentify()`](https://jeffreyrstevens.github.io/excluder/reference/deidentify.html) to remove standard Qualtrics columns with identifiable information.
62
+
The verbs and exclusion types combine with `_` to create the functions, such as [`check_duplicates()`](https://jeffreyrstevens.github.io/excluder/reference/check_duplicates.html), [`exclude_ip()`](https://jeffreyrstevens.github.io/excluder/reference/exclude_ip.html), and [`mark_duration()`](https://jeffreyrstevens.github.io/excluder/reference/mark_duration.html). Multiple functions can be linked together using the [`{magrittr}`](https://magrittr.tidyverse.org/) pipe `%>%`. For datasets downloaded directly from Qualtrics, use [`remove_label_rows()`](https://jeffreyrstevens.github.io/excluder/reference/remove_label_rows.html) to remove the first two rows of labels and convert date and numeric columns in the metadata, and use [`deidentify()`](https://jeffreyrstevens.github.io/excluder/reference/deidentify.html) to remove standard Qualtrics columns with identifiable information (e.g., IP addresses, geolocation).
63
+
64
+
### Marking
65
+
The `mark_*()` functions output the original data set with a new column specifying rows that meet the exclusion criteria. These can be piped together with `%>%` for multiple exclusion types.
66
+
67
+
```{r mark1}
68
+
library(excluder)
69
+
# Mark preview and short duration rows
70
+
df <- qualtrics_text %>%
71
+
mark_preview() %>%
72
+
mark_duration(min_duration = 200)
73
+
tibble::glimpse(df)
74
+
```
75
+
76
+
Use the [`unite_exclusions()`](https://jeffreyrstevens.github.io/excluder/reference/unite_exclusions.html) function to unite all of the marked columns into a single column.
77
+
```{r mark2}
78
+
# Collapse labels for preview and short duration rows
The `check_*()` functions output messages about the number of rows that meet the exclusion criteria. Because checks return only the rows meeting the criteria, they should not be connected via pipes unless you want to subset the second check criterion within the rows that meet the first criterion.
67
89
68
90
```{r check1}
69
-
library(excluder)
70
91
# Check for preview rows
71
92
qualtrics_text %>%
72
93
check_preview()
@@ -103,26 +124,6 @@ df <- qualtrics_text %>%
103
124
exclude_location()
104
125
```
105
126
106
-
### Marking
107
-
The `mark_*()` functions output the original data set with a new column specifying rows that meet the exclusion criteria. These can be piped together with `%>%` for multiple exclusion types.
108
-
109
-
```{r mark1}
110
-
# Mark preview and short duration rows
111
-
df <- qualtrics_text %>%
112
-
mark_preview() %>%
113
-
mark_duration(min_duration = 200)
114
-
tibble::glimpse(df)
115
-
```
116
-
Use the [`unite_exclusions()`](https://jeffreyrstevens.github.io/excluder/reference/unite_exclusions.html) function to unite all of the marked columns into a single column.
117
-
```{r mark2}
118
-
# Collapse labels for preview and short duration rows
0 commit comments