0

When I use the follow command to write the dataframe:

write.table(dfArticles,"C:/Biology.txt",append = FALSE,sep=",",dec=".")

I get the following result:

"Title","Authors","AuthorAffiliations","CorrespondenceAuthor","PublishDate","Abstract","Keywords"
"1","Characterisation of genetic regulatory effects for osteoporosis risk variants in human osteoclasts","Benjamin H. Mullin,Jennifer Tickner,Kun Zhu,Jacob Kenny,S ..................

The file "Biology.txt" has included the values "1" "2" "3" ... at the beginning of each line.

Why are the numbers included?

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
Fernando
  • 55
  • 7

1 Answers1

1

We can use the row.names = FALSE argument.

write.table(dfArticles,"C:/Biology.txt",append = FALSE,sep=",",dec=".",row.names=FALSE) 
Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
  • wonderful !!!! How can I retrieve the dataframe, I am trying it .. my_data<-read.table("C:/Biology.txt", header = TRUE, sep = ",", dec = ".",row.names = FALSE) – Fernando Mar 31 '20 at 01:57
  • I might try `my_data<-read.table("C:/Biology.txt", header = TRUE, sep = ",", dec = ".",stringsAsFactors = FALSE)`. – Ian Campbell Mar 31 '20 at 02:02