Normalizing selection of dataframe columns with dplyr

后端 未结 2 1593
说谎
说谎 2021-01-21 22:31

I have a data.frame with variables var1 var2 (both strings) and variables x, y, and z. I would like

2条回答
  •  感情败类
    2021-01-21 23:09

    It could be a problem with the attributes or grouping variable. We can reset the dataset without external attributes by converting to data.frame and then do the mutate_at

    df_ %>% 
       as.data.frame %>%
       mutate_at(vars(x, y, z), funs(norm = ./.[1]))
    

提交回复
热议问题