Search
 
SCRIPT & CODE EXAMPLE
 

R

dplyr colnames r

group_by(mtcars, cyl) %>%
  summarise(mean(disp), mean(hp)) %>%
  `colnames<-`(c("cyl", "disp_mean", "hp_mean"))
  # or
  # `names<-`(c("cyl", "disp_mean", "hp_mean"))
  # setNames(., c("cyl", "disp_mean", "hp_mean")) 

#   cyl disp_mean   hp_mean
# 1   4  105.1364  82.63636
# 2   6  183.3143 122.28571
# 3   8  353.1000 209.21429
Comment

PREVIOUS NEXT
Code Example
R :: R p value star 
R :: find data types in list r 
R :: how to read number of excel sheet in r 
R :: how to select all the records above a specific datetime in r 
R :: defulat function values R 
R :: str_detect multiple patterns 
R :: rstudio could not find function ggplot 
R :: how to import csv file in r 
R :: r change row names of a dataframe 
R :: how to split a column in r 
R :: reverse string in r 
R :: principal component analysis in r 
R :: r library tidyverse 
R :: operators R 
R :: filter na in r 
R :: how to make matrix in r 
R :: r remove insignificant coefficient in output 
R :: R vector all but last 
R :: r mode 
R :: empty environment r 
R :: extract hyperlinks in r 
R :: r predict type 
R :: dplyr to vector 
R :: R new column t test p-value 
R :: change font color in geom_text in ggplot2 in R 
Rust :: rust get current directory 
Rust :: rust absolute value 
Rust :: rust string from bytes 
Rust :: sum all elements of array rust 
Rust :: check if a string contains consecutive letters that occur only once 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =