Skip to content

Commit

Permalink
improve package index, remove mention of dplyr::data_frame, improve r…
Browse files Browse the repository at this point in the history
…eference index, link vignette from docs (#169)

* improve package index, remove mention of dplyr::data_frame, improve reference index, link vignette from docs

* fix lint + link
  • Loading branch information
olivroy authored Jan 7, 2025
1 parent 236bb0b commit bd77cfd
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions R/lookfor.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#' @param x a tibble returned by `look_for()`
#' @return a tibble data frame featuring the variable position, name and
#' description (if it exists) in the original data frame
#' @seealso `vignette("look_for")`
#' @details The function looks into the variable names for matches to the
#' keywords. If available, variable labels are included in the search scope.
#' Variable labels of data.frame imported with \pkg{foreign} or
Expand Down
6 changes: 3 additions & 3 deletions R/recode.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#'
#' @importFrom dplyr recode
#' @inheritParams dplyr::recode
#' @param .keep_value_labels If TRUE, keep original value labels.
#' If FALSE, remove value labels.
#' @param .combine_value_labels If TRUE, will combine original value labels
#' @param .keep_value_labels If `TRUE`, keep original value labels.
#' If `FALSE`, remove value labels.
#' @param .combine_value_labels If `TRUE`, will combine original value labels
#' to generate new value labels. Note that unexpected results could be
#' obtained if a same old value is recoded into several different new values.
#' @param .sep Separator to be used when combining value labels.
Expand Down
4 changes: 2 additions & 2 deletions R/to_labelled.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ memisc_to_labelled <- function(x) {
#' codes
#' @details
#' If you convert a labelled vector into a factor with prefix, i.e. by using
#' [to_factor(levels = "prefixed")][to_factor()], `to_labelled.factor()` is able
#' to reconvert it to a labelled vector with same values and labels.
#' [`to_factor(levels = "prefixed")`][to_factor()], `to_labelled.factor()` is
#' able to reconvert it to a labelled vector with same values and labels.
#' @export
#' @examples
#' # Converting factors to labelled vectors
Expand Down
8 changes: 4 additions & 4 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ reference:
- title: Manipulating value labels
desc: Functions to set, manipulate and remove value labels
contents:
- labelled
- haven::labelled
- val_label
- remove_var_label
- sort_val_labels
Expand All @@ -34,19 +34,19 @@ reference:
- copy_labels
- update_variable_labels_with
- title: Data dictionary
desc: Functions to look for keywords variable names / labels and create a data dictionary
desc: Functions to look for keywords variable names / labels and create a data dictionary.
contents:
- look_for
- title: Manipulating SPSS style missing values
desc: Functions to set, manipulate and remove SPSS style missing values
contents:
- labelled_spss
- haven::labelled_spss
- na_values
- copy_labels
- remove_user_na
- title: Tagged missing values
contents:
- tagged_na
- haven::tagged_na
- unique_tagged_na
- tagged_na_to_user_na
- title: Converting
Expand Down
3 changes: 3 additions & 0 deletions man/look_for.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/recode.haven_labelled.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/to_labelled.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/labelled.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ If you are using the `%>%` operator, you can use the functions `set_variable_lab
```{r}
library(dplyr)
df <- data_frame(s1 = c("M", "M", "F"), s2 = c(1, 1, 2)) %>%
df <- tibble(s1 = c("M", "M", "F"), s2 = c(1, 1, 2)) %>%
set_variable_labels(s1 = "Sex", s2 = "Question") %>%
set_value_labels(s1 = c(Male = "M", Female = "F"), s2 = c(Yes = 1, No = 2))
df$s2
Expand Down

0 comments on commit bd77cfd

Please sign in to comment.