Questions tagged [readr]

readr is an R package that provides a fast and friendly way to read tabular data.

An R package written by Hadley Wickham. The goal of readr is to provide a fast and friendly way to read tabular data into R.

527 questions
0
votes
0 answers

Download CSV-file from API

I'm trying to get a csv-file into R. I have made the following code which creates the link to the csv-file. The code works perfectly when I use the generated link in my browser. But doesn't work properly when I run the code. Hope somebody can…
0
votes
2 answers

Use CSV-Import in RStudio fails installing dependencies

I just updated to RStudio 1.0.136 and tried to import a csv. Therefore it wants me to install a package called readr. If I try this, it fails installing its dependency on tibble with error message: RcppExports.cpp:4:10: fatal error: 'Rcpp.h' file…
nik
  • 2,114
  • 3
  • 22
  • 43
0
votes
0 answers

readr spec() not updating after variable names and types are changed

I'm doing some data wrangling on proprietary data and having a problem with spec() not updating after I make changes to variable names or types. I'll use mtcars as an example of what I'm experiencing. Can anyone let me know why this is happening and…
Ash Levitt
  • 153
  • 3
  • 11
0
votes
1 answer

read_delim seems unable to parse files with quotation mark?

I have the following tab-delimited file that read_delim seems to fail because of the quotation mark. 8436127 "Baki-Pilsen" Brewery "Baki-Pilsen" Brewery 40.32864 49.78044 P PPLL AZ 0 -25 Asia/Baku …
Heisenberg
  • 8,386
  • 12
  • 53
  • 102
0
votes
0 answers

read_lines_chunked from readr package gives strange output

I want to use the readr package to read in big fasta files and count the entries. The file has multiple rows and each entry starts with a >. In general I am not interested in the other data, I just want to count the lines starting with >. I thought…
drmariod
  • 11,106
  • 16
  • 64
  • 110
0
votes
1 answer

Importing large numbers when binding csv files

Having trouble with my code while trying to import my data with a column that exceeds the maximum integer (.Machine$integer.max = 2147483647). Using readr's read_csv I believe it's importing as NA instead of rounding off. The complication comes from…
ant
  • 565
  • 1
  • 6
  • 12
0
votes
1 answer

Couldnt receive the required output

I was working with the assignment to read the fixed width file format in the R Programming,this is my dataset http://www.cpc.ncep.noaa.gov/data/indices/wksst8110.for and I used the readr package to read the file and clean the data with the below…
shivanesh
  • 109
  • 1
  • 1
  • 5
0
votes
1 answer

How can I read dates without year using readr?

I have a data file in which dates are given without year. 01/05 Fellowship enters Moria 01/09 Fellowship reaches Lorien 01/17 Passing of Gandalf 02/07 Fellowship leaves Lorien 02/17 Death of Boromir I try to read it like this lotr <-…
0
votes
0 answers

readr and negative numbers in parentheses

Is there a way to get readr to parse numbers in parenthesis as negative numbers? For example, in the code below I would like column B to be parsed as numbers and for the first item to be -2.3. library(readr) data <- "A,B,C 1, (2.3), 4 2, 4.6,…
banbh
  • 1,331
  • 1
  • 13
  • 31
0
votes
0 answers

Handling special characters when imoprting csv to r

I can't import csv (semicolon delimited) to R. The problem is that some columns contain text with special character (like semicolon) which result in unequal number of columns in some rows. Special characters are surrounded by quotas, like ";". The…
0
votes
0 answers

Skip variables while reading in a fixed width text file in R using readr package

I'm reading in some text files in R using the readr package because of the files fixed width but on some of the files I get the error that cannot allocate vector of size.... I'm assuming some files are too big but I actually don't really need all…
User23
  • 153
  • 2
  • 13
0
votes
1 answer

R readr::read_fwf ignore characters using fwf_widths

I would like to know if there is an easy way to skip characters using the read_fwf from the readr package in R. For example, modifying one of the examples in the documentation library(readr) fwf_sample <- system.file("extdata/fwf-sample.txt",…
lucacerone
  • 9,859
  • 13
  • 52
  • 80
0
votes
1 answer

How can I get readr to handle quoted NA values?

library(readr) csv <- 'x,y "1","N/A" "N/A","2" ' df <- read_csv(csv, col_types = "ii", na=c("\"N/A\"", "N/A")) Running this yields: > df <- read_csv(csv, col_types = "ii", na=c("\"N/A\"", "N/A")) Warning: 2 parsing failures. row col expected…
Ian Gow
  • 3,098
  • 1
  • 25
  • 31
0
votes
1 answer

using readr to import big data file with different row lengths and whitespace as delimiter

I have an issue to Read a big file (close to 2000000 rows) using the readr package. Why do I want to use the readr package. My data file can containing ASCII control characters (0x01 equal to ascii 26 equal to CTRL+Z) that stops the execution of…
0
votes
1 answer

R data cleaning fail: .dat to clean data frame to clean CSV file

Importing .dat file into R console. Hoping to get a clean table so I can convert it back to CSV and manipulate it with other CSV files in Excel. Below is the entire R console session. The table looks aligned in the console but certainly doesn't…
Elan
  • 539
  • 1
  • 6
  • 18