دنبال کننده ها

۱۳۹۶ مرداد ۹, دوشنبه

Removing new lines in R

[ad_1]

I am trying to bring multiple rows into one cell in my CSV file. I first began with converting my text file into a CSV file, however the final column needs to have all the contents in one cell, and it's currently being split into multiple. The CSV File currently looks like the first picture, and needs to look like the second picture. Picture_1Picture_2



I have the following code:



 mydata = read.table ("rolled_swiftmessage_test.txt", sep="|", allowEscapes 
= TRUE, fill = FALSE)

write.table(mydata, file="rolled_swiftmessage_test.csv",sep=",",col.names=
FALSE,row.names= FALSE)


Currently it produces Picture_1, and I need it to produce picture_2. How do I fix it? Thanks!



[ad_2]

لینک منبع