Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread jim holtman
Try reading the lines in (readLines), count the number of both types of quotes in each line. Find out which are not even and investigate. On Mon, Apr 8, 2024, 15:24 Dave Dixon wrote: > I solved the mystery, but not the problem. The problem is that there's > an unclosed quote somewhere in those 5

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread Eberhard W Lisse
I find QSV very helpful. el On 08/04/2024 22:21, Dave Dixon wrote: > I solved the mystery, but not the problem. The problem is that > there's an unclosed quote somewhere in those 5 additional records I'm > trying to access. So read.csv is reading million-character fields. > It's slow at that. Tha

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread Dave Dixon
Right, I meant to add header=FALSE. And, it looks now like the next line is the one with the unclosed quote, so read.csv is trying to read million-character headers! On 4/8/24 12:42, Ivan Krylov wrote: В Sun, 7 Apr 2024 23:47:52 -0600 Dave Dixon пишет: > second_records <- read.csv(file_na

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread Dave Dixon
Good suggestion - I'll look into data.table. On 4/8/24 12:14, CALUM POLWART wrote: > data.table's fread is also fast. Not sure about error handling. But I > can merge 300 csvs with a total of 0.5m lines and 50 columns in a > couple of minutes versus a lifetime with read.csv or readr::read_csv >

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread Dave Dixon
Thanks, yeah, I think scan is more promising. I'll check it out. On 4/8/24 11:49, Bert Gunter wrote: > No idea, but have you tried using ?scan to read those next 5 rows? It > might give you a better idea of the pathologies that are causing > problems. For example, an unmatched quote might result

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread Dave Dixon
I solved the mystery, but not the problem. The problem is that there's an unclosed quote somewhere in those 5 additional records I'm trying to access. So read.csv is reading million-character fields. It's slow at that. That mystery solved. However, the the problem persists: how to fix what is o

Re: [R] Building R-4,3,3 fails

2024-04-08 Thread Rich Shepard
On Mon, 8 Apr 2024, Ivan Krylov wrote: A Web search suggests that texi2dvi may output this message by mistake when the TeX installation is subject to a different problem: https://web.archive.org/web/20191006123002/https://lists.gnu.org/r/bug-texinfo/2016-10/msg00036.html Ivan, That thread is

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread Rui Barradas
Às 19:42 de 08/04/2024, Ivan Krylov via R-help escreveu: В Sun, 7 Apr 2024 23:47:52 -0600 Dave Dixon пишет: > second_records <- read.csv(file_name, skip = 2459465, nrows = 5) It may or may not be important that read.csv defaults to header = TRUE. Having skipped 2459465 lines, it may attemp

Re: [R] Building R-4,3,3 fails

2024-04-08 Thread Rich Shepard
On Mon, 8 Apr 2024, Ivan Krylov wrote: Questions about building R do get asked here and R-devel. Since you're compiling a released version of R and we don't have an R-SIG-Slackware mailing list, R-help sounds like the right place. Ivan, Okay: What are the last lines of the build log, contai

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread Ivan Krylov via R-help
В Sun, 7 Apr 2024 23:47:52 -0600 Dave Dixon пишет: > > second_records <- read.csv(file_name, skip = 2459465, nrows = 5) It may or may not be important that read.csv defaults to header = TRUE. Having skipped 2459465 lines, it may attempt to parse the next one as a header, so the second call read

[R] Building R-4,3,3 fails

2024-04-08 Thread Rich Shepard
I've been building R versions for years with no issues. Now I'm trying to build R-4.3.3 on Slackware64-15.0 (fully patched) with TeXLive2024 (fully patched) installed. The error occurs building a vignette. Is this mail list the appropriate place to ask for help or should I post the request on sta

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread CALUM POLWART
data.table's fread is also fast. Not sure about error handling. But I can merge 300 csvs with a total of 0.5m lines and 50 columns in a couple of minutes versus a lifetime with read.csv or readr::read_csv On Mon, 8 Apr 2024, 16:19 Stevie Pederson, wrote: > Hi Dave, > > That's rather frustratin

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread Bert Gunter
No idea, but have you tried using ?scan to read those next 5 rows? It might give you a better idea of the pathologies that are causing problems. For example, an unmatched quote might result in some huge number of characters trying to be read into a single element of a character variable. As your pr

Re: [R] duplicated() on zero-column data frames returns empty

2024-04-08 Thread Jorgen Harmse via R-help
I appreciate the compliment from Ivan and still share the puzzlement at the empty return. What is the policy for changing something that is wrong? There is a trade-off between breaking old code that worked around a problem and breaking new code written by people who make reasonable assumptions.

[R] Questions about ks.test function {stats}

2024-04-08 Thread Jin, Ziyan
Dear R-help, Hope this email finds you well. My name is Ziyan. I am a graduate student in Zhejiang University. My subject research involves ks.test in stats-package {stats}. Based on the code, I have two main questions. Could you provide me some more information? I download different versions

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread Stevie Pederson
Hi Dave, That's rather frustrating. I've found vroom (from the package vroom) to be helpful with large files like this. Does the following give you any better luck? vroom(file_name, delim = ",", skip = 2459465, n_max = 5) Of course, when you know you've got errors & the files are big like that

[R] Exceptional slowness with read.csv

2024-04-08 Thread Dave Dixon
Greetings, I have a csv file of 76 fields and about 4 million records. I know that some of the records have errors - unmatched quotes, specifically.  Reading the file with readLines and parsing the lines with read.csv(text = ...) is really slow. I know that the first 2459465 records are good.

Re: [R] How to set the correct libomp for R

2024-04-08 Thread Ivan Krylov via R-help
В Mon, 8 Apr 2024 10:29:53 +0200 gernophil--- via R-help пишет: > I have some weird issue with using multithreaded data.table in macOS > and I am trying to figure out, if it’s connected to my libomp.dylib. > I started using libomp as stated here: > https://mac.r-project.org/openmp/ Does the beha

[R] How to set the correct libomp for R

2024-04-08 Thread gernophil--- via R-help
Hey everyone, I have some weird issue with using multithreaded data.table in macOS and I am trying to figure out, if it’s connected to my libomp.dylib. I started using libomp as stated here: https://mac.r-project.org/openmp/   Everything worked fine till beginning of this year, but all of a sudd