search for: mutate_at

Displaying 12 results from an estimated 12 matches for "mutate_at".

2024 Oct 17
2
DPLYR Multiple Mutate Statements On Same DataFrame
...00, ???????????????????????????????????????????????? ifelse(.x==7, 7500, ???????????????????????????????????????????????? ifelse(.x==8,15000, ???????????????????????????????????????????????? ifelse(.x==9,30000, ???????????????????????????????????????????????? -99)))))))))))) df2<-df1 %>% mutate_at(vars(MRELGE:MSKC),~ifelse(.x==0, 0, ifelse(.x==1, 5, ??????????????????????????????????????????????????????-99))) df3<-df2 %>% mutate_at(vars(MGODRK),~ifelse(.x==0, 0, ifelse(.x==1, 5, ???????????????????????????????????????????????????...
2024 Oct 18
1
DPLYR Multiple Mutate Statements On Same DataFrame
...?????????????????????? ifelse(.x==7, 7500, > ???????????????????????????????????????????????? ifelse(.x==8,15000, > ???????????????????????????????????????????????? ifelse(.x==9,30000, > ???????????????????????????????????????????????? -99)))))))))))) > > df2<-df1 %>% > mutate_at(vars(MRELGE:MSKC),~ifelse(.x==0, 0, > ifelse(.x==1, 5, > ??????????????????????????????????????????????????????-99))) > df3<-df2 %>% > mutate_at(vars(MGODRK),~ifelse(.x==0, 0, > ifelse(.x==1, 5, > ???????????????????...
2017 Dec 14
2
help with recursive function
...1(dataset) recursive_funlp <- function(dataset = dat1, func = funlp2) { dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% mutate(field_rep = paste(field_rep, "lp", sep = ".")) %>% spread(key = field_rep, value = lp) %>% mutate_at(.vars = grep("_", names(.)), funs(norm = round(scale(.), 3))) dat2$norm_sd <- round(apply(dat2[, grep("lp_norm", names(dat2))], 1, sd, na.rm = TRUE), 3) dat2$norm_max <- round(apply(dat2[, grep("lp_norm", names(dat2))],...
2017 Dec 14
0
help with recursive function
...<- function(dataset = dat1, func = funlp2) { > > dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% > > mutate(field_rep = paste(field_rep, "lp", sep = ".")) %>% > > spread(key = field_rep, value = lp) %>% mutate_at(.vars = > grep("_", > > names(.)), funs(norm = round(scale(.), 3))) > > dat2$norm_sd <- round(apply(dat2[, grep("lp_norm", names(dat2))], > > 1, sd, na.rm = TRUE), 3) > > dat2$norm_max <- round(apply(dat2[,...
2017 Dec 14
3
help with recursive function
...= dat1, func = funlp2) { >> >> dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% >> >> mutate(field_rep = paste(field_rep, "lp", sep = ".")) %>% >> >> spread(key = field_rep, value = lp) %>% mutate_at(.vars = >> grep("_", >> >> names(.)), funs(norm = round(scale(.), 3))) >> >> dat2$norm_sd <- round(apply(dat2[, grep("lp_norm", names(dat2))], >> >> 1, sd, na.rm = TRUE), 3) >> >> da...
2017 Dec 14
0
help with recursive function
...1(dataset) recursive_funlp <- function(dataset = dat1, func = funlp2) { dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% mutate(field_rep = paste(field_rep, "lp", sep = ".")) %>% spread(key = field_rep, value = lp) %>% mutate_at(.vars = grep("_", names(.)), funs(norm = round(scale(.), 3))) dat2$norm_sd <- round(apply(dat2[, grep("lp_norm", names(dat2))], 1, sd, na.rm = TRUE), 3) dat2$norm_max <- round(apply(dat2[, grep("lp_norm", names(dat2))],...
2019 May 17
5
Give update.formula() an option not to simplify or reorder the result -- request for comments
Dear All, Martin Maechler has asked me to send this to R-devel for discussion after I submitted it as an enhancement request ( https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17563). At this time, the update.formula() method always performs a number of transformations on the results, eliminating redundant variables and reordering interactions to be after the main effects. This is not always
2017 Dec 14
0
help with recursive function
...1(dataset) recursive_funlp <- function(dataset = dat1, func = funlp2) { dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% mutate(field_rep = paste(field_rep, "lp", sep = ".")) %>% spread(key = field_rep, value = lp) %>% mutate_at(.vars = grep("_", names(.)), funs(norm = round(scale(.), 3))) dat2$norm_sd <- round(apply(dat2[, grep("lp_norm", names(dat2))], 1, sd, na.rm = TRUE), 3) dat2$norm_max <- round(apply(dat2[, grep("lp_norm", names(dat2))],...
2017 Dec 14
1
help with recursive function
...recursive_funlp <- function(dataset = dat1, func = funlp2) { > dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% > mutate(field_rep = paste(field_rep, "lp", sep = ".")) %>% > spread(key = field_rep, value = lp) %>% mutate_at(.vars = > grep("_", > names(.)), funs(norm = round(scale(.), 3))) > dat2$norm_sd <- round(apply(dat2[, grep("lp_norm", names(dat2))], > 1, sd, na.rm = TRUE), 3) > dat2$norm_max <- round(apply(dat2[, grep("lp_norm&...
2017 Dec 14
2
help with recursive function
...= dat1, func = funlp2) { >> >> dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% >> >> mutate(field_rep = paste(field_rep, "lp", sep = ".")) %>% >> >> spread(key = field_rep, value = lp) %>% mutate_at(.vars = >> grep("_", >> >> names(.)), funs(norm = round(scale(.), 3))) >> >> dat2$norm_sd <- round(apply(dat2[, grep("lp_norm", names(dat2))], >> >> 1, sd, na.rm = TRUE), 3) >> >> da...
2017 Dec 14
2
help with recursive function
...taset) recursive_funlp <- function(dataset = dat1, func = funlp2) { dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% mutate(field_rep = paste(field_rep, "lp", sep = ".")) %>% spread(key = field_rep, value = lp) %>% mutate_at(.vars = grep("_", names(.)), funs(norm = round(scale(.), 3))) dat2$norm_sd <- round(apply(dat2[, grep("lp_norm", names(dat2))], 1, sd, na.rm = TRUE), 3) dat2$norm_max <- round(apply(dat2[, grep("lp_norm", names(dat2))],...
2017 Dec 14
0
help with recursive function
...<- function(dataset = dat1, func = funlp2) { > > dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% > > mutate(field_rep = paste(field_rep, "lp", sep = ".")) %>% > > spread(key = field_rep, value = lp) %>% mutate_at(.vars = > grep("_", > > names(.)), funs(norm = round(scale(.), 3))) > > dat2$norm_sd <- round(apply(dat2[, grep("lp_norm", names(dat2))], > > 1, sd, na.rm = TRUE), 3) > > dat2$norm_max <- round(apply(dat2[,...