Re: [R] Date Time, as.POSIXct used locale, strange plot behavior

2021-04-30 Thread PIKAL Petr
Hi. It should be probably CET not CEST. arrows(as.POSIXct("2021-04-21 00:00:00", tz="CEST"), 0.3, as.POSIXct("2021-04-21 00:00:00", tz="CEST"), 0.2, length=0.07, angle=15) arrows(as.POSIXct("2021-04-21 00:00:00", tz="CET"), 0.3, as.POSIXct("2021-04-21 0

Re: [R] Date Time, as.POSIXct used locale, strange plot behavior

2021-04-30 Thread Tilmann Faul
Dear Jeff, Thanks for your answer. Sys.timezone() gives [1] "Europe/Berlin" I tried "Europe/Berlin" as tz argument, giving the same result als using "CEST" (Central European Summer Time). It seems to me, that using as.POSIXct without tz argument defaults to tz UTC and with tz argument, either "CE

Re: [R] Date Time, as.POSIXct used locale, strange plot behavior

2021-04-30 Thread Enrico Schumann
On Fri, 30 Apr 2021, Tilmann Faul writes: > Dear Jeff, > > Thanks for your answer. > Sys.timezone() gives > [1] "Europe/Berlin" > I tried "Europe/Berlin" as tz argument, giving the same result als using > "CEST" (Central European Summer Time). > It seems to me, that using as.POSIXct without tz ar

Re: [R] Help understanding loop behaviour

2021-04-30 Thread Jim Lemon
Hi email, If you want what you described, try this: xx<-read.table(text="COMPANY_NUMBER NUMBER_OF_YEARS 0070837 3 0070837 3 0070837 3 1000403 4 1000403 4 1000403 4 1000403 4 10029943 3 10029943 3 10029943 3 10037980 4 10037980 4 10037980 4 10037980 4 10057418 3 10057418 3 10057418

Re: [R] Date Time, as.POSIXct used locale, strange plot behavior

2021-04-30 Thread Tilmann Faul
Dear Enrico, Thanks a lot, that clarifies the topic for me. Checking the numeric representation i was not aware of. Best Regards Tilmann On 30.04.21 11:17, Enrico Schumann wrote: > On Fri, 30 Apr 2021, Tilmann Faul writes: > >> Dear Jeff, >> >> Thanks for your answer. >> Sys.timezone() gives >

Re: [R] Help understanding loop behaviour

2021-04-30 Thread PIKAL Petr
Hallo, Sorry, my suggestion did not worked in your case correctly as split used natural factor ordering. So using Jim's data, this results in desired output. #prepare factor in original ordering ff <- factor(xx[,1], levels=unique(xx[,1])) lll <- split(xx$COMPANY_NUMBER, ff) xx$I <- unlist(lapply

Re: [R] Help understanding loop behaviour

2021-04-30 Thread Rui Barradas
Hello, For column J, ave/seq_along seems to be the simplest. For column I, ave is also a good option, it avoids split/lapply. xx$I <- ave(xx$NUMBER_OF_YEARS, xx$COMPANY_NUMBER, FUN = function(x){ c(rep(1, length(x) - 1), max(length(x))) }) xx$J <- ave(xx$NUMBER_OF_YEARS, xx$COMPANY_NUMBER,

Re: [R] Help understanding loop behaviour

2021-04-30 Thread Bert Gunter
There is something wrong here I believe -- see inline below: Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Apr 30, 2021 at 10:37 AM Rui Barradas wrote:

[R] Package "hse" has been REPLACED by package "dbd".

2021-04-30 Thread Rolf Turner
A reviewer of a paper that I wrote, of which the "hse" package was a central consideration, thought that users might find the name "hse" ("hope springs eternal") to be indicative of a lack of seriousness. Consequently I have changed the name of the package to "dbd" ("discretised beta distributio

Re: [R] Help understanding loop behaviour

2021-04-30 Thread Rui Barradas
Hello, Right, thanks. I should be xx$I <- ave(xx$NUMBER_OF_YEARS, xx$COMPANY_NUMBER, FUN = function(x){ c(rep(1, length(x) - 1), length(x)) ### ??? }) Hope this helps, Rui Barradas Às 19:46 de 30/04/21, Bert Gunter escreveu: There is something wrong here I believe -- see inlin