github292929
github292929

Reputation: 185

I can't seem to access the data in my file?

library(tidyverse)
y <- read_tsv("assignment_data.tsv")
x <- 1

When I check R console I get the following:

> y <- read_tsv("assignment_data.tsv", header=TRUE)
Error in read_tsv("assignment_data.tsv", header = TRUE) : 
  unused argument (header = TRUE)
> 
> x <- 1
> 

However, I can only access x in the global environment and I can't visualize the data in the file I tried to import.

Upvotes: 0

Views: 54

Answers (1)

Sweepy Dodo
Sweepy Dodo

Reputation: 1863

Regarding your error:

Error in read_tsv("assignment_data.tsv", header = TRUE) : 
  unused argument (header = TRUE)

If you use

?read_tsv

you will find header is not one of the arguments. Instead, you are looking for col_names

Edit: We found out the problem laid within the tsv itself. The number of column names did not match the number of columns (implied by data)

Upvotes: 1

Related Questions