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, 2019 in Data Analytics by Tyrion anex
• 8,700 points
1,608 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, 2019 by Sophie may
• 10,620 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 Sahiti
• 6,370 points
1,510 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, 2019 in Data Analytics by anonymous
• 33,030 points
15,123 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,700 points
1,818 views
+10 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 9, 2018 in Data Analytics by Abhi
• 3,720 points
1,627 views
+1 vote
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,840 points
4,832 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,840 points
811 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
• 10,620 points
693 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, 2019 in Data Analytics by anonymous
1,953 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP