Re: [R] How to extract information from .Rdata format

2020-07-31 Thread Rui Barradas
Hello, Inline. Às 05:30 de 01/08/2020, Ana Marija escreveu: do you think that this is useful output from Basics of R? Actually, the answer will be yes, I do. Explanation follows. load("paired_example.Rdata") str(rawdata) num [1:4482, 1:10] 46 4 3 48 1 4 0 60 0 12 ... - attr(*, "dimname

Re: [R] How to extract information from .Rdata format

2020-07-31 Thread Ana Marija
do you think that this is useful output from Basics of R? > load("paired_example.Rdata") > str(rawdata) num [1:4482, 1:10] 46 4 3 48 1 4 0 60 0 12 ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:4482] "gene1" "gene2" "gene3" "gene4" ... ..$ : chr [1:10] "a.cancer" "b.cancer" "c.cancer" "d.ca

Re: [R] How to extract information from .Rdata format

2020-07-31 Thread Bert Gunter
Sarah has explained all. I agree with her about the need for tutorials also. This list cannot substitute for such homework on your own. 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 Co

Re: [R] How to extract information from .Rdata format

2020-07-31 Thread Ana Marija
It seems that "treatment" and "patient" are just vectors. > treatment [1] "treat" "treat" "treat" "treat" "treat" "control" "control" [8] "control" "control" "control" > patient [1] "a" "b" "c" "d" "e" "a" "b" "c" "d" "e" On Fri, Jul 31, 2020 at 9:53 PM Ana Marija wrote: > > Hi Bert

Re: [R] How to extract information from .Rdata format

2020-07-31 Thread Ana Marija
Hi Bert, it gives me this: > a=load("paired_example.Rdata") > str(a) chr [1:3] "rawdata" "treatment" "patient" I don't know how to extract "treatment" for example in a data frame. I tried this but of no help. > b=a[[2]] > b [1] "treatment" > str(treatment) chr [1:10] "treat" "treat" "treat"

Re: [R] How to extract information from .Rdata format

2020-07-31 Thread Sarah Goslee
Hi Ana, You are making this far too complicated. load("paired_example.Rdata") ls() str(rawdata) str(treatment) str(patient) load() puts all of them into your current environment. If you assign the result of load() to something, in your example a, that object contains the names of the objects,

Re: [R] How to extract information from .Rdata format

2020-07-31 Thread Bert Gunter
What does str(a) give? 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, Jul 31, 2020 at 7:18 PM Ana Marija wrote: > Hello, > > I have this file: > > a=l

[R] How to extract information from .Rdata format

2020-07-31 Thread Ana Marija
Hello, I have this file: > a=load("paired_example.Rdata") > a [1] "rawdata" "treatment" "patient" I can extract "rawdata" with: dat<-local(get(load("paired_example.Rdata"))) Can you please advise how would I extract in data frame "treatment" and "patient"? Thanks Ana ___