Please advice on the best way to read this type of data into a data frame in R.
Using read.table("Software.txt")
only gives the error:
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
line 1 did not have 6 elements.
Furthermore, this data (Amazon dataset) is not in the traditional rows and columns format, so would appreciate any help on that as well.
2
Answers
Here a solution based on
readLines
.You can, of course, streamline this a little. I just wanted to show you the individual steps.
Result
Your data appears to be in the same "Debian control file" (DCF) format that’s used to store package metadata. The correct import function for such data is
Check out the
?read.dcf
help page for more info.