Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

r dataframe set column names code example

Example 1: r set dataframe column names

R> X <- data.frame(bad=1:3, worse=rnorm(3))
R> X
  bad     worse
1   1 -2.440467
2   2  1.320113
3   3 -0.306639
R> colnames(X) <- c("good", "better")
R> X
  good    better
1    1 -2.440467
2    2  1.320113
3    3 -0.306639

Example 2: r dataframe change column name

names(df)[1] <- paste("newName")

Tags:

C Example

Related

how to access string elements using index number in Javascript code example string.toupper in java code example how to output c++ code example laravel uri segment code example css any sibling code example random on c++ code example how to get python on ubuntu code example how to hide api key in javascript code example how to push a local repository to github code example flutter icons with assets code example how to create a directory in ubuntu terminal code example vs code donaload code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy