Re: [R] Unable to use `eval(parse(text))' in nlme::lme

2015-02-09 Thread Ravi Varadhan
Thanks to Rolf, Duncan, and Ben. Ben, your suggestion worked (with a minor correction of concatenating the termlabels into a vector). Here is the solution to those interested. ff - reformulate(termlabels=c(time,as.factor(gvhd)), response=yname, intercept=TRUE) dd - subset(labdata2,

[R] transpose a data frame according to a specific variable

2015-02-09 Thread jeff6868
Dear R-users, I would like to transpose a large data.frame according to a specific column. Here's a reproductible example, it will be more understandable. At the moment, my data.frame looks like this example: DF - data.frame(id=c(A,A,A,B,B,B,C,C,C),

[R] NA when trying to calculate AIC value for DLNM

2015-02-09 Thread Malgosia Lubczynska
Dear all, I am trying to run a sensitivity analysis for a DLNM combined with a case crossover design and select the best parameters based on AIC values for different model set-ups. model - glm(mortality ~ cb.temp + ns(soo, 7*7) + dow, family=quasipoisson(), my.data) where cb.temp is the

[R] Coordinate or top left corner + offset

2015-02-09 Thread Pascal A. Niklaus
Dear all, I am struggling to add annotations to panels of a series of plots arranged on a page. Basically, I'd like to add letters enumerating the panels (a,b,c,...), at a fixed distance from the top left corner of the plot's box. I succeeded partly with mtext (see below), but the at

[R] SAS equivalent for R's signif function?

2015-02-09 Thread Allen Bingham
Probably posting this to the wrong list ... but I'm in the process of learning R, after many years of using SAS --- so I thought I'd ask this question here: Is there with a function (or macro) in SAS that performs the same action as R's signif function, if so please provide? Tried to find

Re: [R] SAS equivalent for R's signif function?

2015-02-09 Thread Daniel Nordlund
On 2/9/2015 7:02 PM, Allen Bingham wrote: Probably posting this to the wrong list ... but I'm in the process of learning R, after many years of using SAS --- so I thought I'd ask this question here: Is there with a function (or macro) in SAS that performs the same action as R's signif

Re: [R] 16. Database connection query (Lalitha Kristipati)

2015-02-09 Thread Manel Amado Martí
Hi, You can read the R Data Import / Export Manual, that comes within the help files for the R Standard. I recommend specially the chapter 4, where you'll found the generical guidelines to connect to databases. At 4.3, RODBC Package, or DBI packages should be right to you. Regards, Manel

Re: [R] transpose a data frame according to a specific variable

2015-02-09 Thread Dennis Murphy
One way is to use the reshape2 package: library(reshape2) dcast(DF, id ~ Year, value.var = Day) Dennis On Mon, Feb 9, 2015 at 7:47 AM, jeff6868 geoffrey_kl...@etu.u-bourgogne.fr wrote: Dear R-users, I would like to transpose a large data.frame according to a specific column. Here's a

Re: [R] NA when trying to calculate AIC value for DLNM

2015-02-09 Thread Prof Brian Ripley
On 09/02/2015 14:28, Malgosia Lubczynska wrote: Dear all, I am trying to run a sensitivity analysis for a DLNM combined with a case crossover design and select the best parameters based on AIC values for different model set-ups. model - glm(mortality ~ cb.temp + ns(soo, 7*7) + dow,

[R] Revolutions blog: January 2015 roundup

2015-02-09 Thread David Smith
For more than 6 years, Revolution Analytics staff and guests have written about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them,

Re: [R] transpose a data frame according to a specific variable

2015-02-09 Thread Erich Neuwirth
library(tidyr) spread(DF,Year,Day) On 09 Feb 2015, at 16:47, jeff6868 geoffrey_kl...@etu.u-bourgogne.fr wrote: finalDF - data.frame(id=c(A,B,C),2000=c(NA,NA,164),2001=c(120,NA,99), 2002=c(90,18,48),2003=c(54,217,NA),2004=c(NA,68,NA)) signature.asc Description: Message signed with

Re: [R] Coordinate or top left corner + offset

2015-02-09 Thread David L Carlson
This is more complicated, but it could be rolled up into a function. Replace your mtext() call with the following: # Set character expansion size cx - 2.5 # Get the plot coordinates and the character size ur - par(usr)[c(1, 4)] chr - par(cxy) rect(ur[1]+chr[1]/10, ur[2]-chr[2]*cx,

Re: [R] suggestion for optimal plotting to show significant differences

2015-02-09 Thread PIKAL Petr
Hallo Richard. I tried your suggestion but it seems to be no better than simple ggplot. Let me extend the example a bit to 8 items which is more realistic. item-rep(letters[1:8], each=18) day-rep((0:5)*100, 24) set-rep(rep(1:3, each=6), 8) test-data.frame(item, day, set) set.seed(111)

[R] ASA John M. Chambers Statistical Software Award - 2015

2015-02-09 Thread Munjal, Aarti
John M. Chambers Statistical Software Award - 2015 Statistical Computing Section American Statistical Association The Statistical Computing Section of the American Statistical Association announces the competition for the John M. Chambers Statistical Software Award. In 1998 the Association

[R] Database connection query

2015-02-09 Thread Lalitha Kristipati
Hi, I would like to know when to use drivers and when to use packages to connect to databases in R Regards, Lalitha Kristipati Associate Software Engineer Disclaimer:

[R] Variance is different in R vs. Excel?

2015-02-09 Thread Karl Fetter
Hello everyone, I have a simple question. when I use the var() function in R to find a variance, it differs greatly from the variance found in excel using the =VAR.S function. Any explanations on what those two functions are actually doing? Here is the data and the results:

[R] neural network, random forest with survey data

2015-02-09 Thread ying_chen wang
Hi, everyone: Does anyone know if any statistical packages (such as R) can accommodate neural network or random forest with survey data? With survey data, we have to incorporate weight with sampling issue or even with design effect. Would appreciate if anyone can help. Grace

Re: [R] Variance is different in R vs. Excel?

2015-02-09 Thread David L Carlson
Time for a new version of Excel? I cannot duplicate your results in Excel 2013. R: apply(dat, 2, var) [1] 21290.80 24748.75 Excel 2013: =VAR.S(A2:A21) =VAR.S(B2:B21) 21290.8 24748.74737 - David L Carlson Department of Anthropology Texas AM

Re: [R] Variance is different in R vs. Excel?

2015-02-09 Thread Ted Harding
[See at end] On 09-Feb-2015 21:45:11 David L Carlson wrote: Time for a new version of Excel? I cannot duplicate your results in Excel 2013. R: apply(dat, 2, var) [1] 21290.80 24748.75 Excel 2013: =VAR.S(A2:A21) =VAR.S(B2:B21) 21290.8 24748.74737

[R] Donwload youtube videos

2015-02-09 Thread Raoni Rodrigues
Hello R-helpers, It is possible donwload youtube videos with R? I made a google search and find no options to do that. Thanks in advanced, Raoni [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

Re: [R] Database connection query

2015-02-09 Thread Marc Schwartz
On Feb 9, 2015, at 4:33 AM, Lalitha Kristipati lalitha.kristip...@techmahindra.com wrote: Hi, I would like to know when to use drivers and when to use packages to connect to databases in R Regards, Lalitha Kristipati Associate Software Engineer In general, you will need both.

Re: [R] Save a plot with a name given as an argument in a function

2015-02-09 Thread Jorge I Velez
Hi Evgenia, Try test2 - function(data, TitleGraph){ pdf(paste0(TitleGraph, .pdf), width = 7, height = 5) plot(data) dev.off() } instead. Take a look at ?paste0 for more information. HTH, Jorge.- On Tue, Feb 10, 2015 at 12:14 AM, Evgenia ev...@aueb.gr wrote: test-function(data,

Re: [R] Save a plot with a name given as an argument in a function

2015-02-09 Thread Evgenia
Thanks alot -- View this message in context: http://r.789695.n4.nabble.com/Save-a-plot-with-a-name-given-as-an-argument-in-a-function-tp4702965p4702969.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] Coordinate or top left corner + offset

2015-02-09 Thread Ben Bolker
David L Carlson dcarlson at tamu.edu writes: This is more complicated, but it could be rolled up into a function. Replace your mtext() call with the following: # Set character expansion size cx - 2.5 # Get the plot coordinates and the character size ur - par(usr)[c(1, 4)] chr - par(cxy)

Re: [R-es] Trabajar en un único formato de codificación

2015-02-09 Thread javier.ruben.marcuzzi
Estimado Javier Villacampa González Su problema es conocido, por lo menos por mi, no por inteligente sino por lo que sufrí cuando vendí mi mac y muchas cosas no funcionaban. Aunque abras el archivo y lo puedas leer (con tus ojos, no de forma informática) aparecen problemas. Un asesor me

[R] Save a plot with a name given as an argument in a function

2015-02-09 Thread Evgenia
test-function(data, TitleGraph){ pdf(TitleGraph.pdf,width=7,height=5) plot(data) dev.off() } test(cars - c(1, 3, 6, 4, 9),TitleGraph=etc) My problem is that I want graph pdf being saved as etc and not as Titlegraph.pdf -- View this message in context:

Re: [R] Variance is different in R vs. Excel?

2015-02-09 Thread Ranjan Maitra
I suspect that this is the long-documented issue with indeed an entire industry -- and publications -- devoted to finding such errors in Excel. Till the 2013 version, it used to be a favorite HW problem of mine. Basically, Excel uses the short formula to calculate the variance and the sd. This

[R] Help

2015-02-09 Thread Andrés Felipe Flórez Rivera
Hi everyone, I am trying to automate (on a Win7 system) an R script to read data from a DB2 data base and write it to file, for processing by another system. My code runs in the R gui perfectly. So I wrote a batch file to call this .r file and output results to script.out as shown below. When I

[R] How to solve this complex equation

2015-02-09 Thread Ssuhanchen
Hi! I want to use R to calculate the variable x which is in a complex equation in below: 2 Σ[exp(-x/2)*(x^k)/(2^k*k!)]=0.05 k=0 how to solve this equation to get the exact x in R? Thank you very much. -- View this message in context:

[R] Ezoic and r-project.org

2015-02-09 Thread Piper Lofrano
Hi there, Firstly, congrats; r-project.org is an awesome site. Do you work on it full time or is it a hobby? Ezoic is the first Google AdSense certified partner headquartered in the US that helps sites increase AdSense earnings through layout improvement. Have you ever considered testing

Re: [R] Latest version of Rtools is incompatible with latest version of R !!

2015-02-09 Thread SirChill88
This solved my problem too. Thank you! -- View this message in context: http://r.789695.n4.nabble.com/Latest-version-of-Rtools-is-incompatible-with-latest-version-of-R-tp4701853p4703000.html Sent from the R help mailing list archive at Nabble.com.