I'm looking for an icon to represent an R package. Perhaps something like http://cdn2.iconfinder.com/data/icons/DarkGlass_Reworked/128x128/apps/package.png but with the R logo rather than KDE. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 4700 Keele Street Web: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA
On Dec 29, 2010, at 10:03 AM, Michael Friendly wrote:> I'm looking for an icon to represent an R package. Perhaps > something like > > http://cdn2.iconfinder.com/data/icons/DarkGlass_Reworked/128x128/apps/package.png > > but with the R logo rather than KDE.Can't you just get the location of an "R" at CRAN? http://cran.r-project.org/Rlogo.jpg>-- David Winsemius, MD West Hartford, CT
David Winsemius
2010-Dec-30 00:44 UTC
[R] access a column of a dataframe without qualifying the name of the column
On Dec 29, 2010, at 7:11 PM, John Sorkin wrote:> I am trying to write a function that will access a column of a data > frame without having to qualify the name of the data frame column as > long as the name of the dataframe is passed to the function. As can > be seen from the code below, my function is not working:Not sure what the verb "qualify" means in programming. Quoting?> > df <- data.frame(x=1:10,y=11:20) > df > > test <- function(column,data) { > print(data$column) > } > > test(x,df) > > I am trying to model my function after the way that lm works where > one needs not qualify column names, i.e.> df <- data.frame(x=1:10,y=11:20) > test <- function(column,dat) { print(colname <- deparse(substitute(column))) + dat[[colname]] + } > > test(x,df) [1] "x" [1] 1 2 3 4 5 6 7 8 9 10 > -- David.> > > fit1<- lm(y~x,data=df) > > > John David Sorkin M.D., Ph.D. > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for th...{{dropped: > 6}} > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD West Hartford, CT
Bert Gunter
2010-Dec-30 01:17 UTC
[R] access a column of a dataframe without qualifying the name of the column
?substitute test <- function(col,frm) { eval(substitute(col),frm) } test2 <- function(col,frm){ cname<- deparse(substitute(col)) frm[[cname]] } z <- data.frame(x=1:3,y=letters[1:3]) test(x, z) test2(x, z) -- Bert On Wed, Dec 29, 2010 at 4:44 PM, David Winsemius <dwinsemius at comcast.net> wrote:> > On Dec 29, 2010, at 7:11 PM, John Sorkin wrote: > >> I am trying to write a function that will access a column of a data frame >> without having to qualify the name of the data frame column as long as the >> name of the dataframe is passed to the function. As can be seen from the >> code below, my function is not working: > > Not sure what the verb "qualify" means in programming. Quoting? > >> >> df <- data.frame(x=1:10,y=11:20) >> df >> >> test <- function(column,data) { >> ?print(data$column) >> } >> >> test(x,df) >> >> I am trying to model my function after the way that lm works where one >> needs not qualify column names, i.e. > > >> df <- data.frame(x=1:10,y=11:20) >> test <- function(column,dat) { print(colname <- >> deparse(substitute(column))) > + ?dat[[colname]] > + } >> >> test(x,df) > [1] "x" > ?[1] ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 10 >> > > -- > David. > > >> >> >> fit1<- lm(y~x,data=df) >> >> >> John David Sorkin M.D., Ph.D. >> Chief, Biostatistics and Informatics >> University of Maryland School of Medicine Division of Gerontology >> Baltimore VA Medical Center >> 10 North Greene Street >> GRECC (BT/18/GR) >> Baltimore, MD 21201-1524 >> (Phone) 410-605-7119 >> (Fax) 410-605-7913 (Please call phone number above prior to faxing) >> >> Confidentiality Statement: >> This email message, including any attachments, is for th...{{dropped:6}} >> >> ______________________________________________ >> R-help at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > David Winsemius, MD > West Hartford, CT > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Bert Gunter Genentech Nonclinical Biostatistics
John Sorkin
2010-Dec-30 02:24 UTC
[R] access a column of a dataframe without qualifying the name of the column
Thank you John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing)>>> Bert Gunter <gunter.berton at gene.com> 12/29/2010 8:17 PM >>> ?substitute test <- function(col,frm) { eval(substitute(col),frm) } test2 <- function(col,frm){ cname<- deparse(substitute(col)) frm[[cname]] } z <- data.frame(x=1:3,y=letters[1:3]) test(x, z) test2(x, z) -- Bert On Wed, Dec 29, 2010 at 4:44 PM, David Winsemius <dwinsemius at comcast.net> wrote:> > On Dec 29, 2010, at 7:11 PM, John Sorkin wrote: > >> I am trying to write a function that will access a column of a data frame >> without having to qualify the name of the data frame column as long as the >> name of the dataframe is passed to the function. As can be seen from the >> code below, my function is not working: > > Not sure what the verb "qualify" means in programming. Quoting? > >> >> df <- data.frame(x=1:10,y=11:20) >> df >> >> test <- function(column,data) { >> print(data$column) >> } >> >> test(x,df) >> >> I am trying to model my function after the way that lm works where one >> needs not qualify column names, i.e. > > >> df <- data.frame(x=1:10,y=11:20) >> test <- function(column,dat) { print(colname <- >> deparse(substitute(column))) > + dat[[colname]] > + } >> >> test(x,df) > [1] "x" > [1] 1 2 3 4 5 6 7 8 9 10 >> > > -- > David. > > >> >> >> fit1<- lm(y~x,data=df) >> >> >> John David Sorkin M.D., Ph.D. >> Chief, Biostatistics and Informatics >> University of Maryland School of Medicine Division of Gerontology >> Baltimore VA Medical Center >> 10 North Greene Street >> GRECC (BT/18/GR) >> Baltimore, MD 21201-1524 >> (Phone) 410-605-7119 >> (Fax) 410-605-7913 (Please call phone number above prior to faxing) >> >> Confidentiality Statement: >> This email message, including any attachments, is for th...{{dropped:6}} >> >> ______________________________________________ >> R-help at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > David Winsemius, MD > West Hartford, CT > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Bert Gunter Genentech Nonclinical Biostatistics Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:6}}
John Sorkin
2010-Dec-30 02:26 UTC
[R] access a column of a dataframe without qualifying the name of the column
Thank you, John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing)>>> Bert Gunter <gunter.berton at gene.com> 12/29/2010 8:17 PM >>> ?substitute test <- function(col,frm) { eval(substitute(col),frm) } test2 <- function(col,frm){ cname<- deparse(substitute(col)) frm[[cname]] } z <- data.frame(x=1:3,y=letters[1:3]) test(x, z) test2(x, z) -- Bert On Wed, Dec 29, 2010 at 4:44 PM, David Winsemius <dwinsemius at comcast.net> wrote:> > On Dec 29, 2010, at 7:11 PM, John Sorkin wrote: > >> I am trying to write a function that will access a column of a data frame >> without having to qualify the name of the data frame column as long as the >> name of the dataframe is passed to the function. As can be seen from the >> code below, my function is not working: > > Not sure what the verb "qualify" means in programming. Quoting? > >> >> df <- data.frame(x=1:10,y=11:20) >> df >> >> test <- function(column,data) { >> print(data$column) >> } >> >> test(x,df) >> >> I am trying to model my function after the way that lm works where one >> needs not qualify column names, i.e. > > >> df <- data.frame(x=1:10,y=11:20) >> test <- function(column,dat) { print(colname <- >> deparse(substitute(column))) > + dat[[colname]] > + } >> >> test(x,df) > [1] "x" > [1] 1 2 3 4 5 6 7 8 9 10 >> > > -- > David. > > >> >> >> fit1<- lm(y~x,data=df) >> >> >> John David Sorkin M.D., Ph.D. >> Chief, Biostatistics and Informatics >> University of Maryland School of Medicine Division of Gerontology >> Baltimore VA Medical Center >> 10 North Greene Street >> GRECC (BT/18/GR) >> Baltimore, MD 21201-1524 >> (Phone) 410-605-7119 >> (Fax) 410-605-7913 (Please call phone number above prior to faxing) >> >> Confidentiality Statement: >> This email message, including any attachments, is for th...{{dropped:6}} >> >> ______________________________________________ >> R-help at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > David Winsemius, MD > West Hartford, CT > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Bert Gunter Genentech Nonclinical Biostatistics Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:6}}
peter dalgaard
2010-Dec-30 19:43 UTC
[R] access a column of a dataframe without qualifying the name of the column
On Dec 30, 2010, at 01:44 , David Winsemius wrote:> > On Dec 29, 2010, at 7:11 PM, John Sorkin wrote: > >> I am trying to write a function that will access a column of a data frame without having to qualify the name of the data frame column as long as the name of the dataframe is passed to the function. As can be seen from the code below, my function is not working: > > Not sure what the verb "qualify" means in programming. Quoting?To specify context, basically. I.e., the name "sex" may need to be qualified by the data frame in which the variable appears, as in mydata$sex. It can be used unqualified in model formulas, in with-constructs, or if the data frame was attached. Google "qualified name" for further material. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com