R programming: Reading a table in R

0 votes

I'm trying to read a table in R:

dat <- read.table("~/data/data.txt",quote="\"",c("com","Type","col1","col2"),header=TRUE). 

I get the following error:

Error in scan(file, what = "", sep = sep, quote = quote, nlines = 1, quiet = TRUE,  : invalid 'sep' value: must be one byte)
May 13 in Data Analytics by Tyrion anex
• 8,280 points
45 views

1 answer to this question.

0 votes

Try this code:

dat <- read.table("~/data/data.txt", quote="\"", 
                  col.names=c("com", "Type", "col1", "col2"), header=TRUE). 

Hope it helps.

answered May 13 by Sophie may
• 9,870 points

Related Questions In Data Analytics

0 votes
1 answer

How to convert a sentence to word table in R?

Try the following code: sentence <- c("case sweden", ...READ MORE

answered Jun 21, 2018 in Data Analytics by darklord
• 6,170 points
30 views
0 votes
2 answers

What are the rules to define a variable name in R programming language?

The same rules almost follow for all ...READ MORE

answered Aug 26 in Data Analytics by anonymous
• 31,840 points
110 views
0 votes
1 answer

Check if a matrix is diagonalizable in R Programming Language

On a given matrix, a, the first way ...READ MORE

answered Dec 24, 2018 in Data Analytics by Tyrion anex
• 8,280 points
45 views
0 votes
1 answer

Error saying "vector size cannot be NA" when using R with data mining

You can use the removesparseterm function.  Removes sparse ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,040 points
533 views
+1 vote
2 answers
0 votes
1 answer

Trying to find frequent itemsets of a data set using arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", "milk", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,040 points
45 views
0 votes
1 answer

Error saying "Error in df$item : object of type 'closure' is not subsettable" when trying to use arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,040 points
182 views
0 votes
1 answer

Can we have an if loop inside a for loop in R programming?

You're If loop doesn't have any condition ...READ MORE

answered Dec 21, 2018 in Data Analytics by Sophie may
• 9,870 points
51 views
0 votes
3 answers

Can a C program be written in R programming language?

If you have a algorithm you can ...READ MORE

answered Apr 9 in Data Analytics by anonymous
69 views