Horje
convert all numeric columns to percentages R Code Example
convert all numeric columns to percentages R
myfun <- function(x) {
  if(is.numeric(x)){ 
    ifelse(is.na(x), x, paste0(round(x*100L, 1), "%")) 
  } else x 
}

df1 %>% mutate_each(funs(myfun))
#   name somevariable othervariable
# 1   A1        13.4%         53.4%
# 2   A1        54.8%          <NA>
# 3   B1        36.9%         36.9%
# 4   B1         <NA>         33.3%




R

Related
how to get the number of individual numbers in a vector in r Code Example how to get the number of individual numbers in a vector in r Code Example
how to bootstrap in r with resampling Code Example how to bootstrap in r with resampling Code Example
square root calculation r Code Example square root calculation r Code Example
extract r squared from lm in r Code Example extract r squared from lm in r Code Example
ggplot2 graph in r Code Example ggplot2 graph in r Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7