I have a csv that is a few data frames appended to each other. However each data frame has different amount of columns. I would like to be able to either a) import the whole csv as a data frame in R or b) filter the CSV for specific rows before pulling it into R.
Type Field1 Values
Fruits Name Size
Fruits Orange Large
Fruits Grape Small
Shoes Brand Colour Price Gender
Shoes Nike Blue $100 Male
Shoes Adidas Black $80 Female
In the data frame above there are 2 data frames appended. One that is related to fruits and one that is related to shoes. I would like to pull all the data as a csv in R. Also assume I dont know the amount of columns there are in the csv
In R I would like the data frame to look like this
V1 V2 V3 V4 V5
Type Field1 Values
Fruits Name Size
Fruits Orange Large
Fruits Grape Small
Shoes Brand Colour Price Gender
Shoes Nike Blue $100 Male
Shoes Adidas Black $80 Female
Below is picture of real data. It is a csv file
I downloaded the file as "csv" and when i look at the properties of the data it is a CSV.
Edit* This code chuck actually does the job however, the number of columns needs to be known
read.table("pathtocsv.csv", header = FALSE, sep = ",",
col.names = paste0("V",seq_len(5)), fill = TRUE)