Re: [R] converting a character string to an object name

2019-03-29 Thread Jeff Newmiller
Seconded! On March 29, 2019 11:33:01 AM PDT, Rui Barradas wrote: >Hello, > >I recommend you save them all in a list. It's a much better idea than >to >have length(names(wb)) objects in the globalenv. >Something like the following would read them all in one go. > >xls_list <- lapply(seq_along(nam

Re: [R] converting a character string to an object name

2019-03-29 Thread Rui Barradas
Hello, I recommend you save them all in a list. It's a much better idea than to have length(names(wb)) objects in the globalenv. Something like the following would read them all in one go. xls_list <- lapply(seq_along(names(wb))[-1], function(i){ read.xlsx(wb, sheet = i) }) names(xls_list

Re: [R] converting a character string to an object name

2019-03-29 Thread Bert Gunter
I think you want ?assign 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, Mar 29, 2019 at 10:39 AM Assa Yeroslaviz wrote: > I am trying to automate the w

Re: [R] converting a character string to an object name

2019-03-29 Thread Ivan Krylov
On Fri, 29 Mar 2019 14:07:16 +0100 Assa Yeroslaviz wrote: > Is there a way to read for each sheet the name from names(wb) and > convert it to a name for the object? See `get` and `assign` functions for a way to use strings as object names. Generally, it might not be a good idea to do that (what

[R] converting a character string to an object name

2019-03-29 Thread Assa Yeroslaviz
I am trying to automate the way i read my tables. I have an Excel sheet I'm reading using openxlsx package. The sheet contains over 30 sheets, i would like to save each of them as separate objects. my workflow for now is as such: wb <- loadWorkbook(xlsxFile = "Output/Up_Down_Regulated_Gene_Lists.