Re: [R] Create a new list from selected items in another list

2019-01-26 Thread Jeff Newmiller
BBB <- lapply( CCC, function( v ) v[ 0 wrote: >Hi All-- > >I have a list which contain variables 0s at the end of each vector on >the isit. I want to create a new list with only numbers > 0. >It seems simple, but i tried several option, none of which worked. > >CCC <- list(A=c(1,2,3,0,0,0,0),

[R] Create a new list from selected items in another list

2019-01-26 Thread Ek Esawi
Hi All-- I have a list which contain variables 0s at the end of each vector on the isit. I want to create a new list with only numbers > 0. It seems simple, but i tried several option, none of which worked. CCC <- list(A=c(1,2,3,0,0,0,0), B=c(2,3,4,5,0,0,0,0,0,0)) for (i in 1:length(CCC)) {

Re: [R] TIme Zone error

2019-01-26 Thread Jeff Newmiller
Read the help file ?as.POSIXct "" as time zone is not an error. On January 26, 2019 1:15:21 PM PST, Christofer Bogaso wrote: >Hi, > >I want to set a specific Timezone for my R environment, with below >syntax: > >> Sys.getenv("Asia/Calcutta") > >[1] "" > >> >But it sets to some blank timezone.

Re: [R] TIme Zone error

2019-01-26 Thread William Dunlap via R-help
> Sys.setenv(TZ="US/Eastern") > as.POSIXlt("2019-01-26 01:19") [1] "2019-01-26 01:19:00 EST" > Sys.setenv(TZ="Asia/Calcutta") > as.POSIXlt("2019-01-26 01:19") [1] "2019-01-26 01:19:00 IST" (Sys.getenv("Asia/Calcutta") returns the value of the environment variable "Asia/Calcutta". It does not set

[R] TIme Zone error

2019-01-26 Thread Christofer Bogaso
Hi, I want to set a specific Timezone for my R environment, with below syntax: > Sys.getenv("Asia/Calcutta") [1] "" > But it sets to some blank timezone. I checked with OlsonNames(), to see available zones for R, where I found "Asia/Calcutta" available. I idea why R failed to set timezone

Re: [R] Function in default parameter value closing over variables defined later in the enclosing function

2019-01-26 Thread Ivan Krylov
On Thu, 24 Jan 2019 06:53:20 -0800 Jeff Newmiller wrote: > It would be better to also make secret an argument to outside instead > of a local variable or to give up on supplying the inside function as > an argument. This was in a small, mostly self-contained one-off script that tested different