How to prevent row names to be written to a file while using

0 votes
df<-data.frame(red=c(2,4,6,8,9),blue=c(1,3,5,7,10))


This is how my dataFrame looks like:

 df
  red blue
1   2    1
2   4    3
3   6    5
4   8    7
5   9   10

Now how I prevent the column names to be written in csv?
 

Apr 20, 2018 in Data Analytics by DataKing99
• 8,250 points
727 views

1 answer to this question.

0 votes

Easily by:

write.csv(df, "temp.csv", row.names=FALSE)
answered Apr 20, 2018 by DeepCoder786
• 1,720 points

Related Questions In Data Analytics

0 votes
1 answer

Error saying "ERROR: Expected tag to be of type header" while creating a dashboard using shiny R

sliderInput("bins","number of breaks",1,100,50), this line should come under ...READ MORE

answered Nov 30, 2018 in Data Analytics by Maverick
• 10,840 points
4,607 views
0 votes
1 answer

How to rename a file using R?

I just found there are 2 functions file.rename() ...READ MORE

answered Oct 29, 2019 in Data Analytics by Cherukuri
• 33,030 points
10,497 views
0 votes
1 answer

How to join a list of data frames using map()

You can use reduce set.seed(24) r1 <- map(c(5, 10, ...READ MORE

answered Apr 11, 2018 in Data Analytics by kappa3010
• 2,090 points
1,607 views
+1 vote
1 answer

How to convert a list of dataframes in to a single dataframe using R?

You can use the plyr function: data <- ...READ MORE

answered Apr 14, 2018 in Data Analytics by Sahiti
• 6,370 points
7,097 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,961 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,391 views
0 votes
1 answer

How to spilt a column of a data frame into multiple columns

it is easily achievable by using "stringr" ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,812 views
+1 vote
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
1,837 views
+1 vote
3 answers

How to change column names of a Data frame?

Hi, To change the name of a column ...READ MORE

answered Oct 30, 2020 in Data Analytics by MD
• 95,460 points
1,747 views
0 votes
3 answers

How to write lines to a text file in R?

sink("outfile.txt") cat("hello") cat("\n" ...READ MORE

answered May 24, 2019 in Data Analytics by anonymous
19,076 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP