Re: [R] readLines() and unz() and non-empty final line

2024-10-24 Thread Ebert,Timothy Aaron
I had something like this problem where the program read files but some files would be missing the last line of data. My solution was to write another program that looked at the files and if a file did not end in a line feed to add one. Possibly a bit primitive, but it worked. Regards, Tim

Re: [R] readLines() and unz() and non-empty final line

2024-10-24 Thread Bert Gunter
But note: > zip("hello.zip", "hello.txt") updating: hello.txt (stored 0%) > readChar(unz("hello.zip","hello.txt"),100) [1] "hello" I leave it to you and other wiser heads to figure out. Cheers, Bert On Thu, Oct 24, 2024 at 8:57 AM Iris Simmons wrote: > Hi Mikko, > > > I tried running a few di

Re: [R] readLines() and unz() and non-empty final line

2024-10-24 Thread Iris Simmons
Hi Mikko, I tried running a few different things, and it seems as though explicitly using `open()` and opening a blocking connection works. ```R cat("hello", file = "hello.txt") zip("hello.zip", "hello.txt") local({ conn <- unz("hello.zip", "hello.txt") on.exit(close(conn)) ## you ca

Re: [R] Outputting a difftime object in PASTE or AS.CHARACTER is missing the unit + expand the format options?

2024-10-24 Thread Martin Maechler
> Reuver, B de \(epi\) via R-help > on Wed, 23 Oct 2024 08:11:50 + writes: > Hello, > I was working on an R script using the datediff object, to log certain durations in the data processing. > I ran in to the issue that outputing a datediff object using PASTE will le

Re: [R] [EXTERNAL] R-help Digest, Vol 260, Issue 19

2024-10-24 Thread Jorgen Harmse via R-help
I think that Stevie Pederson has the right idea, but it is not obvious what the threshold should be. Example: > n <- 2428716; sum(rep(1/n,n)) - 1 [1] -3.297362e-14 I assume that equally large errors in the other direction are also possible. Regards, Jorgen Harmse. -

Re: [R] OSX-specific Bug in randomForest

2024-10-24 Thread Stevie Pederson
Thank you all for such insightful comments & let's hope it gets sorted soon. I was unaware of the isTRUE() and all.equal() functions so they're very helpful things indeed to add to my own toolkit. Our current solution is to move from a local machine to an HPC-based environment so we have a way for

Re: [R] OSX-specific Bug in randomForest

2024-10-24 Thread peter dalgaard
This is probably Apple Silicon specific, not OSX per se: > sum(rep(1 / 9, 9)) - 1 [1] 0 > On 23 Oct 2024, at 07:26 , Stevie Pederson > wrote: > > sum(rep(1 / 9, 9)) - 1 > # [1] 2.220446e-16 -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000