How to remove ID from write.table CSV file

When I execute this statement:

write.table(bigdata, 'news.csv', sep = ',')

It is displayed as follows:

"type","text"
"1","neutral","The week in 32 photos"
"2","neutral","Look at me! 22 selfies of the week"
"3","neutral","Inside rebel tunnels in Homs"
"4","neutral","Voices from Ukraine"
"5","neutral","Water dries up ahead of World Cup"
"6","positive","Who your hero? Nominate them"

However, I do not need this identifier column, numbers that look like 1,2,3,4 ... I just want:

"type","text"
"neutral","The week in 32 photos"
"neutral","Look at me! 22 selfies of the week"
"neutral","Inside rebel tunnels in Homs"
"neutral","Voices from Ukraine"
"neutral","Water dries up ahead of World Cup"
"positive","Who your hero? Nominate them"

Here is my dataframe:

> head(bigdata)
      type                               text
1  neutral              The week in 32 photos
2  neutral Look at me! 22 selfies of the week
3  neutral       Inside rebel tunnels in Homs
4  neutral                Voices from Ukraine
5  neutral  Water dries up ahead of World Cup
6 positive     Who your hero? Nominate them

How to remove id from output?

+4
source share
1 answer

Pointing row.names = FALSEto a function write.table()will remove this id column.

+7
source

Source: https://habr.com/ru/post/1544505/


All Articles