Skip to content

Commit

Permalink
set_read: check additional_vars for column names that will get overwr…
Browse files Browse the repository at this point in the history
…itten
  • Loading branch information
randomchars42 committed Nov 13, 2018
1 parent 690ec81 commit 739767c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion R/set.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ set_read <- function(
is.character(additional_sep)
)

# check additional_vars for column names that will get overwritten
for (i in 1 : length(additional_vars)) {
if (additional_vars[[i]] %in% c("name", "real", "recovery", "conc", "value")) {
warning("\"", paste0(additional_vars[[i]], "\" may not be used as column name"))
}
}

dec <- get_dec(dec = dec, sep = sep)

# make the pipe operator available to us
Expand Down Expand Up @@ -369,7 +376,7 @@ set_calc_concentrations <- function(
is.function(interpolate_func)
)

# enquose the give column names
# enquose the given column names
# for columns that appear to the left of := (i.e. are mutated) a string is
# stored in col_*_name

Expand Down

0 comments on commit 739767c

Please sign in to comment.