rther
analysis and/or manipulation.
Cheers
Petr
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Love Bohman
> Sent: Tuesday, December 5, 2017 1:23 AM
> To: Jeff Newmiller
> Cc: r-help@r-project.org; peter dalgaard
> Subject: Re: [R]
0)
> >
> > datanames <- paste0("bb_", 2000:2002)
> > datalist <- lapply(datanames, get)
> > is.vector(datalist[1])
> >
> >
> > I learned a lot of code today, and I really appreciate it! A million
> > thanks!
> > My R-superpowe
l, not as minuscule as when I woke up this
> morning.
>
> All the best,
> Love (or maybe LoveR, my future superhero name)
>
>
>
> -Ursprungligt meddelande-
> Från: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us]
> Skickat: den 5 december 2017 00:01
> Till: L
are, well, not as minuscule as when I woke up this morning.
All the best,
Love (or maybe LoveR, my future superhero name)
-Ursprungligt meddelande-
Från: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us]
Skickat: den 5 december 2017 00:01
Till: Love Bohman
Kopia: peter dalgaard ; r-help@r-project
g, I'm just struggling to learn a new language and
partly a new way of thinking, and I really appreciate the corrections. I hope I
someday will be able to handle lists in R as easy as I handle loops in Stata...
Thanks again!
Love
-Ursprungligt meddelande-
Fr?n: peter dalgaard [mailto:pd
), as.vector(eval(as.name(varname
> }
>
> -Ursprungligt meddelande-
> Från: peter dalgaard [mailto:pda...@gmail.com]
> Skickat: den 4 december 2017 16:39
> Till: Love Bohman
> Kopia: r-help@r-project.org
> Ämne: Re: [R] Dynamic reference, right-hand side of funct
meddelande-
Från: peter dalgaard [mailto:pda...@gmail.com]
Skickat: den 4 december 2017 23:09
Till: Love Bohman
Kopia: r-help@r-project.org
Ämne: Re: [R] Dynamic reference, right-hand side of function
Um, if you insist on doing it that way, at least use
assign(varname, as.vector(get(varname)))
000:2007){
> varname <- paste0("aa_",year)
> assign(paste0(varname), as.vector(eval(as.name(varname
> }
>
> -Ursprungligt meddelande-
> Från: peter dalgaard [mailto:pda...@gmail.com]
> Skickat: den 4 december 2017 16:39
> Till: Love Bohman
> Kopia:
lp@r-project.org
Ämne: Re: [R] Dynamic reference, right-hand side of function
The generic rule is that R is not a macro language, so looping of names of
things gets awkward. It is usually easier to use compound objects like lists
and iterate over them. E.g.
datanames <- paste0("aa_&
The generic rule is that R is not a macro language, so looping of names of
things gets awkward. It is usually easier to use compound objects like lists
and iterate over them. E.g.
datanames <- paste0("aa_", 2000:2007)
datalist <- lapply(datanames, get)
names(datalist) <- datanames
col1 <- lappl
Hi Love,
I am not sure if I understand your question and it will help if you
provided a sample data frame, sample of your code and sample of your output
and the output you desire. Having said that, I think you could use cbind to
join all datasets into a matrix and use the apply family of functions
11 matches
Mail list logo