[R] pseudoreplication
Greetings R Community The ASReml-R package will analyze data from experiments with pseudoreplications. Dealing with Pseudo-Replication in Linear Mixed Models https://www.vsni.co.uk/case-studies/dealing-with-pseudo-replication-in-linear-mixed-models Will the ‘lme4’ package return an equivalent analysis of data from experiments with pseudoreplications? Thank you for your assistance. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Re: [R] Error in loadNamespace
Thanks David!, that fixed the problem. Best regards, James On Thu, Dec 7, 2017 at 1:19 PM, David Winsemius <dwinsem...@comcast.net> wrote: > > > On Dec 7, 2017, at 10:47 AM, James Henson <jfhens...@gmail.com> wrote: > > > > Hello R Community, > > > > I inadvertently updated packages via R Studio when a package was open. > Now > > when R Studio is opened the message below appears in the console panel. > > > > Error in loadNamespace(name) : there is no package called ‘yaml’ > > > > Error in loadNamespace(name) : there is no package called ‘yaml’ > > > > When running R code, so far the only function that has not worked is > > datatable () in the ‘DT’ package. Removing the ‘DT’ package and > > reinstalling it had no effect. A possible fix is to update R from an > older > > version, which was not running when I made the mistake. Is this a good > > idea? > > There is a package on CRAN named "yaml". Have your tried installing it? > > > > Thanks for your help. > > > > James F. Henson > > > > [[alternative HTML version deleted]] > > Rhelp is a plain text mailing list. > > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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 > Alameda, CA, USA > > 'Any technology distinguishable from magic is insufficiently advanced.' > -Gehm's Corollary to Clarke's Third Law > > > > > > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] Error in loadNamespace
Hello R Community, I inadvertently updated packages via R Studio when a package was open. Now when R Studio is opened the message below appears in the console panel. Error in loadNamespace(name) : there is no package called ‘yaml’ Error in loadNamespace(name) : there is no package called ‘yaml’ When running R code, so far the only function that has not worked is datatable () in the ‘DT’ package. Removing the ‘DT’ package and reinstalling it had no effect. A possible fix is to update R from an older version, which was not running when I made the mistake. Is this a good idea? Thanks for your help. James F. Henson [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] Bayes Factor
Hello R Community; Just posted a question about Bayes Factor. But, just answered my own question. What is needed is to convert a 'dplyr' data frame into a standard data frame. competition2 <- data.frame(competition), where 'competition' is a 'dplyr' data frame with the following class structure. [1] "tbl_df" "tbl" "data.frame". Best regards, James __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] Bayes Factor
Hello R Community, Subject: Bayes Factor A Bayesian ANOVA of the form: competitionBayesOut <- anovaBF(biomass ~ clipping, data = competition) Returns the following Error message: Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘compare’ for signature ‘"BFlinearModel", "missing", "tbl_df"’ My guess the problem is in the ‘class’, which is: [1] “tbl_df” “tbl” “data.frame” The data was imported via the ‘readr’ package through R Studio, and then saved as a RData file. My code is below, and the data is attached as a text file. Thanks for your assistance. Best regards, James # Plots for Interpreting One-Way ANOVA library(digest) library(DT) datatable(competition) # Characterize the data. class(competition) str(competition) competition$clipping <- as.factor(competition$clipping) competition$biomass <- as.numeric(competition$biomass) str(competition) # tapply(competition$biomass, competition$clipping, mean) tapply(competition$biomass, competition$clipping, sd) # Bayesian Procedure for ANOVA # Calculate Bayes Factors library(BayesFactor) competitionBayesOut <- anovaBF(biomass ~ clipping, data = competition) # Run mcmc iterations mcmcOut2 <- posterior(competitionBayesOut, iterations = 1) # boxplot of the posteriors for the groups boxplot(as.matrix(mcmcOut2[,2:6])) # Show the HDIs summary(mcmcOut2) # Calculate the Bayes Factor competitionBayesOut # Pairwise "post hoc" tests library(rjags) library(BEST) # competitionare 'r5' vs. 'control' plot(BESTmcmc(competition[competition$clpping=="r5",2], competition[competition$clipping=="control",2])) # plot(BESTmcmc(competition[competition$clpping=="r10",2], competition[competition$clipping=="control",2])) # competitionare 'n10' vs. 'control' plot(BESTmcmc(competition[competition$clipping=="n10",2], competition[competition$clipping=="control",2])) # competitionare 'n50' vs. 'control' plot(BESTmcmc(competition[competition$clipping=="n50",2], competition[competition$clipping=="control",2])) clippingbiomass n25 551 n25 457 n25 450 n25 731 n25 499 n25 632 n50 595 n50 580 n50 508 n50 583 n50 633 n50 517 r5 639 r5 615 r5 511 r5 573 r5 648 r5 677 control 417 control 449 control 517 control 438 control 415 control 555 r10 563 r10 631 r10 522 r10 613 r10 656 r10 679 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Re: [R] Marg.fct function
Greetings Peter and Jeff, Thanks for this information. Will try these type of analyses in SAS. Sure they are doable in R, but developing a procedure is difficult. Alan Agresti gives a cookbook SAS method in An Introduction to Categorical Analysis. Thanks, James On Sun, Feb 5, 2017 at 3:47 PM, Jeff Newmiller <jdnew...@dcn.davis.ca.us> wrote: > It is not part of "R". You can dig through all of the packages that the > author mentions, or send an email to the author. > -- > Sent from my phone. Please excuse my brevity. > > On February 5, 2017 11:44:40 AM PST, James Henson <jfhens...@gmail.com> wrote: >>Greetings R Community, >> >>An attempt to reproduce the results from code in the source below >>fails. R cannot find the function ‘Marg.fct’. An Internet search for >>the ‘Marg.fct’ function was not fruitful. I appreciate your help. >>Best regards, James F. Henson. >> >>R (and S-PLUS) Manual to Accompany Agresti’s Categorical Data Analysis >>(2002) 2nd edition Laura A. Thompson, 2009© >> >>http://www.stat.ufl.edu/~aa/cda/Thompson_manual.pdf page 181 >> >>The code is: >> >># Code from Manual to Accompany Agresti’s Categorical Data Analysis >>(2002) 2nd edition Laura A. Thompson, 2009 >> >>y <- c(144, 33, 84, 126, 2, 4, 14, 29, 0, 2, 6, 25, 0, 0, 1, 5) >> >>ZF <- Z <- matrix(1,16,1) >> >># >> >>M1 <- Marg.fct(1,rep(4,2)) # used to get m1+, etc >> >>Error: could not find function "Marg.fct" >> >> >> >>M2 <- Marg.fct(2,rep(4,2)) # used to get m+1, etc >> >># >> >>C.matrix <- matrix(c( >> >> 1, 0, 0, 0, -1, 0, 0, 0, # y1+ = y+1 >> >> 0, 1, 0, 0, 0, -1, 0, 0, # y2+ = y+2 >> >> 0, 0, 1, 0, 0, 0, -1, 0), # y3+ = y+3 >> >> 3,8,byrow=T) >> >>h.fct <- function(m) { # constraint function >> >> marg <- rbind(M1%*%m, M2%*%m) # y1+, y2+, y3+, y4+, y+1, y+2, y+3, y+4 >> >> C.matrix%*%marg # y1+ = y+1, y2+ = y+2, etc >> >>} >> >># >> >>a <- mph.fit(y=y,Z=Z,ZF=ZF,h.fct=h.fct) >> >>mph.summary(a) >> >>__ >>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >>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. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] Marg.fct function
Greetings R Community, An attempt to reproduce the results from code in the source below fails. R cannot find the function ‘Marg.fct’. An Internet search for the ‘Marg.fct’ function was not fruitful. I appreciate your help. Best regards, James F. Henson. R (and S-PLUS) Manual to Accompany Agresti’s Categorical Data Analysis (2002) 2nd edition Laura A. Thompson, 2009© http://www.stat.ufl.edu/~aa/cda/Thompson_manual.pdf page 181 The code is: # Code from Manual to Accompany Agresti’s Categorical Data Analysis (2002) 2nd edition Laura A. Thompson, 2009 y <- c(144, 33, 84, 126, 2, 4, 14, 29, 0, 2, 6, 25, 0, 0, 1, 5) ZF <- Z <- matrix(1,16,1) # M1 <- Marg.fct(1,rep(4,2)) # used to get m1+, etc Error: could not find function "Marg.fct" M2 <- Marg.fct(2,rep(4,2)) # used to get m+1, etc # C.matrix <- matrix(c( 1, 0, 0, 0, -1, 0, 0, 0, # y1+ = y+1 0, 1, 0, 0, 0, -1, 0, 0, # y2+ = y+2 0, 0, 1, 0, 0, 0, -1, 0), # y3+ = y+3 3,8,byrow=T) h.fct <- function(m) { # constraint function marg <- rbind(M1%*%m, M2%*%m) # y1+, y2+, y3+, y4+, y+1, y+2, y+3, y+4 C.matrix%*%marg # y1+ = y+1, y2+ = y+2, etc } # a <- mph.fit(y=y,Z=Z,ZF=ZF,h.fct=h.fct) mph.summary(a) __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Re: [R] confidence intervals for orthogonal contrasts
Richard, Thanks, Have not previously used the HH package, but looks as if it contains many useful tools. Will check out your book also. Best regards, James On Thu, Dec 1, 2016 at 10:18 PM, Richard M. Heiberger <r...@temple.edu> wrote: > James, > > Please look at the maiz example, the last example in ?MMC > help("MMC", package="HH") > where I show how to construct and calculate a set of orthogonal contrasts > for a factor in an analysis of variance setting. mmc and mmcplot use glht > in the multcomp package for the underlying calculations. > > If yo don't have HH, you can get it with > install.packages("HH") > > See the references in ?MMC to my book and paper. The second edition > of the book is now available. > > Rich > > On Thu, Dec 1, 2016 at 4:17 PM, James Henson <jfhens...@gmail.com> wrote: >> Hi R users, >> Is there a way to calculate a confidence interval for each contrast in >> a set of orthogonal contrasts? The ‘multcomp’ package will calculate >> a CIs at the 95% family-wise confidence level. But, these confidence >> intervals are extremely wide. >> Thanks for your help. >> Best regards, >> James >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] confidence intervals for orthogonal contrasts
Hi R users, Is there a way to calculate a confidence interval for each contrast in a set of orthogonal contrasts? The ‘multcomp’ package will calculate a CIs at the 95% family-wise confidence level. But, these confidence intervals are extremely wide. Thanks for your help. Best regards, James __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Re: [R] yuen function of the WRS2 package
Thanks, The 'droplevels' statement works. Best regards, James Henson On Tue, Aug 30, 2016 at 5:34 PM, William Dunlap <wdun...@tibco.com> wrote: > yuen does not work when there unused levels in the factors given to it. > >> yuen(GoalsGame ~ League, tr=0.2, data = SpainGer) > Call: > yuen(formula = GoalsGame ~ League, data = SpainGer, tr = 0.2) > > Test statistic: NaN (df = NA), p-value = NA > > Trimmed mean difference: NaN > 95 percent confidence interval: > NaN NaN > >> yuen(GoalsGame ~ League, tr=0.2, data = droplevels(SpainGer)) > Call: > yuen(formula = GoalsGame ~ League, data = droplevels(SpainGer), > tr = 0.2) > > Test statistic: 0.8394 (df = 16.17), p-value = 0.4135 > > Trimmed mean difference: -0.11494 > 95 percent confidence interval: > -0.405 0.1751 > > Complain to WSR2's maintainer. >> maintainer("WRS2") > [1] "Patrick Mair <m...@fas.harvard.edu>" > > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Tue, Aug 30, 2016 at 2:07 PM, James Henson <jfhens...@gmail.com> wrote: >> >> Greetings R community, >> Here is a small but perplexing problem with the ‘yuen’ function in the >> ‘WRS2’ package. >> I begin with the ‘eurosoccer’ data frame from the ‘WRS2’ package. >> Then make a subset that contains only two Leagues Spain and Germany >> (subset data frame is ‘SpainGer’). The ‘yuen’ function cannot read >> the data in subset data frame ‘SpainGer’. My code is below. >> Thanks you for your help. >> James F. Henson >> >> >> # Examples from 'Robust Statistical Methods on R Using the WRS2 Package’ >> # Robust t-test, and ANOVA (pages5-13) >> library(WRS2) >> data("eurosoccer") >> class(eurosoccer) >> print(eurosoccer) >> library("digest") >> library("DT") >> datatable(eurosoccer) >> str(eurosoccer) >> # make a subset with only Spain and Germany >> SpainGer <- subset (eurosoccer, subset = League =="Spain" | League == >> "Germany") >> print(SpainGer) >> class(SpainGer) >> str(SpainGer) >> # The 'yuen' function can not read the data in the subset data.frame >> "SpainGer" >> yuen(GoalsGame ~ League, tr=0.2, data = SpainGer) >> # the 'yuen' function works on the orginioal data.frame >> yuen(GoalsGame ~ League, tr=0.2, data = eurosoccer) >> # the 'aov' function reads the data in the subset data.frame "SpainGer" >> Goals.fit <- aov(GoalsGame ~ League, data = SpainGer) >> summary(Goals.fit) >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. > > __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] yuen function of the WRS2 package
Greetings R community, Here is a small but perplexing problem with the ‘yuen’ function in the ‘WRS2’ package. I begin with the ‘eurosoccer’ data frame from the ‘WRS2’ package. Then make a subset that contains only two Leagues Spain and Germany (subset data frame is ‘SpainGer’). The ‘yuen’ function cannot read the data in subset data frame ‘SpainGer’. My code is below. Thanks you for your help. James F. Henson # Examples from 'Robust Statistical Methods on R Using the WRS2 Package’ # Robust t-test, and ANOVA (pages5-13) library(WRS2) data("eurosoccer") class(eurosoccer) print(eurosoccer) library("digest") library("DT") datatable(eurosoccer) str(eurosoccer) # make a subset with only Spain and Germany SpainGer <- subset (eurosoccer, subset = League =="Spain" | League == "Germany") print(SpainGer) class(SpainGer) str(SpainGer) # The 'yuen' function can not read the data in the subset data.frame "SpainGer" yuen(GoalsGame ~ League, tr=0.2, data = SpainGer) # the 'yuen' function works on the orginioal data.frame yuen(GoalsGame ~ League, tr=0.2, data = eurosoccer) # the 'aov' function reads the data in the subset data.frame "SpainGer" Goals.fit <- aov(GoalsGame ~ League, data = SpainGer) summary(Goals.fit) __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Re: [R] Whether statistical background is must to learn R language
Greetings Prasad, Here are some tutorials on statistics using R.Statistics and Actuarial Science – Carl James Schwarz http://people.stat.sfu.ca/~cschwarz/CourseNotes/ Statistics and Actuarial Science – Carl James Schwarz - Programs http://people.stat.sfu.ca/~cschwarz/Stat-650/Notes/MyPrograms/ Design Analysis and Interpretation of Experiments http://www.unh.edu/halelab/BIOL933/ Great YouTube channel of R tutorials by Mike Marin, https://www.youtube.com/user/marinstatlectures Best regards, James On Tue, May 31, 2016 at 8:04 AM, PIKAL Petrwrote: > Hi > > Well, it seems to me like cooking. > > You does not have to be educated cook to be able prepare some food in your > kitchen, but knowledge of some recipes can lead to tasty results > > Regards > Petr > >> -Original Message- >> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Prasad >> Kale >> Sent: Tuesday, May 31, 2016 9:23 AM >> To: R-help@r-project.org >> Subject: [R] Whether statistical background is must to learn R language >> >> Hi, >> >> I am very new to R and just started learning R. But i am not from statistical >> background so can i learn R or to learn R statistical background is must. >> >> Please guide. >> >> Thanks in Advance >> Prasad >> >> [[alternative HTML version deleted]] >> >> __ >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. > > > Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou > určeny pouze jeho adresátům. > Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně > jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze > svého systému. > Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email > jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat. > Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či > zpožděním přenosu e-mailu. > > V případě, že je tento e-mail součástí obchodního jednání: > - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, > a to z jakéhokoliv důvodu i bez uvedení důvodu. > - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; > Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany > příjemce s dodatkem či odchylkou. > - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným > dosažením shody na všech jejích náležitostech. > - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost > žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně > pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu > případně osobě, kterou adresát zastupuje, předloženy nebo jejich existence je > adresátovi či osobě jím zastoupené známá. > > This e-mail and any documents attached to it may be confidential and are > intended only for its intended recipients. > If you received this e-mail by mistake, please immediately inform its sender. > Delete the contents of this e-mail with all attachments and its copies from > your system. > If you are not the intended recipient of this e-mail, you are not authorized > to use, disseminate, copy or disclose this e-mail in any manner. > The sender of this e-mail shall not be liable for any possible damage caused > by modifications of the e-mail or by delay with transfer of the email. > > In case that this e-mail forms part of business dealings: > - the sender reserves the right to end negotiations about entering into a > contract in any time, for any reason, and without stating any reasoning. > - if the e-mail contains an offer, the recipient is entitled to immediately > accept such offer; The sender of this e-mail (offer) excludes any acceptance > of the offer on the part of the recipient containing any amendment or > variation. > - the sender insists on that the respective contract is concluded only upon > an express mutual agreement on all its aspects. > - the sender of this e-mail informs that he/she is not authorized to enter > into any contracts on behalf of the company except for cases in which he/she > is expressly authorized to do so in writing, and such authorization or power > of attorney is submitted to the recipient or the person represented by the > recipient, or the existence of such authorization is known to the recipient > of the person represented by the recipient. > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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,
Re: [R] mixed models
Greetings David, I am new to R and neglected to check vigorously for missing values. Apologize for posting without checking and finding the one NA. I appreciate your help. Thanks. James F. Henson On Fri, May 27, 2016 at 1:49 PM, David Winsemius <dwinsem...@comcast.net> wrote: > >> On May 27, 2016, at 10:07 AM, James Henson <jfhens...@gmail.com> wrote: >> >> Greetings Jeff, >> You are correct that the unequal number of levels is not the problem. >> I revised the data frame so that the number of levels was equal and >> the same error message occurred. The code is below, and the >> Eboni2.txt file is attached. This problem baffles me. I appreciate >> any help. >> Best regards, >> James >> Eboni2 <- read.csv("Eboni2.csv", header = TRUE) >> >> library("nlme") >> >> str(Eboni2) >> >> head(Eboni2) >> >> model1 <- lme(preDawn ~ Irrigation, random=~season_order|treeNo, data=Eboni2) > > I downloaded the attached file to your first posting that was called a "csv" > file but it was tab-separated (as could be clearly seen with the str output, > so would only load properly with read.delim rather than read.csv. Running > then with the lme call, it produced this message > >> model1 <- lme(preDawn ~ Irrigation, random=~season_order|treeNo, data=Eboni2) > Error in na.fail.default(list(season_order = c(5L, 5L, 5L, 5L, 5L, 5L, : > missing values in object > > And looking at the str result made it clear that there were many NA's in the > file. > >> head(Eboni2) > number Location Season season_order Month treeID treeNo preDawn midday > 1 1 UCC November5 Nov UCCLO 1 60 1.41.3 > 2 2 UCC November5 Nov UCCLO 2 72 1.21.3 > 3 3 UCC November5 Nov UCCLO 3 78 1.11.2 > 4 4 UCC November5 Nov UCCLO 4 79 1.12.1 > 5 5 UCC November5 Nov UCCLO 5 80 1.41.3 > 6 6 UCC November5 Nov UCCLO 6 81 0.61.8 > Irrigation PnetGsE WUE d15N d13C Nper Cper include2 > 1 N9 0.2907004 3.766207 2.389672 NA NA NANA no > 2 N 11 0.3262582 3.120574 3.524993 NA NA NANA no > 3 N8 0.2870957 1.693821 4.723050 3.00 -27.44 2.12 52.12 yes > 4 N 10 0.2475180 1.839343 5.436724 3.61 -29.50 1.42 51.97 yes > 5 N 13 0.3009228 3.082278 4.217660 NA NA NANA no > 6 N 17 0.3487337 2.534550 6.707304 2.79 -30.50 1.49 49.94 yes > > And even more importantly, there was one NA in your outcome variable: >> sum( is.na(Eboni2$Irrigation)) > [1] 0 >> sum( is.na(Eboni2$preDawn)) > [1] 1 > > So after restricting to complete.cases, I then formed the hypothesis that you > reversed the order of the variables in the formula for the random parameter: > >> table(Eboni2$season_order) > > 1 2 3 4 5 > 83 83 83 83 83 >> length( Eboni2$treeNo) > [1] 415 > > So it seemed unreasonable to have a "grouping" on variable with only one item > per group. > >> model1 <- lme(preDawn ~ Irrigation, random=~treeNo|season_order, >> data=Eboni2[ complete.cases( Eboni2[ , >> c('preDawn','Irrigation','season_order','treeNo')]), ] ) >> model1 > Linear mixed-effects model fit by REML > Data: Eboni2[complete.cases(Eboni2[, c("preDawn", "Irrigation", > "season_order", "treeNo")]), ] > Log-restricted-likelihood: -183.4708 > Fixed: preDawn ~ Irrigation > (Intercept) IrrigationY > 1.04520145 -0.06037706 > > Random effects: > Formula: ~treeNo | season_order > Structure: General positive-definite, Log-Cholesky parametrization > StdDev Corr > (Intercept) 0.140239324 (Intr) > treeNo 0.003766019 -0.725 > Residual0.365678898 > > Number of Observations: 414 > Number of Groups: 5 > > (Warning, I'm not a frequent user of this package or any of the mixed effects > packages.) > > > > Just to correct some misinformation that appeared earlier: You can attach > "csv" or "tsv" files as long as you name them with an .txt extension so the > mail clients and servers consider them to be MIME-text. > > -- > David. > > >> On Wed, May 25, 2016 at 6:23 PM, Jeff Newmiller >> <jdnew...@dcn.davis.ca.us> wrote: >>> Please keep the mailing list in the loop by using reply-all. >>> >>> I don't think there is a requirement that the number of levels is
Re: [R] mixed models
Greetings Jeff, You are correct that the unequal number of levels is not the problem. I revised the data frame so that the number of levels was equal and the same error message occurred. The code is below, and the Eboni2.txt file is attached. This problem baffles me. I appreciate any help. Best regards, James Eboni2 <- read.csv("Eboni2.csv", header = TRUE) library("nlme") str(Eboni2) head(Eboni2) model1 <- lme(preDawn ~ Irrigation, random=~season_order|treeNo, data=Eboni2) On Wed, May 25, 2016 at 6:23 PM, Jeff Newmiller <jdnew...@dcn.davis.ca.us> wrote: > Please keep the mailing list in the loop by using reply-all. > > I don't think there is a requirement that the number of levels is equal, but > there may be problems if you don't have the minimum number of records > corresponding to each combination of levels specified in your model. > > You can change the csv extension to txt and attach for the mailing list. Or, > better yet, you can use the dput function to embed the data directly in your > sample code. > > Also, please learn to post plain text email to avoid corruption of R code by > the HTML formatting. > -- > Sent from my phone. Please excuse my brevity. > > On May 25, 2016 2:26:54 PM PDT, James Henson <jfhens...@gmail.com> wrote: >> >> Good afternoon Jeff, >> The sample sizes for levels of the factor "Irrigation" are not equal. If >> 'nlme' requires equal sample sizes this may be the problem. The same data >> frame runs in 'lme4' without a problem. >> >> Best regards, >> James >> >> >> On Wed, May 25, 2016 at 3:41 PM, James Henson <jfhens...@gmail.com> wrote: >>> >>> Good afternoon Jeff, >>> >>> When working with this data frame, I just open the .csv file in R Studio. >>> But, we should not send .csv file to R_help. What should I send? >>> >>> Best regards, >>> James >>> >>> On Wed, May 25, 2016 at 2:52 PM, Jeff Newmiller >>> <jdnew...@dcn.davis.ca.us> wrote: >>>> >>>> You forgot to show the commands to us that you used to read the data in >>>> with (your example is not "reproducible"). This step can make all the >>>> difference in the world as to whether your analysis commands will work or >>>> not. >>>> -- >>>> Sent from my phone. Please excuse my brevity. >>>> >>>> On May 25, 2016 11:59:06 AM PDT, James Henson <jfhens...@gmail.com> >>>> wrote: >>>>> >>>>> Greetings R community, >>>>> >>>>> My aim is to analyze a mixed-effects model with temporal >>>>> pseudo-replication >>>>> (repeated measures on the same experimental unit) using ‘nlme’. >>>>> However, >>>>> my code returns the error message “Error in na.fail.default’, even >>>>> though >>>>> the data frame does not contain missing values. My code is below, and >>>>> the >>>>> data file is attached as ‘Eboni2.txt. >>>>> >>>>> library("nlme") >>>>> >>>>> str(Eboni2) >>>>> >>>>> head(Eboni2) >>>>> >>>>> model1 <- lme(preDawn ~ Irrigation, random=~season_order|treeNo, >>>>> data=Eboni2) >>>>> >>>>> I am genuinely confused. Hope someone can help. >>>>> >>>>> Best regards, >>>>> >>>>> James F. Henson >>>>> >>>>> >>>>> >>>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >>>>> 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. >>> >>> >> > __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] mixed models
Greetings R community, My aim is to analyze a mixed-effects model with temporal pseudo-replication (repeated measures on the same experimental unit) using ‘nlme’. However, my code returns the error message “Error in na.fail.default’, even though the data frame does not contain missing values. My code is below, and the data file is attached as ‘Eboni2.txt. library("nlme") str(Eboni2) head(Eboni2) model1 <- lme(preDawn ~ Irrigation, random=~season_order|treeNo, data=Eboni2) I am genuinely confused. Hope someone can help. Best regards, James F. Henson number LocationSeason season_orderMonth treeID treeNo preDawn midday Irrigation PnetGs E WUE d15Nd13CNper Cperinclude2 1 UCC November5 Nov UCCLO 1 60 1.4 1.3 N 9 0.290700373 3.766207481 2.38967185 no 2 UCC November5 Nov UCCLO 2 72 1.2 1.3 N 11 0.326258186 3.120573618 3.524992949 no 3 UCC November5 Nov UCCLO 3 78 1.1 1.2 N 8 0.287095701 1.693820753 4.723049937 3 -27.44 2.1252.12 yes 4 UCC November5 Nov UCCLO 4 79 1.1 2.1 N 10 0.247517983 1.83934285 5.436724317 3.61-29.5 1.4251.97 yes 5 UCC November5 Nov UCCLO 5 80 1.4 1.3 N 13 0.300922817 3.082277827 4.217660032 no 6 UCC November5 Nov UCCLO 6 81 0.6 1.8 N 17 0.348733689 2.534550345 6.70730413 2.79-30.5 1.4949.94 yes 7 UCC November5 Nov UCCLO 7 82 0.9 1.2 N 12 0.272690759 1.809851748 6.630377328 2.43-29.4 1.5553.12 yes 8 UCC November5 Nov UCCLO 8 83 1.4 1.1 N 11 0.269862804 1.919849835 5.729614785 2.85-28.37 1.7853.52 yes 9 UCC November5 Nov UCCLO 9 84 0.8 1 N 16 0.32333 2.394825767 6.68107059 2.43-30.1 1.5452.88 yes 10 UCC November5 Nov UCCLO 1062 0.9 1.2 N 17 0.29488545 1.429058721 11.89594224 1.51 -31.96 1.6152.94 yes 11 UCC November5 Nov UCCLO 1163 1.3 2 N 14 0.241601092 3.29815495 4.244797535 no 12 UCC November5 Nov UCCLO 1264 1.2 1.3 N 11 0.261040739 1.610353496 6.83079835 2.62 -28.94 1.4651.9yes 13 UCC November5 Nov UCCLO 1365 1.2 1.3 N 13 0.238863129 2.221057396 5.853068012 1.13 -28.81 2.0851.43 yes 14 UCC November5 Nov UCCLO 1466 1.1 1.5 N 9 0.309603194 2.859756011 3.14712163 no 15 UCC November5 Nov UCCLO 1567 1.1 1.3 N 18 0.383441504 2.949059627 6.103640576 1.51 -30.14 1.6552.04 yes 16 UCC November5 Nov UCCLO 1668 1.3 2.7 N 13 0.269711187 1.430856375 9.085468137 1.99 -29.09 1.8751.21 yes 17 UCC November5 Nov UCCLO 1769 0.8 1.4 N 13 0.245685997 3.808576972 3.41334837 no 18 UCC November5 Nov UCCLO 1870 1.6 1.8 N 11 0.271419599 2.305398713 4.771408926 2.94 -29.22 1.9351.46 yes 19 UCC November5 Nov UCCLO 1971 1 1.5 N 18 0.338103566 2.303586185 7.813903435 2.93 -30.27 1.9251.51 yes 20 UCC November5 Nov UCCLO 2073 1.1 1.2 N 11 0.27096196 3.230604699 3.404935307 no 21 UCC November5 Nov UCCLO 2174 1.2 1.5 N 10 0.294348983 3.319661403 3.012355414 no 22 UCC November5 Nov UCCLO 2275 1.5 1.9 N 12 0.230438536 2.935053987 4.088510825 1.74 -29.49 1.6450.28 yes 23 UCC November5 Nov UCCLO 2376 1.1 1.4 N 14 0.264963659 3.689609021 3.794439985
Re: [R] ggplot2
Thanks, the stat="identity" worked. On Tue, Apr 12, 2016 at 3:34 PM, Huzefa Khalil <huzefa.kha...@umich.edu> wrote: > Hi James, > > If you want to specify the y-values, you need to use stat="identity" as > below: > > ggplot(probability, aes(x=Fertilizer, y=prob)) + > geom_bar(stat="identity", aes(fill=Treatment)) > > > best, > huzefa > > On Tue, Apr 12, 2016 at 1:02 PM, James Henson <jfhens...@gmail.com> wrote: > > Dear R Community, > > > > Below is a problem with a simple ggplot2 graph. The code returns the > error > > message below. > > > > Error: stat_count() must not be used with a y aesthetic. > > > > My code is below and the data is attached as a ‘text’ file. > > > > > > > > # Graph of the probabilities > > > > library(digest) > > > > library(DT) > > > > datatable(probability) > > > > str(probability) > > > > probability$Fertilizer <- as.factor(probability$Fertilizer) > > > > str(probability) > > > > library(ggplot2) > > > > plot1 <- ggplot(probability, aes(x=Fertilizer, y=prob)) + > > geom_bar(aes(fill=Treatment)) > > > > plot1 > > > > > > > > Thanks. > > > > Best regards, > > > > James F. Henson > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] ggplot2
Dear R Community, Below is a problem with a simple ggplot2 graph. The code returns the error message below. Error: stat_count() must not be used with a y aesthetic. My code is below and the data is attached as a ‘text’ file. # Graph of the probabilities library(digest) library(DT) datatable(probability) str(probability) probability$Fertilizer <- as.factor(probability$Fertilizer) str(probability) library(ggplot2) plot1 <- ggplot(probability, aes(x=Fertilizer, y=prob)) + geom_bar(aes(fill=Treatment)) plot1 Thanks. Best regards, James F. Henson Trt probLL UL Fertilizer Treatment S0 0. 0.0154 0.4998 0 S S2 0. 0.0154 0.4998 2 S S4 0. 0.0154 0.4998 4 S S6 0. 0.0154 0.4998 6 S P0 0. 0.056 0.579 0 P P2 0.7778 0.4208 0.9439 2 P P3 0.333 0. 0.6665 4 P P4 0.6667 0.3334 0. 6 P __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Re: [R] installing packages
To All, Thanks for your help. I uninstalled R, the 3.2 library and R Studio. Reinstalled R and R Studio. Now the temp files move the newly installed packages into the R-.23.2.4revised library. > .libPaths() [1] "C:/Users/james_henson/Desktop/Documents/R/win-library/3.2" [2] "C:/Program Files/R/R-3.2.4revised/library" On Mon, Mar 21, 2016 at 9:57 PM, Jeff Newmiller <jdnew...@dcn.davis.ca.us> wrote: > I hope not. That directory is not for working in. suggestion to restart R > sounds most likely to fix the issue. > -- > Sent from my phone. Please excuse my brevity. > > On March 21, 2016 2:10:01 PM PDT, KMNanus <kmna...@gmail.com> wrote: >> >> Have you set your working directory to the “3.2” folder? >> Ken >> kmna...@gmail.com >> 914-450-0816 (tel) >> 347-730-4813 (fax) >> >> >> >> On Mar 21, 2016, at 5:07 PM, James Henson <jfhens...@gmail.com> wrote: >>> >>> Dear R community, >>> >>> When I install or update a package, R prints the waring below. I go to the >>> ‘downloaded_packages’ folder in the Temp file and manually move the new or >>> updated package to the folder ‘3.2’. How can I instruct R to download new >>> and updates packages into the ‘3.2’ folder? >>> >>> Warning in install.packages : >>> >>> unable to move temporary installation >>> >>> ‘C:\Users\james_henson\Desktop\Documents\R\win-library\3.2\file1c5c6f1731c8\nlme’ >>> to ‘C:\Users\james_henson\Desktop\Documents\R\win-library\3.2\nlme >>> >>> >>> >>> The downloaded binary packages are in >>> >>> >>> C:\Users\james_henson\AppData\Local\Temp\RtmpIZmUa3\downloaded_packages >>> >>> >>> >>> Thank for your help. >>> >>> James F. Henson >>> >>> [[alternative HTML version deleted]] >>> >>> -- >>> >>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >>> 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. >>> >> >> -- >> >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. >> >> [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] installing packages
Dear R community, When I install or update a package, R prints the waring below. I go to the ‘downloaded_packages’ folder in the Temp file and manually move the new or updated package to the folder ‘3.2’. How can I instruct R to download new and updates packages into the ‘3.2’ folder? Warning in install.packages : unable to move temporary installation ‘C:\Users\james_henson\Desktop\Documents\R\win-library\3.2\file1c5c6f1731c8\nlme’ to ‘C:\Users\james_henson\Desktop\Documents\R\win-library\3.2\nlme The downloaded binary packages are in C:\Users\james_henson\AppData\Local\Temp\RtmpIZmUa3\downloaded_packages Thank for your help. James F. Henson [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] package broom
Dear R community My version is R version 3.2.3. The package "broom" appears to install, but it will not load. The error message is below. > library(broom) Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘mnormt’ Error: package or namespace load failed for ‘broom’ Thanks, James F. Henson [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] contrasts among simple effects
Greetings R Community My goal is to make orthogonal contrasts among simple effects in analysis of repeated measures data. The SAS publication, on page 1224, shows how to make this type of contrasts in SAS. But, my search of books about repeated measures analysis using R, and on-line has not yielded a methodology. Hopefully, someone can direct me to a book or publication that will show me a methodology. Statistical Analysis of Repeated Measures Data Using SAS Procedures http://cslras.pbworks.com/f/littell_j_anim_sci_76_4_analysis_of_repeated_measures_using_sas.pdf Attached is a csv data file (file name = heartRate.csv). My code for the repeated measures analysis is below. library("nlme") # with AR1 variance/covariance structure, with ordered statement heartRate$time <- factor(heartRate$time) model2a <- lme(HR ~ drug*ordered(time), random =~1|person, correlation =corAR1(, form=~1|person), data = heartRate) summary(model2a) anova(model2a) Making a new variable ‘simple’ that merges the variables drug and time will enable me to make orthogonal contrasts among the simple effects. But, when using the variable ‘simple’ as the independent variable, the data will no longer be fitted to the AR1 variance/co-variance structure. Thanks. Best regards, James F.Henson __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] contrasts among simple effects - 2
Greetings R Community Apologize for previously sending a csv file. My goal is to make orthogonal contrasts among simple effects in analysis of repeated measures data. The SAS publication, on page 1224, shows how to make this type of contrasts in SAS. But, my search of books about repeated measures analysis using R, and on-line has not yielded a methodology. Hopefully, someone can direct me to a book or publication that will show me a methodology. Statistical Analysis of Repeated Measures Data Using SAS Procedures http://cslras.pbworks.com/f/littell_j_anim_sci_76_4_analysis_of_repeated_measures_using_sas.pdf Attached is a txt data file (file name = heart_rate.txt). My code for the repeated measures analysis is below. library("nlme") # with AR1 variance/covariance structure, with ordered statement heartRate$time <- factor(heartRate$time) model2a <- lme(HR ~ drug*ordered(time), random =~1|person, correlation =corAR1(, form=~1|person), data = heartRate) summary(model2a) anova(model2a) Making a new variable ‘simple’ that merges the variables drug and time will enable me to make orthogonal contrasts among the simple effects. But, when using the variable ‘simple’ as the independent variable, the data will no longer be fitted to the AR1 variance/covariance structure. Thanks. Best regards, James F.Henson drugperson timeHR a 1 1 72 a 4 1 78 a 7 1 71 a 10 1 72 a 13 1 66 a 16 1 74 a 19 1 62 a 22 1 69 b 2 1 85 b 5 1 82 b 8 1 71 b 11 1 83 b 14 1 86 b 17 1 85 b 20 1 79 b 23 1 83 c 3 1 69 c 6 1 66 c 9 1 84 c 12 1 80 c 15 1 72 c 18 1 65 c 21 1 75 c 24 1 71 a 1 2 86 a 4 2 83 a 7 2 82 a 10 2 83 a 13 2 79 a 16 2 83 a 19 2 73 a 22 2 75 b 2 2 86 b 5 2 86 b 8 2 78 b 11 2 88 b 14 2 85 b 17 2 82 b 20 2 83 b 23 2 84 c 3 2 73 c 6 2 62 c 9 2 90 c 12 2 81 c 15 2 72 c 18 2 62 c 21 2 69 c 24 2 70 a 1 3 81 a 4 3 88 a 7 3 81 a 10 3 83 a 13 3 77 a 16 3 84 a 19 3 78 a 22 3 76 b 2 3 83 b 5 3 80 b 8 3 70 b 11 3 79 b 14 3 76 b 17 3 83 b 20 3 80 b 23 3 78 c 3 3 72 c 6 3 67 c 9 3 88 c 12 3 77 c 15 3 69 c 18 3 65 c 21 3 69 c 24 3 65 a 1 4 77 a 4 4 81 a 7 4 75 a 10 4 69 a 13 4 66 a 16 4 77 a 19 4 70 a 22 4 70 b 2 4 80 b 5 4 84 b 8 4 75 b 11 4 81 b 14 4 76 b 17 4 80 b 20 4 81 b 23 4 81 c 3 4 74 c 6 4 73 c 9 4 87 c 12 4 72 c 15 4 70 c 18 4 61 c 21 4 68 c 24 4 63 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Re: [R] [FORGED] Re: Dunnett Test in 'multicomp' package
Thanks. A useful tip for a long-time SAS user. James F. Henson On Fri, Jun 5, 2015 at 3:47 AM, Gerrit Eichner gerrit.eich...@math.uni-giessen.de wrote: Hello, everyone, aside from Rolf's hint (and Richard's warning!) you could also consider relevel(): viagraData$dose - relevel( viagraData$dose, ref = placebo) Hth -- Gerrit On Fri, 5 Jun 2015, Rolf Turner wrote: On 05/06/15 11:08, Jim Lemon wrote: Hi James, You can change the order of levels like this: levels(viagraData$dose)-c(placebo,low dose,high dose) SNIP As Richard Heiberger has pointed out, this is wrong. What *does* work is: viagraData$dose)-factor(viagraData$dose, levels=c(placebo,low dose,high dose) This is a trap into which many a Young Player (including my very good self) has fallen. cheers, Rolf Turner -- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.