Re: [R] Generate random vectors (continuous number) with a fixed sum

2025-04-26 Thread Duncan Murdoch
If a uniform sample is needed, it's fairly easy to turn my solution into a rejection sampler that is uniform across the region satisfying the constraints. It has an acceptance rate that is bounded below by something like 1/factorial(dim-1), e.g. 1/6 in 4 dimensions. Duncan Murdoch On 2025-04-

Re: [R] Possible bug in gzcon() (6161:src/main/connections.c)

2025-04-26 Thread Ivan Krylov via R-help
В Fri, 25 Apr 2025 13:41:35 + André Wildberg пишет: > Reproducible example: > > addr <- > "https://www1.ncdc.noaa.gov/pub/data/ghcn/daily/by_station/USW00014839.csv.gz"; > > > # online/stream > > nrow(read.csv(gzcon(url(addr), text=T), header=F)) > > # [1] 1798 > > > # local > > downl

Re: [R] Generate random vectors (continuous number) with a fixed sum

2025-04-26 Thread Bert Gunter
Yes, thanks. I got my algebra/constraints wrong. ... Sigh... Unfortunatey, this seems to make things yet more difficult. -- Bert "An educated person is one who can entertain new ideas, entertain others, and entertain herself." On Sat, Apr 26, 2025 at 10:01 AM Duncan Murdoch wrote: > On 2025

Re: [R] Generate random vectors (continuous number) with a fixed sum

2025-04-26 Thread Duncan Murdoch
And I missed copying one line: sums <- rowSums(x) should come between the calculations of x and x0. Duncan Murdoch On 2025-04-26 1:01 p.m., Duncan Murdoch wrote: On 2025-04-24 3:25 p.m., Bert Gunter wrote: Folks: Unless my wee old brain errs (always a danger), uniform sampling from an n-vec

Re: [R] Generate random vectors (continuous number) with a fixed sum

2025-04-26 Thread Duncan Murdoch
On 2025-04-24 3:25 p.m., Bert Gunter wrote: Folks: Unless my wee old brain errs (always a danger), uniform sampling from an n-vector for which 0 <= ai <= xi <= bi and SUM(xi) = k, a constant, where to ensure that the constraints are consistent (and nontrivial), SUM(ai)< k and SUM(bi) > k, is a

Re: [R] 4.5.0: Do NOT just copy library folder and update.packages()

2025-04-26 Thread Gabor Grothendieck
I used to copy and update but I found that over time my library gets filled with packages that I don't use so now every time a new version of R encounters a package it does not know about I just reinstall it. That keeps my library cleaner. On Fri, Apr 25, 2025 at 12:17 PM Peter Dalgaard via R-help

Re: [R] 4.5.0: Do NOT just copy library folder and update.packages()

2025-04-26 Thread peter dalgaard
It's still not completely clear what you intend. You should not just add a 4.4-built library to the library path under 4.5, because the API has changed. So packages in the old library may not work, although some might work because they don't use the parts of the API that changed. The library fol

Re: [R] 4.5.0: Do NOT just copy library folder and update.packages()

2025-04-26 Thread Fer
Sorry, I am copying nothing from any folder to another folder, as per my message. I am surprise I was not clear enough. I have my on bash script to make a clean installation from source, but I keep track of my bandwidth usage. So I try to make this stuff once in a time as when I upgrade my SO v

Re: [R] Spontaneous revert to 4.4?

2025-04-26 Thread peter dalgaard
That sounds odd and AFAICT not happening here. Virus checkers sometimes shift things around, but not like that, I think. It could be file system corruption, so try running "First Aid" in the Disk Utility app. -pd > On 25 Apr 2025, at 23.10, Mitchell Maltenfort wrote: > > On a MacBook Silic

Re: [R] 4.5.0: Do NOT just copy library folder and update.packages()

2025-04-26 Thread peter dalgaard
Yes. I was a little more careful about filtering out base and recommended packages, but the former won't be on CRAN anyway and will just give off a warning. The recommended packages sometimes do get upgraded on CRAN and whether you want those or the ones from the R release is a bit up in the a