Skip to content

Commit

Permalink
Fix cran comments:
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroloprete committed Jul 14, 2024
1 parent 8e587a7 commit 8d12ef8
Show file tree
Hide file tree
Showing 11 changed files with 636 additions and 436 deletions.
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ clasificacion_ui
test_recipes.R
test.R
recetas_ech.R
example-data
example-data
^CRAN-SUBMISSION$
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 0.0.1
Date: 2024-06-01 18:58:12 UTC
SHA: 8e587a71ee11dbf225ccbef7a53a07020be2e7bc
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: metasurvey
Title: Survey Processing with Metaprogramming
Version: 0.0.1
Title: Survey Processing with Meta-Programming
Version: 0.0.1.9000
Authors@R:
c(
person(
Expand Down Expand Up @@ -33,8 +33,8 @@ Authors@R:
)
)
)
Description: Provides a set of functions to process survey data using metaprogramming. It is designed to work with the survey package, but it can be used with any other package that provides a similar data structure. The main goal of this package is to provide a set of functions that can be used to process survey data in a more efficient way, by using metaprogramming to generate code that can be used to process the data.
License: MIT + file LICENSE
Description: Provides a set of functions to process survey data using meta-programming. It is designed to work with the 'survey' package, but it can be used with any other package that provides a similar data structure. The main goal of this package is to provide a set of functions that can be used to process survey data in a more efficient way, by using meta-programming to generate code that can be used to process the data.
License: GPL (>= 3)
Imports:
data.table (>= 1.14.2),
crayon (>= 1.3.4),
Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

990 changes: 595 additions & 395 deletions LICENSE.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# metasurvey (development version)

# metasurvey 0.0.2

# metaSurvey 0.0.1
Expand Down
2 changes: 1 addition & 1 deletion R/set_engine.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ set_engine <- function(.engine = show_engines()) {

identity_transformer(
text = metacode,
envir = .GlobalEnv
envir = parent.frame()
)
}

Expand Down
31 changes: 20 additions & 11 deletions R/steps.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ compute <- function(svy, ..., .by = NULL, use_copy = use_copy_default()) {

#' @importFrom data.table copy

recode <- function(svy, new_var, ..., .default = NA_character_, ordered = FALSE, use_copy = use_copy_default()) {
recode <- function(svy, new_var, ..., .default = NA_character_, ordered = FALSE, use_copy = use_copy_default(),.to_factor = FALSE) {
if (!use_copy) {
.data <- svy$get_data()
} else {
Expand All @@ -60,14 +60,21 @@ recode <- function(svy, new_var, ..., .default = NA_character_, ordered = FALSE,



.data[
,
(new_var) := factor(
.default,
levels = .labels,
ordered = ordered
)
]
if (.to_factor) {
.data[
,
(new_var) := factor(
.default,
levels = .labels,
ordered = ordered
)
]
} else {
.data[
,
(new_var) := .default
]
}

lapply(
FUN = function(.expr) {
Expand Down Expand Up @@ -234,11 +241,12 @@ step_compute <- function(svy = NULL, ..., .by = NULL, use_copy = use_copy_defaul
#' @param ordered Ordered
#' @param use_copy Use copy
#' @param comment Comment
#' @param .to_factor To factor
#' @return Survey object
#' @keywords Steps
#' @export

step_recode <- function(svy = survey_empty(), new_var, ..., .default = NA_character_, .name_step = NULL, ordered = FALSE, use_copy = use_copy_default(), comment = "Recode step") {
step_recode <- function(svy = survey_empty(), new_var, ..., .default = NA_character_, .name_step = NULL, ordered = FALSE, use_copy = use_copy_default(), comment = "Recode step",.to_factor = FALSE) {
.call <- match.call()

new_var <- as.character(substitute(new_var))
Expand Down Expand Up @@ -276,7 +284,8 @@ step_recode <- function(svy = survey_empty(), new_var, ..., .default = NA_charac
new_var = new_var,
...,
.default = .default,
use_copy = use_copy
use_copy = use_copy,
.to_factor = .to_factor
)

step <- Step$new(
Expand Down
3 changes: 3 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
0 errors | 0 warnings | 1 note

* This is a new release.

## Resubmission
This is a resubmission. In this version I have:
4 changes: 2 additions & 2 deletions man/metasurvey-package.Rd

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

5 changes: 4 additions & 1 deletion man/step_recode.Rd

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

0 comments on commit 8d12ef8

Please sign in to comment.