sparse-columns

How can you read a CSV file in R with different number of columns

不打扰是莪最后的温柔 提交于 2019-11-26 17:26:26
I have a sparse data set, one whose number of columns vary in length, in a csv format. Here is a sample of the file text. 12223, University 12227, bridge, Sky 12828, Sunset 13801, Ground 14853, Tranceamerica 14854, San Francisco 15595, shibuya, Shrine 16126, fog, San Francisco 16520, California, ocean, summer, golden gate, beach, San Francisco When I use read.csv("data.txt", header = F) R will interpret the data set as having 3 columns because the size is determined from the first 5 rows. Is there anyway to force r to put the data in more columns? Blue Magister Deep in the ?read.table

How can you read a CSV file in R with different number of columns

房东的猫 提交于 2019-11-26 05:26:05
问题 I have a sparse data set, one whose number of columns vary in length, in a csv format. Here is a sample of the file text. 12223, University 12227, bridge, Sky 12828, Sunset 13801, Ground 14853, Tranceamerica 14854, San Francisco 15595, shibuya, Shrine 16126, fog, San Francisco 16520, California, ocean, summer, golden gate, beach, San Francisco When I use read.csv(\"data.txt\", header = F) R will interpret the data set as having 3 columns because the size is determined from the first 5 rows.