Re: [R] The Origins of R
Rolf Turner wrote: The postings exuded a tabloid-esque level of slimy nastiness. utterly self-ironic. vQ __ R-help@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.
Re: [R] need help converting data.frame to time series
Without the code we can't tell what the problem is but try this noting that ts is not normally used for daily data. Using zoo package L is a list of time series and z merges them into a multivariate series. Read the 3 zoo vignettes (pdf documents) that come with zoo: Lines - DATE ,STOCK ,RETURN-a ,RETURN-b 2009/02/02,A ,0.01 ,0.011 2009/01/30,A ,0.01 ,0.011 2009/01/29,A ,0.01 ,0.011 2009/01/28,A ,0.01 ,0.011 2009/02/02,B ,0.01 ,0.011 2009/01/30,B ,0.01 ,0.011 2009/01/29,B ,0.01 ,0.011 2009/02/02,C ,0.01 ,0.011 2009/01/30,C ,0.01 ,0.011 2009/01/29,C ,0.01 ,0.011 library(zoo) # DF - read.csv(myfile.csv) DF - read.csv(textConnection(Lines)) f - function(x) zoo(as.matrix(x[3:4]), as.Date(x$DATE, %Y/%m/%d)) L - lapply(split(DF, DF$STOCK), f) z - do.call(merge, L) On Wed, Feb 4, 2009 at 2:27 AM, Somani, Dinesh K dinesh.som...@gatech.edu wrote: Hi I am a new R user and need some help converting a data frame object to time series. 1. My input is a CSV file, contents something like these: DATE ,STOCK ,RETURN-A ,RETURN-B, etc. 2009/02/02,A ,0.01 ,0.011 2009/01/30,A ,0.01 ,0.011 2009/01/29,A ,0.01 ,0.011 2009/01/28,A ,0.01 ,0.011 2009/02/02,B ,0.01 ,0.011 2009/01/30,B ,0.01 ,0.011 2009/01/29,B ,0.01 ,0.011 2009/02/02,C ,0.01 ,0.011 2009/01/30,C ,0.01 ,0.011 2009/01/29,C ,0.01 ,0.011 and so on, going down a few years. Notice that there are gaps in observation dates (weekends), and also that some stocks do not have all the dates because there was no data that day (may be the stock is newly listed, or de-listed, or something else.) 2. I have this loaded into a data.frame object using read.table(). Factor the STOCK names. Then split the big table into N smaller data.frames one per STOCK name. The mode() for DATE and STOCK print as numeric. (That somehow did not feel right, esp. STOCK). I have converted the DATE - as.Date(DATE,%Y/%m/%d) 3. I am now trying to create time series objects to perform my main work which is single-stock and pairwise analysis. When I try to create from the data.frame a ts object, two strange things happen - one, the DATE shows going from 1 onwards, and STOCK is fixed to 1 (2 for Stock B, 3 for C, etc.). I will greatly appreciate your help in resolving these issues, namely - why am I losing DATE and STOCK - how can I get a proper time series out of it Thanks a lot Dinesh. __ R-help@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. __ R-help@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.
[R] chi squared goodness of fit test with R
Dear R users, I am a master student in Mathematics and I am writing my thesis in statistics. I need to use R and unfortunately I do not have any experience with a computer program. Could you please help me about chi squared goodness of fit test with R? In R-help website I saw a message about how to do that but I do not know how to cut the data into bins and calculate the expected numbers in each bin. Moreover I have to count the observed data in each bin and I do not know how to do that either. I really need help as its an essential part of my study. I appreciate if you could help. Thank you in advance, regards, Evrim Akar [[alternative HTML version deleted]] __ R-help@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.
Re: [R] overlaying plots from a list of data frames
Create a zoo object z and plot it: library(zoo) f - function(x) zoo(x$data, levels(x$year)[x$year]) z - do.call(merge, lapply(foo, f)) plot(z, screen = 1, col = 1:6, pch = 1:6, type = o, ylab = data, xlab = year) legend(topright, legend = 1:6, lty = 1, pch = 1:6, col = 1:6) See ?plot.zoo and the 3 zoo vignettes (pdf documents) in zoo package. On Tue, Feb 3, 2009 at 4:54 PM, Timothy W. Hilton twh...@psu.edu wrote: Hello R list, I have a list of data frames, in the form (dump output for an example list follows message): $site1 yeardata 1 2000 0.03685042 2 2001 0.02583885 6 2005 0.02480015 7 2006 0.03458745 $site2 year data 1 2002 4.071134e-03 2 2003 -4.513524e-08 3 2004 8.336272e-08 4 2005 2.270803e-08 5 2006 1.263597e-02 6 2007 NaN I would like to plot each site's data on a single plot, using a different color and marker for each site. I can't figure out an elegant way to do this; right now I am calling plot on site1, then points on site2 ... siteN. This leads to recycling the list of plot parameters (color, pch, etc.). The following code allows me to use do.call(FUN, lapply(list.of.sites, etc. if (dev.cur() 1) FUN - points else FUN - plot Now I would like to include several panels in one figure (there are actually several columns of data in the data frame). I set up the window with the panels, but that messes up the dev.cur() test I am doing. I would be most grateful for any suggestions of a more elegant setup, or for a different condition to decide whether points or plot should be called. Something like axis.already.exists(), but I can't figure out what that test should be. Many, many thanks. -Tim -- Timothy W. Hilton PhD Candidate, Department of Meteorology and Atmospheric Science The Pennsylvania State University 415 Walker Building, University Park, PA 16802 hil...@meteo.psu.edu example list of data frames: foo - structure(list(site1 = structure(list(year = structure(1:8, .Label = c(2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007), class = c(ordered, factor)), data = c(0.0368504167319695, 0.0258388514332078, 0.0432316303304793, 0.0104757403348321, -0.00942333944266443, 0.0248001501763526, 0.03458745330367, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -8L)), site2 = structure(list( year = structure(1:6, .Label = c(2002, 2003, 2004, 2005, 2006, 2007), class = c(ordered, factor)), data = c(0.00407113433104158, -4.51352402858745e-08, 8.33627186959167e-08, 2.27080257687498e-08, 0.0126359731744113, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -6L)), site3 = structure(list( year = structure(1:7, .Label = c(2000, 2001, 2002, 2003, 2004, 2005, 2006), class = c(ordered, factor )), data = c(0.0297773868339168, 0.0212836833675155, 0.030149087973, 0.000944393402486824, -2.70247618264114e-09, -2.84624718656657e-07, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -7L)), site4 = structure(list(year = structure(1:5, .Label = c(2000, 2001, 2002, 2003, 2004), class = c(ordered, factor )), data = c(0.000418478048104973, 0.00530609034999336, 0.020077837088374, 0.0326921217142046, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -5L)), site5 = structure(list(year = structure(1:5, .Label = c(2000, 2001, 2003, 2004, 2005), class = c(ordered, factor )), data = c(0.00618165243153993, 0.00303216804813299, -5.51581146266983e-08, 1.44109415817357e-09, 0.0336487468345765)), .Names = c(year, data), class = data.frame, row.names = c(NA, -5L)), site6 = structure(list( year = structure(1:6, .Label = c(2001, 2002, 2003, 2004, 2005, 2006), class = c(ordered, factor)), data = c(-6.33889022834333e-10, 1.34668283090261e-08, 4.17885398551684e-08, 0.00202872966966414, -3.82189201782033e-09, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -6L))), .Names = c(site1, site2, site3, site4, site5, site6)) __ R-help@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. __ R-help@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.
[R] chi squared goodness of fit test with R
Dear R users, I am a master student in Mathematics and I am writing my thesis in statistics. I need to use R and unfortunately I do not have any experience with a computer program. Could you please help me about chi squared goodness of fit test with R? In R-help website I saw a message about how to do that but I do not know how to cut the data into bins and calculate the expected numbers in each bin. Moreover I have to count the observed data in each bin and I do not know how to do that either. I really need help as its an essential part of my study. I appreciate if you could help. Thank you in advance, regards, [[alternative HTML version deleted]] __ R-help@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.
[R] Problem in clustering a large data
Dear all, Can anyone help me? I'm having some programming command problems with R. I applied R in my task to cluster a group of 839 protein spot data. The data obtained from 6 different cell lines. Unfortunately, the dendogram doesn't clearly stated the clusters due to abundance of data. I hope to partition out the group of protein data consisting 839 data with similar characteristics first before I carry out cluster analysis. I had already tried out several methods but I still didn't manage to get a solution. Could anyone help me to solve my problem by providing me the programming command and alternative approach?? I'm running out of ideas.. Thank you. _ [[alternative HTML version deleted]] __ R-help@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.
[R] Using color and plotting characters in a scatterplot matrix [Newbie Help]
Hello guys, I have this data set that I imported into R using a line: This data set consists of 7 columns. The two important columns are the first one called 'thrust' and the last one called 'amtemp'. jet-read.table(jetthrust.txt, fill=T, head=T) I am making a scatterplot matrix simply using the line pairs(jet) The problem is that in the last column of this file which has a header name 'amtemp' I want to sort out the values. I want values: Under 90: To be called low values In between 90 and 100: To be called medium values Larger than 100: To be called high values Then I want those groups of values to be in different colors and different characters on the scatterplot! I tried many ways, And I think I am stuck. I first tried it on a normal plot using the line. plot(thrust~amtemp,jet, subset=(jet$amtemp90), col=1, pch=11) plot(thrust~amtemp,jet, subset=(jet$amtemp100), col=2, pch=12) plot(thrust~amtemp,jet, subset=(jet$amtemp100), col=3, pch=13) It didnt work because it just took the last plot and overwrite it over the last one :( Someone help please. Thanks in advance. -- View this message in context: http://www.nabble.com/Using-color-and-plotting-characters-in-a-scatterplot-matrix--Newbie-Help--tp21824880p21824880.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Using color and plotting characters in a scatterplot matrix [Newbie Help]
I figured out how to do the rest, the only thing I need to do now is to somehow change the numbers which are 90 to a character string low . The values which are between 100 - 90 to convert to character string medium. And the values larger than 100 to convert to character string high. Then I would use this line. plot(thrust~amtemp, jet, col=as.numeric(jet$amtemp), pch=as.numeric(jet$amtemp)) The thing is that I dont know how to convert those numerical values into low medium and high Hmm, but then when I think about it better if its changed to the strings above, it wont remember the exact numerical value. Basically what I want to do is make a scatterplot and then just change the color and the symbol of those 3 groups so they can be distinguished on the graph. -- View this message in context: http://www.nabble.com/Using-color-and-plotting-characters-in-a-scatterplot-matrix--Newbie-Help--tp21824880p21825882.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] overlaying plots from a list of data frames
Another option, library(ggplot2) qplot(year, value, data=melt(foo), color= L1) which can also be achieved by hand, test- do.call(rbind,foo) # combines all data.sets test$name - do.call(rep, list(x=names(foo), times = unlist(lapply(foo,nrow # append the name of the original dataset library(lattice) # or ggplot2, but there seem to be a problem with the line geom in this case xyplot (data ~year,data=test,groups=name,type=b,auto.key=list(space=right)) Hope this helps, baptiste On 4 Feb 2009, at 08:59, Gabor Grothendieck wrote: Create a zoo object z and plot it: library(zoo) f - function(x) zoo(x$data, levels(x$year)[x$year]) z - do.call(merge, lapply(foo, f)) plot(z, screen = 1, col = 1:6, pch = 1:6, type = o, ylab = data, xlab = year) legend(topright, legend = 1:6, lty = 1, pch = 1:6, col = 1:6) See ?plot.zoo and the 3 zoo vignettes (pdf documents) in zoo package. On Tue, Feb 3, 2009 at 4:54 PM, Timothy W. Hilton twh...@psu.edu wrote: Hello R list, I have a list of data frames, in the form (dump output for an example list follows message): $site1 yeardata 1 2000 0.03685042 2 2001 0.02583885 6 2005 0.02480015 7 2006 0.03458745 $site2 year data 1 2002 4.071134e-03 2 2003 -4.513524e-08 3 2004 8.336272e-08 4 2005 2.270803e-08 5 2006 1.263597e-02 6 2007 NaN I would like to plot each site's data on a single plot, using a different color and marker for each site. I can't figure out an elegant way to do this; right now I am calling plot on site1, then points on site2 ... siteN. This leads to recycling the list of plot parameters (color, pch, etc.). The following code allows me to use do.call(FUN, lapply(list.of.sites, etc. if (dev.cur() 1) FUN - points else FUN - plot Now I would like to include several panels in one figure (there are actually several columns of data in the data frame). I set up the window with the panels, but that messes up the dev.cur() test I am doing. I would be most grateful for any suggestions of a more elegant setup, or for a different condition to decide whether points or plot should be called. Something like axis.already.exists(), but I can't figure out what that test should be. Many, many thanks. -Tim -- Timothy W. Hilton PhD Candidate, Department of Meteorology and Atmospheric Science The Pennsylvania State University 415 Walker Building, University Park, PA 16802 hil...@meteo.psu.edu example list of data frames: foo - structure(list(site1 = structure(list(year = structure(1:8, .Label = c(2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007), class = c(ordered, factor)), data = c(0.0368504167319695, 0.0258388514332078, 0.0432316303304793, 0.0104757403348321, -0.00942333944266443, 0.0248001501763526, 0.03458745330367, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -8L)), site2 = structure(list( year = structure(1:6, .Label = c(2002, 2003, 2004, 2005, 2006, 2007), class = c(ordered, factor)), data = c(0.00407113433104158, -4.51352402858745e-08, 8.33627186959167e-08, 2.27080257687498e-08, 0.0126359731744113, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -6L)), site3 = structure(list( year = structure(1:7, .Label = c(2000, 2001, 2002, 2003, 2004, 2005, 2006), class = c(ordered, factor )), data = c(0.0297773868339168, 0.0212836833675155, 0.030149087973, 0.000944393402486824, -2.70247618264114e-09, -2.84624718656657e-07, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -7L)), site4 = structure(list(year = structure(1:5, .Label = c(2000, 2001, 2002, 2003, 2004), class = c(ordered, factor )), data = c(0.000418478048104973, 0.00530609034999336, 0.020077837088374, 0.0326921217142046, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -5L)), site5 = structure(list(year = structure(1:5, .Label = c(2000, 2001, 2003, 2004, 2005), class = c(ordered, factor )), data = c(0.00618165243153993, 0.00303216804813299, -5.51581146266983e-08, 1.44109415817357e-09, 0.0336487468345765)), .Names = c(year, data), class = data.frame, row.names = c(NA, -5L)), site6 = structure(list( year = structure(1:6, .Label = c(2001, 2002, 2003, 2004, 2005, 2006), class = c(ordered, factor)), data = c(-6.33889022834333e-10, 1.34668283090261e-08, 4.17885398551684e-08, 0.00202872966966414, -3.82189201782033e-09, NaN)), .Names = c(year, data), class = data.frame, row.names = c(NA, -6L))), .Names = c(site1, site2, site3, site4, site5, site6)) __ R-help@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. __ R-help@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,
Re: [R] Using color and plotting characters in a scatterplot matrix [Newbie Help]
First make a factor with the levels. jet$Classes - factor(ifelse(jet$amtemp 90, low, ifelse(jet$amtemp 100, medium, high))) Then make life easier and use ggplot install.packages(ggplot2) library(ggplot2) ggplot(jet, aes(x = amtemp, y = thrust, colour = Classes)) + geom_point() HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens pfc_ivan Verzonden: woensdag 4 februari 2009 8:59 Aan: r-help@r-project.org Onderwerp: Re: [R] Using color and plotting characters in a scatterplot matrix [Newbie Help] I figured out how to do the rest, the only thing I need to do now is to somehow change the numbers which are 90 to a character string low . The values which are between 100 - 90 to convert to character string medium. And the values larger than 100 to convert to character string high. Then I would use this line. plot(thrust~amtemp, jet, col=as.numeric(jet$amtemp), pch=as.numeric(jet$amtemp)) The thing is that I dont know how to convert those numerical values into low medium and high Hmm, but then when I think about it better if its changed to the strings above, it wont remember the exact numerical value. Basically what I want to do is make a scatterplot and then just change the color and the symbol of those 3 groups so they can be distinguished on the graph. -- View this message in context: http://www.nabble.com/Using-color-and-plotting-characters-in-a-scatterpl ot-matrix--Newbie-Help--tp21824880p21825882.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document. __ R-help@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.
Re: [R] The Origins of R
It seems to me that the other side from John's post here have complaints resulting from how newspapers operate. While few readers here are likely to have much direct experience with newspapers, a lot (I presume) have experience with submitting papers to journals. Such experience is likely to include demands to cut out large portions of the original in order to cut down on page count. The same process operates in newspapers, but to the third power (and generally under considerable time pressure). My reaction to the section of the original NYT article under discussion was that it was a disjointed mess due to editing rather than a slight to anyone anywhere. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) John Maindonald wrote: In another thread on this list, various wild allegations have been made, relating to the New York Times article on R. I object both to the subject line and to the content of several of the messages, and will not repeat or quote any of that content. It smacks to me of mischief making. Discussion has centered around the following quote from the NY Times article: “According to them, the notion of devising something like R sprang up during a hallway conversation. They both wanted technology better suited for their statistics students, who needed to analyze data and produce graphical models of the information. Most comparable software had been designed by computer scientists and proved hard to use.” The comment that the notion of devising something like R sprang up during a hallway conversation is strictly true. Certainly, this seems like a very plausible account. I'd have more difficulty believing that the notion was communicated to them in separate dreams. Part of the wanted technology was freedom for students to take the software home, or copy it down from the web. There was a further story to be told, about the origins of the language that Ross and Robert implemented and adapted. The NY writer pretty much left out that part of the story (S did get a mention, but its connection with R did not), but did remedy this omission in a follow-up. Nor did the article do much to acknowledge the workers and work that has gone into R's continuing development. Getting the attributions right is difficult. Even if right according to common conventions (and one can argue as to just what the conventions are, especially in the matter of computer language development), they are unlikely to be totally fair. Stigler's Law of Eponomy has wide sway! In the preface to the first and second edition of Data Analysis and Graphics Using R, we have: The R system implements a dialect of the S language that was developed at ATT Bell Laboratories by Rick Becker, John Chambers and Allan Wilks. The only 1st edition attribution to Ihaka and Gentleman was in Chapter 12: For citing R in a publication, use Ihaka and Gentleman (1996). [NB: Type citation() to see the form of citation that should now be used.] That was as it now strikes me unfair to Ross and Robert, but no-one complained. Perhaps no-one ever read that far through the preface! There's an excellent brief summary of the history of R, and its connections with S, in Section 1.4 of John Chambers' Software for Data Analysis.Appendix A has further details on the development of S, a kind of pre-history of R. John Maindonald email: john.maindon...@anu.edu.au phone : +61 2 (6125)3473fax : +61 2(6125)5549 Centre for Mathematics Its Applications, Room 1194, John Dedman Mathematical Sciences Building (Building 27) Australian National University, Canberra ACT 0200. __ R-help@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. __ R-help@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.
Re: [R] ANOVA in R
Dear Samor, Note that the R-Sig-mixed-models is more suitable for that kind of questions. You need to add +, : or * between the variables in the formula The correlation is lme() is not the same as the correlation in SAS. The correlation in lme() is the correlation among residuals, not among random effects. You need one of the pdClasses if you want to define the correlation among the random effects. Have a look at ?nlme::pdClasses Hence your code should probably look like this Model - lme(response ~ seq + period + treat*time, random = pdCompSymm(form = ~1|SUB)) anova(Model) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Samor Gandhi Verzonden: woensdag 4 februari 2009 7:43 Aan: r-help@r-project.org Onderwerp: [R] ANOVA in R Hi,I'm using a repeated measures ANOVA in R using lme(). The SAS code would be: PROC MIXED DATA=[data set below]; CLASS pid treat period time seq; MODEL Y = seq period treat time treat*time; REPEATED time / SUBJECT=pid TYPE=cs; RUN, I donot have SAS, instead I have R and I would like to try the following: anova(lme(response ~ seq period treat time treat*time,random= ~1|SUB, correlation=corCompSymm())) Is this correct? Can I also write the model as Y_ijklt = m + a_l + b_k + c_j + d_t + (cd)_jt + u_ijkltY_ijklt is the response variable due to pid i, treat j, period k, seq l, and time t. Thank you very much in advance for your help :) Samor [[alternative HTML version deleted]] Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document. __ R-help@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.
Re: [R] ANOVA in R
Thank you very much. Is the following model would be corresponding to the data? Y_ijklt = m + a_l + b_k + c_j + d_t + (cd)_jt + u_ijklt Cheers, Samor --- On Wed, 2/4/09, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: From: ONKELINX, Thierry thierry.onkel...@inbo.be Subject: RE: [R] ANOVA in R To: samorgan...@yahoo.com, r-help@r-project.org Cc: r-sig-mixed-mod...@r-project.org Date: Wednesday, February 4, 2009, 3:21 PM Dear Samor, Note that the R-Sig-mixed-models is more suitable for that kind of questions. You need to add +, : or * between the variables in the formula The correlation is lme() is not the same as the correlation in SAS. The correlation in lme() is the correlation among residuals, not among random effects. You need one of the pdClasses if you want to define the correlation among the random effects. Have a look at ?nlme::pdClasses Hence your code should probably look like this Model - lme(response ~ seq + period + treat*time, random = pdCompSymm(form = ~1|SUB)) anova(Model) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Samor Gandhi Verzonden: woensdag 4 februari 2009 7:43 Aan: r-help@r-project.org Onderwerp: [R] ANOVA in R Hi,I'm using a repeated measures ANOVA in R using lme(). The SAS code would be: PROC MIXED DATA=[data set below]; CLASS pid treat period time seq; MODEL Y = seq period treat time treat*time; REPEATED time / SUBJECT=pid TYPE=cs; RUN, I donot have SAS, instead I have R and I would like to try the following: anova(lme(response ~ seq period treat time treat*time,random= ~1|SUB, correlation=corCompSymm())) Is this correct? Can I also write the model as Y_ijklt = m + a_l + b_k + c_j + d_t + (cd)_jt + u_ijkltY_ijklt is the response variable due to pid i, treat j, period k, seq l, and time t. Thank you very much in advance for your help :) Samor [[alternative HTML version deleted]] Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document. [[alternative HTML version deleted]] __ R-help@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.
Re: [R] igraph: error when setting size and shape of vertices
Yep, this is a bug, thanks for reporting it. It only happens with the square shape, so until it is a corrected, a workaround is using rectangle shape, with equal vertical and horizontal sizes: g - graph.ring(4) g$layout - layout.circle V(g)$size - seq_len(vcount(g)) * 10 V(g)$size2 - V(g)$size plot(g, vertex.shape=square) # gives an error plot(g, vertex.shape=rectangle)# works I have tried this only on the not-yet-released 0.6 version, please tell me if it does not work on 0.5.1. Best, Gabor On Wed, Feb 4, 2009 at 11:26 AM, robbie.herem...@telenet.be wrote: When the shape of all vertices is set to square and the size of the vertices is also set, one get following error (commands attached): Error in l[[which.min(sapply(l, function(p) (p[1] - x0)^2 + (p[2] - y0)^2))]] : attempt to select less than one element Is there a way to solve this problem? Robbie ## Load the igraph package library(igraph) ## Create and plot a small graph g - graph( c(0,1, 0,2, 1,2, 2,3), n=4, directed = FALSE) plot(g) V(g)$size-c(10,15,20,30) plot(g) #OK V(g)$shape-c(circle,circle,circle,square) plot(g) #OK V(g)$shape-c(circle,circle,square,square) plot(g) #OK V(g)$shape-c(circle,square,square,square) plot(g) #OK V(g)$shape-c(square,square,square,square) plot(g) #Error in l[[which.min(sapply(l, function(p) (p[1] - x0)^2 + (p[2] - y0)^2))]] : #attempt to select less than one element V(g)$shape-c(square,square,circle,square) plot(g) #OK ## Same without changing size g - graph( c(0,1, 0,2, 1,2, 2,3), n=4, directed = FALSE) V(g)$shape-c(square,square,square,square) plot(g) #OK __ R-help@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. -- Gabor Csardi gabor.csa...@unil.ch UNIL DGM __ R-help@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.
Re: [R] Target Plot?
Jason Rupert wrote: I've done a little snooping around the R Gallery Site (http://addictedtor.free.fr/graphiques/) and the Statistics with R site (http://zoonek2.free.fr/UNIX/48_R/all.html), but I can't seem to find what I'm looking for. Here is the type of plot I would like to draw: (1) 2-D three axis plot where each axis is separated by 120-degrees (would be great if the number of axis was configurable) (2) Would like the value at the origin of the axis to be configurable, and then have each axis to be increasing equally out from the origin, e.g. have the origin have a value of 0.5 and each axis increase from there (3) Would then like to be able to lay concentrically increasing circles over the axis so that they intersect each axis (4) Data values would only lye on the axis. I would like to put together this plot to show how far each variable is from the target variable, so I'm thinking this would be a target plot where the value of the target would be configurable. (I guess normalization would have similar result, but I would like to show the actual values.) I guess the result would look kind of like a dart board or something similar. Thank you for any insights that can be provided, especially if something like this already exist. Hi Jason, Take a look at radial.plot in the plotrix package. Jim __ R-help@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.
Re: [R] loading lme4 fails - function 'cholmod_l_start' not providedby package 'Matrix'
On Wed, 4 Feb 2009, Megan Davies wrote: Thanks Prof, As you can see from my session information (below), I appear to be using the same version of Matrix as yourself. However, I also notice that you're using a patched version of 2.8.1 whereas I'm not. Could this be the difference? It should not, and I just checked the original 2.8.1 to be sure. sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Matrix_0.999375-20 lattice_0.17-20 But we don't have the lme4 version, so please re-check that. loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 Megan Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 Prof Brian Ripley rip...@stats.ox.ac.uk 04-02-2009 11:13 Did you update your version of Matrix? It should be 0.99375-20 (or perhaps -18). E.g. for me sessionInfo() R version 2.8.1 Patched (2009-02-04 r47838) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] lme4_0.999375-28 Matrix_0.999375-20 lattice_0.17-20 loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 worked. R 2.9.0 will check versions when loading a package, but 2.8.1 does not. On Wed, 4 Feb 2009, Megan Davies wrote: Hello UseRs, I've just tried to load the lme4 package and got the error message, function 'cholmod_l_start' not provided by package 'Matrix'. I downloaded the latest version of lme4 and its required packages (lattice and Matrix) as suggested in the archives and still got this message. The FAQ and archives suggested to check the R version and also the package version requirements. requirements, but I'm already using the latest available version of R, 2.8.1. I'm using Windows XP Professional. Thanks for any help, Megan Davies Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 ** Is this email SPAM? If so, please forward it as an attachment to s...@snh.gov.uk ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager or the sender. Please note that for business purposes, outgoing and incoming emails from and to SNH may be monitored. This Email has been scanned by eSecure Mail (powered by Evolution Systems, the digital security specialist) ** -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@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.
[R] igraph: error when setting size and shape of vertices
When the shape of all vertices is set to square and the size of the vertices is also set, one get following error (commands attached): Error in l[[which.min(sapply(l, function(p) (p[1] - x0)^2 + (p[2] - y0)^2))]] : attempt to select less than one element Is there a way to solve this problem? Robbie ## Load the igraph package library(igraph) ## Create and plot a small graph g - graph( c(0,1, 0,2, 1,2, 2,3), n=4, directed = FALSE) plot(g) V(g)$size-c(10,15,20,30) plot(g) #OK V(g)$shape-c(circle,circle,circle,square) plot(g) #OK V(g)$shape-c(circle,circle,square,square) plot(g) #OK V(g)$shape-c(circle,square,square,square) plot(g) #OK V(g)$shape-c(square,square,square,square) plot(g) #Error in l[[which.min(sapply(l, function(p) (p[1] - x0)^2 + (p[2] - y0)^2))]] : #attempt to select less than one element V(g)$shape-c(square,square,circle,square) plot(g) #OK ## Same without changing size g - graph( c(0,1, 0,2, 1,2, 2,3), n=4, directed = FALSE) V(g)$shape-c(square,square,square,square) plot(g) #OK __ R-help@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.
[R] odfweave sample code error
Hi R-team, I am new user of R 2.8.1 in windows 2003 environment. I use Tinn-R as code editor. When running the sample codes from odf manual the following error occured. I have winzip installed in my system. I used openoffice writer under windows to create the example1.odt file. can anybody help me out to fix the bug. the code executed is as follows: library(odfWeave) inFile - c:/example1.odt outFile - c:/out.odt imageDefs - getImageDefs() imageDefs$dispWidth - 4.5 imageDefs$dispHeight- 4.5 setImageDefs(imageDefs) odfWeave(inFile, outFile) Copying c:/example1.odt Setting wd to C:\DOCUME~1\Srinivas\LOCALS~1\Temp\RtmpAgBGhm/odfWeave04172603473 Unzipping ODF file using unzip -o example1.odt Error in odfWeave(inFile, outFile) : Error unzipping file In addition: Warning message: In system(zipCmd[2], invisible = TRUE) : unzip not found thanks in advance, warm regards, srinivas statistical analyst. [[alternative HTML version deleted]] __ R-help@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.
[R] help with binary outcome
conducted a training with 2 training groups and one control-group (TG: Training Groups 1-3 in my data). After that training I checked every week within 4 weeks (Zeit= 1-4 in my data), if the participants used the training skills (FLEXPV). unfortunately I didnt use any real scale for this item, so it´s only binary coded 0/1 0=not put in practice 1=put in practice. I´m interessted if there are any variances in the slopes of the persons within the training groups. First I tried do do it with the nlme-package function: model.1=gls(FLEXPV~ZEIT,data=data,na.action=na.omit) model.2=lme(FLEXPV~ZEIT,random=~1|ID,data=data,na.action=na.omit) model.3=lme(FLEXPV~ZEIT,random=~1+ZEIT|ID,data=data,na.action=na.omit) anova(model.2, model.3) Then I was wondering if this is the right function for my binary datas. Therefore I tried the following thing with the MASS package mod.2-glmmPQL(FLEXPV~ZEIT+TG,random=~1|ID, family=binomial,data=data,na.action=na.omit) mod.3-glmmPQL(FLEXPV~ZEIT*TG,random=~1|ID, family=binomial,data=data,na.action=na.omit) But I couldn´t compare mod.2 vs. mod.3 with the anova. And how can I build a level-1 model ?? I do attache the text belwo, so that you can get an impression of my data. I really appriciate your help and thank you in advance for helping me. Regards Markus Eichel data ID TG X ZEIT X.1 FLEXPV 1 1 1 NA 0 NA 0 2 1 1 NA 1 NA 1 3 1 1 NA 2 NA 1 4 1 1 NA 3 NA 1 5 2 1 NA 0 NA 0 6 2 1 NA 1 NA 0 7 2 1 NA 2 NA 0 8 2 1 NA 3 NA 0 9 3 1 NA 0 NA 0 10 3 1 NA 1 NA 1 11 3 1 NA 2 NA 1 12 3 1 NA 3 NA 1 13 4 1 NA 0 NA 0 14 4 1 NA 1 NA 0 15 4 1 NA 2 NA 0 16 4 1 NA 3 NA 0 17 5 1 NA 0 NA 0 18 5 1 NA 1 NA 1 19 5 1 NA 2 NA 0 20 5 1 NA 3 NA 0 21 6 1 NA 0 NA 0 22 6 1 NA 1 NA 0 23 6 1 NA 2 NA 0 24 6 1 NA 3 NA 0 25 7 1 NA 0 NA 0 26 7 1 NA 1 NA 0 27 7 1 NA 2 NA 0 28 7 1 NA 3 NA 0 29 8 1 NA 0 NA 0 30 8 1 NA 1 NA 0 31 8 1 NA 2 NA 1 32 8 1 NA 3 NA 0 33 9 1 NA 0 NA 0 34 9 1 NA 1 NA 1 35 9 1 NA 2 NA 1 36 9 1 NA 3 NA 0 37 10 1 NA 0 NA 0 38 10 1 NA 1 NA 0 39 10 1 NA 2 NA 1 40 10 1 NA 3 NA 1 41 11 1 NA 0 NA 0 42 11 1 NA 1 NA 1 43 11 1 NA 2 NA 1 44 11 1 NA 3 NA 1 45 12 1 NA 0 NA 1 46 12 1 NA 1 NA 0 47 12 1 NA 2 NA 0 48 12 1 NA 3 NA 0 49 13 1 NA 0 NA 0 50 13 1 NA 1 NA 1 51 13 1 NA 2 NA 1 52 13 1 NA 3 NA 1 53 14 2 NA 0 NA 0 54 14 2 NA 1 NA 0 55 14 2 NA 2 NA 0 56 14 2 NA 3 NA 0 57 15 2 NA 0 NA 0 58 15 2 NA 1 NA 0 59 15 2 NA 2 NA 0 60 15 2 NA 3 NA 0 61 16 2 NA 0 NA 0 62 16 2 NA 1 NA 1 63 16 2 NA 2 NA 0 64 16 2 NA 3 NA 0 65 17 2 NA 0 NA 0 66 17 2 NA 1 NA 0 67 17 2 NA 2 NA 0 68 17 2 NA 3 NA 0 69 18 2 NA 0 NA 0 70 18 2 NA 1 NA 1 71 18 2 NA 2 NA 0 72 18 2 NA 3 NA 0 73 19 2 NA 0 NA 1 74 19 2 NA 1 NA 1 75 19 2 NA 2 NA 0 76 19 2 NA 3 NA 1 77 20 2 NA 0 NA 1 78 20 2 NA 1 NA 0 79 20 2 NA 2 NA 1 80 20 2 NA 3 NA 0 81 21 2 NA 0 NA 0 82 21 2 NA 1 NA 0 83 21 2 NA 2 NA 0 84 21 2 NA 3 NA 0 85 22 2 NA 0 NA 0 86 22 2 NA 1 NA 1 87 22 2 NA 2 NA 0 88 22 2 NA 3 NA 0 89 23 2 NA 0 NA 0 90 23 2 NA 1 NA 0 91 23 2 NA 2 NA 0 92 23 2 NA 3 NA 0 93 24 2 NA 0 NA 1 94 24 2 NA 1 NA 1 95 24 2 NA 2 NA 1 96 24 2 NA 3 NA 1 97 25 2 NA 0 NA 0 98 25 2 NA 1 NA 0 99 25 2 NA 2 NA 0 100 25 2 NA 3 NA 1 101 26 2 NA 0 NA 0 102 26 2 NA 1 NA 0 103 26 2 NA 2 NA 0 104 26 2 NA 3 NA 0 105 27 3 NA 0 NA 0 106 27 3 NA 1 NA 0 107 27 3 NA 2 NA 0 108 27 3 NA 3 NA 0 109 28 3 NA 0 NA 1 110 28 3 NA 1 NA 0 111 28 3 NA 2 NA 0 112 28 3 NA 3 NA 0 113 29 3 NA 0 NA 1 114 29 3 NA 1 NA 1 115 29 3 NA 2 NA 1 116 29 3 NA 3 NA 1 117 30 3 NA 0 NA 1 118 30 3 NA 1 NA 1 119 30 3 NA 2 NA 1 120 30 3 NA 3 NA 1 121 31 3 NA 0 NA 1 122 31 3 NA 1 NA 1 123 31 3 NA 2 NA 0 124 31 3 NA 3 NA 0 125 32 3 NA 0 NA 1 126 32 3 NA 1 NA 0 127 32 3 NA 2 NA 1 128 32 3 NA 3 NA 1 129 33 3 NA 0 NA 0 130 33 3 NA 1 NA 1 131 33 3 NA 2 NA 1 132 33 3 NA 3 NA 1 133 34 3 NA 0 NA 0 134 34 3 NA 1 NA 1 135 34 3 NA 2 NA 1 136 34 3 NA 3 NA 1 137 35 3 NA 0 NA 1 138 35 3 NA 1 NA 0 139 35 3 NA 2 NA 0 140 35 3 NA 3 NA 1 141 36 3 NA 0 NA 1 142 36 3 NA 1 NA 1 143 36 3 NA 2 NA 0 144 36 3 NA 3 NA 0 145 37 3 NA 0 NA 1 146 37 3 NA 1 NA 1 147 37 3 NA 2 NA 0 148 37 3 NA 3 NA 1 149 38 3 NA 0 NA 1 150 38 3 NA 1 NA 0 151 38 3 NA 2 NA 0 152 38 3 NA 3 NA 0 Deutschlands größte Online-Videothek schenkt Ihnen 12.000 Videos!* *http://entertainment.web.de/de/entertainment/maxdome/index.html* [http://entertainment.web.de/de/entertainment/maxdome/index.html] [[alternative HTML version deleted]] __ R-help@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.
Re: [R] loading lme4 fails - function 'cholmod_l_start'not providedbypackage 'Matrix'
Megan, Try to uninstall both packages, remove them from the harddrive and then reinstall them. That worked for me when I had a similar problem (lme4 complaining about Matrix). HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Megan Davies Verzonden: woensdag 4 februari 2009 12:49 Aan: Prof Brian Ripley CC: r-help@r-project.org Onderwerp: Re: [R] loading lme4 fails - function 'cholmod_l_start'not providedbypackage 'Matrix' Thanks again Prof, I downloaded the latest lme4 today. In the description file, it says, Version: 0.999375-28. I've just checked this against the version available on CRAN and its the same. Megan Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 Prof Brian Ripley rip...@stats.ox.ac.uk 04-02-2009 11:42 On Wed, 4 Feb 2009, Megan Davies wrote: Thanks Prof, As you can see from my session information (below), I appear to be using the same version of Matrix as yourself. However, I also notice that you're using a patched version of 2.8.1 whereas I'm not. Could this be the difference? It should not, and I just checked the original 2.8.1 to be sure. sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Matrix_0.999375-20 lattice_0.17-20 But we don't have the lme4 version, so please re-check that. loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 Megan Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 Prof Brian Ripley rip...@stats.ox.ac.uk 04-02-2009 11:13 Did you update your version of Matrix? It should be 0.99375-20 (or perhaps -18). E.g. for me sessionInfo() R version 2.8.1 Patched (2009-02-04 r47838) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] lme4_0.999375-28 Matrix_0.999375-20 lattice_0.17-20 loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 worked. R 2.9.0 will check versions when loading a package, but 2.8.1 does not. On Wed, 4 Feb 2009, Megan Davies wrote: Hello UseRs, I've just tried to load the lme4 package and got the error message, function 'cholmod_l_start' not provided by package 'Matrix'. I downloaded the latest version of lme4 and its required packages (lattice and Matrix) as suggested in the archives and still got this message. The FAQ and archives suggested to check the R version and also the package version requirements. requirements, but I'm already using the latest available version of R, 2.8.1. I'm using Windows XP Professional. Thanks for any help, Megan Davies Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 ** Is this email SPAM? If so, please forward it as an attachment to s...@snh.gov.uk ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager or the sender. Please note that for business purposes, outgoing and incoming emails from and to SNH may
[R] Overlaid plots - lines
Dear all, I have a question concerning two overlaid (scatter)plots: Has anyone an idea how I can join the first point of the first plot with the first point of the second plot, the second point of the first plot with the second point of the second plot,... and so on. Is it possible? :-/ Using lines(x,y) I can only join the points of one plot... Thank you in advance, GSt -- View this message in context: http://www.nabble.com/Overlaid-plots---lines-tp21828330p21828330.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] loading lme4 fails - function 'cholmod_l_start' not provided by package 'Matrix'
Did you update your version of Matrix? It should be 0.99375-20 (or perhaps -18). E.g. for me sessionInfo() R version 2.8.1 Patched (2009-02-04 r47838) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] lme4_0.999375-28 Matrix_0.999375-20 lattice_0.17-20 loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 worked. R 2.9.0 will check versions when loading a package, but 2.8.1 does not. On Wed, 4 Feb 2009, Megan Davies wrote: Hello UseRs, I've just tried to load the lme4 package and got the error message, function 'cholmod_l_start' not provided by package 'Matrix'. I downloaded the latest version of lme4 and its required packages (lattice and Matrix) as suggested in the archives and still got this message. The FAQ and archives suggested to check the R version and also the package version requirements. requirements, but I'm already using the latest available version of R, 2.8.1. I'm using Windows XP Professional. Thanks for any help, Megan Davies Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@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.
[R] D'Hondt method
Is there a R function to calculate the seats in parliament given the total number of seats and the votes for each party -- for different methods including the method of D'Hont? http://en.wikipedia.org/wiki/D%27Hondt_method Thanks, thomas __ R-help@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.
[R] LATTICE
Hi, I am having some problems using bwplot(lattice) in my data. I want change some parameters: 1) Fontfamily to serif 2) The size of the font 3) Put it in a bold face 4) Change de color of the lines How can I do that?! Now, I am using this to plot my boxplot. dados - data.frame(varsep=as.factor(rep(1:2,10)),i=runif(20)) bwplot(dados[,'varsep']~dados[,'i'],xlab=names(dados)[2],ylab=names(dados)[1 ],panel =function(...){panel.grid(v = -1, h = 0);panel.bwplot(...)},font=2,fontfamily='serif') Thanks for any help on advance and sorry about my English. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 lean...@cesgranrio.org.br __ R-help@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.
Re: [R] loading lme4 fails - function 'cholmod_l_start' not providedby package 'Matrix'
Thanks Prof, As you can see from my session information (below), I appear to be using the same version of Matrix as yourself. However, I also notice that you're using a patched version of 2.8.1 whereas I'm not. Could this be the difference? sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Matrix_0.999375-20 lattice_0.17-20 loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 Megan Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 Prof Brian Ripley rip...@stats.ox.ac.uk 04-02-2009 11:13 Did you update your version of Matrix? It should be 0.99375-20 (or perhaps -18). E.g. for me sessionInfo() R version 2.8.1 Patched (2009-02-04 r47838) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] lme4_0.999375-28 Matrix_0.999375-20 lattice_0.17-20 loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 worked. R 2.9.0 will check versions when loading a package, but 2.8.1 does not. On Wed, 4 Feb 2009, Megan Davies wrote: Hello UseRs, I've just tried to load the lme4 package and got the error message, function 'cholmod_l_start' not provided by package 'Matrix'. I downloaded the latest version of lme4 and its required packages (lattice and Matrix) as suggested in the archives and still got this message. The FAQ and archives suggested to check the R version and also the package version requirements. requirements, but I'm already using the latest available version of R, 2.8.1. I'm using Windows XP Professional. Thanks for any help, Megan Davies Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 ** Is this email SPAM? If so, please forward it as an attachment to s...@snh.gov.uk ** This email and any files transmitted with it are confid...{{dropped:12}} __ R-help@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.
[R] Odp: Overlaid plots - lines
Hi r-help-boun...@r-project.org napsal dne 04.02.2009 11:59:44: Dear all, I have a question concerning two overlaid (scatter)plots: Has anyone an idea how I can join the first point of the first plot with the first point of the second plot, the second point of the first plot with the second point of the second plot,... and so on. Is it possible? :-/ Using lines(x,y) I can only join the points of one plot... Try segments or arrows x-rnorm(10) y-rnorm(10) plot(1:10,x) points(1:10,y, col=2) segments(1:10,y,1:10,x) Regards Petr Thank you in advance, GSt -- View this message in context: http://www.nabble.com/Overlaid-plots---lines- tp21828330p21828330.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. __ R-help@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.
Re: [R] odfweave sample code error
srinivasa raghavan srinivasraghav at gmail.com writes: I have winzip installed in my system. Error in odfWeave(inFile, outFile) : Error unzipping file In addition: Warning message: In system(zipCmd[2], invisible = TRUE) : unzip not found thanks in advance, warm regards, srinivas statistical analyst. I have solved this problem by downloading the zip utilities from the site referenced on the odfWeave help page, and making sure they are placed in a directory which is included in the system path. It even works with portable openoffice. You may be able to get winzip working with odfWeave through odfWeaveControl(), but I haven't tried this myself. See: http://finzi.psych.upenn.edu/R/Rhelp02/archive/118223.html Hope this helps, Michael Bibo Queensland Health __ R-help@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.
Re: [R] Problems in Recommending R
On Tue, 3 Feb 2009 18:56:37 -0400, Mike Lawrence (ML) wrote: One of my colleagues is a interdisciplinary PhD in Design and Psychology and he has an in with a design school where we might be able to get students to take on the redesign of the website. Thanks a lot, sounds exactly like what we need. If they don't succeed we can always by time from a professional afterwards. But I'd say let's give them a shot. For the students it should be more thrilling to work on a site that gets thousands of hits per day rather than redoing the menu of the school, cafeteria ;-) He asks: In order to ensure efficient consumption of resources and maximize our return on investment, please provide potential designers with a direct point of contact (name, email, telephone number) so that they may request a project description and feedback. Obviously the redesign idea has been generated in a community thread, but if anyone from the R foundation can step up as such a contact person I will forward your info to my colleague who will then take the temperature of students at the design school. Well, I think I qualify for that job and would be happy to do so. Best, Fritz -- --- Prof. Dr. Friedrich Leisch Institut für Statistik Tel: (+49 89) 2180 3165 Ludwig-Maximilians-Universität Fax: (+49 89) 2180 5308 LudwigstraÃe 33 D-80539 München http://www.statistik.lmu.de/~leisch --- Journal Computational Statistics --- http://www.springer.com/180 Münchner R Kurse --- http://www.statistik.lmu.de/R __ R-help@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.
[R] SOLVED: loading lme4 fails - function 'cholmod_l_start' not provided by package 'Matrix'
Thanks Thierry and the Prof, Removing the files and then reloading them seems to have done the trick. I don't understand why it worked, but it did. Megan Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 ONKELINX, Thierry thierry.onkel...@inbo.be 04-02-2009 12:40 Megan, Try to uninstall both packages, remove them from the harddrive and then reinstall them. That worked for me when I had a similar problem (lme4 complaining about Matrix). HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Megan Davies Verzonden: woensdag 4 februari 2009 12:49 Aan: Prof Brian Ripley CC: r-help@r-project.org Onderwerp: Re: [R] loading lme4 fails - function 'cholmod_l_start'not providedbypackage 'Matrix' Thanks again Prof, I downloaded the latest lme4 today. In the description file, it says, Version: 0.999375-28. I've just checked this against the version available on CRAN and its the same. Megan Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 Prof Brian Ripley rip...@stats.ox.ac.uk 04-02-2009 11:42 On Wed, 4 Feb 2009, Megan Davies wrote: Thanks Prof, As you can see from my session information (below), I appear to be using the same version of Matrix as yourself. However, I also notice that you're using a patched version of 2.8.1 whereas I'm not. Could this be the difference? It should not, and I just checked the original 2.8.1 to be sure. sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Matrix_0.999375-20 lattice_0.17-20 But we don't have the lme4 version, so please re-check that. loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 Megan Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 Prof Brian Ripley rip...@stats.ox.ac.uk 04-02-2009 11:13 Did you update your version of Matrix? It should be 0.99375-20 (or perhaps -18). E.g. for me sessionInfo() R version 2.8.1 Patched (2009-02-04 r47838) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] lme4_0.999375-28 Matrix_0.999375-20 lattice_0.17-20 loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 worked. R 2.9.0 will check versions when loading a package, but 2.8.1 does not. On Wed, 4 Feb 2009, Megan Davies wrote: Hello UseRs, I've just tried to load the lme4 package and got the error message, function 'cholmod_l_start' not provided by package 'Matrix'. I downloaded the latest version of lme4 and its required packages (lattice and Matrix) as suggested in the archives and still got this message. The FAQ and archives suggested to check the R version and also the package version requirements. requirements, but I'm already using the latest available version of R, 2.8.1. I'm using Windows XP Professional. Thanks for any help, Megan Davies Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 ** Is this email SPAM? If so, please forward it as an attachment to s...@snh.gov.uk ** This email and
Re: [R] D'Hondt method
very cool, easier than I thought... (although I am not fully familiar with sapply() and friends) quick reality-check (no proof!) at http://icon.cat/util/elections/isuHqUyDYh shows that the results coincide: votes - c(42201,38635,247736,170627,48236,117151,61379,35889,92321) dHont(c(BGLD,KTN,NÖ,OÖ,SLBG,STMK,T,VLBG,W), votes, 26) so thanks a lot, have a great day! Thomas __ R-help@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.
Re: [R] cronbachs alpha - score.items(psych) vs reliability(Rcmdr)
The item.total command in the multilevel package will give you what you want. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ If you want to build a ship, don't drum up the men to gather wood, divide the work and give orders. Instead, teach them to yearn for the vast and endless sea. [Antoine de St. Exupery] achristoffersen wrote: Dear all, I like the way the Rcmdr package computes reliability. E.g reliability(cov(d[,c(q1, q2, q3, q4, q5, q6)], use=complete.obs)) will not only give me the alpha score, but also for each variable, alpha.score if deleted. However - when writing scripts it's very tiresome to load the whole Rcmdr GUI just for this purpose. So I'm looking for an another package that delivers the same feature. the score.items function in the psych package i find is too complicated (it requires a keys vector) and it doesn't report the alpha if deleted score. What have I missed when googling for an alternative? Thx in advance Andreas __ R-help@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.
Re: [R] loading lme4 fails - function 'cholmod_l_start' not providedbypackage 'Matrix'
Thanks again Prof, I downloaded the latest lme4 today. In the description file, it says, Version: 0.999375-28. I've just checked this against the version available on CRAN and its the same. Megan Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 Prof Brian Ripley rip...@stats.ox.ac.uk 04-02-2009 11:42 On Wed, 4 Feb 2009, Megan Davies wrote: Thanks Prof, As you can see from my session information (below), I appear to be using the same version of Matrix as yourself. However, I also notice that you're using a patched version of 2.8.1 whereas I'm not. Could this be the difference? It should not, and I just checked the original 2.8.1 to be sure. sessionInfo() R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Matrix_0.999375-20 lattice_0.17-20 But we don't have the lme4 version, so please re-check that. loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 Megan Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 Prof Brian Ripley rip...@stats.ox.ac.uk 04-02-2009 11:13 Did you update your version of Matrix? It should be 0.99375-20 (or perhaps -18). E.g. for me sessionInfo() R version 2.8.1 Patched (2009-02-04 r47838) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] lme4_0.999375-28 Matrix_0.999375-20 lattice_0.17-20 loaded via a namespace (and not attached): [1] grid_2.8.1 tools_2.8.1 worked. R 2.9.0 will check versions when loading a package, but 2.8.1 does not. On Wed, 4 Feb 2009, Megan Davies wrote: Hello UseRs, I've just tried to load the lme4 package and got the error message, function 'cholmod_l_start' not provided by package 'Matrix'. I downloaded the latest version of lme4 and its required packages (lattice and Matrix) as suggested in the archives and still got this message. The FAQ and archives suggested to check the R version and also the package version requirements. requirements, but I'm already using the latest available version of R, 2.8.1. I'm using Windows XP Professional. Thanks for any help, Megan Davies Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 ** Is this email SPAM? If so, please forward it as an attachment to s...@snh.gov.uk ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager or the sender. Please note that for business purposes, outgoing and incoming emails from and to SNH may be monitored. This Email has been scanned by eSecure Mail (powered by Evolution Systems, the digital security specialist) ** -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 ** Is this email SPAM? If so, please forward it as an attachment to s...@snh.gov.uk ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager or the sender. Please note that for business purposes, outgoing and incoming emails from and to SNH may be monitored. This Email has been scanned by eSecure Mail (powered by Evolution Systems, the digital security specialist) __ R-help@r-project.org mailing list
[R] holidays effect
how can I eliminate the influence of the festivities in a time series with daily data?I tried to remove them and replace their value with a value of interpolation using na.approx (). There is an alternative method? -- View this message in context: http://www.nabble.com/holidays-effect-tp21830785p21830785.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] Debug help
Hi, I am getting the following error: argument is of length zero My code: temp - 0 for (j in 1 : 3) { for (k in 1 : 12) { temp - temp + as.double(C[k, (q - 1) * 3 + j]) * as.double(m_ret_reb[i + k - 1, j+1]) } } Why would R handle my temp variable as numeric(0)? Thanks -- View this message in context: http://www.nabble.com/Debug-help-tp21828706p21828706.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] Factor and Lm functions
Hei, I have a formula for a model as follows lm(TS~log(BodyWt)+log(BodyWt):factor(D). I do not use R for programming hence I dont understand what is the second covariate in the model log(BodyWt):factor(D). Where BodyWt = body weight and D = danger index (either 1 or 2). I want to run the same model in other program. Can anyone explain me what is doing the : operator and the factor() function. Thanks -- View this message in context: http://www.nabble.com/Factor-and-Lm-functions-tp21828771p21828771.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Debug help
On 2/4/2009 6:28 AM, ehxpieterse wrote: Hi, I am getting the following error: argument is of length zero My code: temp - 0 for (j in 1 : 3) { for (k in 1 : 12) { temp - temp + as.double(C[k, (q - 1) * 3 + j]) * as.double(m_ret_reb[i + k - 1, j+1]) } } Why would R handle my temp variable as numeric(0)? You need to send a reproducible example if you want an answer. It's more likely a problem with C or m_ret_reb or q, and we don't have those. Duncan Murdoch __ R-help@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.
Re: [R] cronbachs alpha - score.items(psych) vs reliability(Rcmdr)
The alpha.Summary() function in MiscPsycho does this. Here is an example xx - simRasch(200, 10) alpha.Summary(xx$data) Below is what alpha *would be* if the item were removed Item alpha 1 1 0.5776860 2 2 0.5620276 3 3 0.5336340 4 4 0.5561580 5 5 0.5852708 6 6 0.5875561 7 7 0.5258138 8 8 0.5324561 9 9 0.5285075 10 10 0.5898000 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Christopher W. Ryan Sent: Wednesday, February 04, 2009 8:50 AM To: r-help@r-project.org Subject: Re: [R] cronbachs alpha - score.items(psych) vs reliability(Rcmdr) The item.total command in the multilevel package will give you what you want. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ If you want to build a ship, don't drum up the men to gather wood, divide the work and give orders. Instead, teach them to yearn for the vast and endless sea. [Antoine de St. Exupery] achristoffersen wrote: Dear all, I like the way the Rcmdr package computes reliability. E.g reliability(cov(d[,c(q1, q2, q3, q4, q5, q6)], use=complete.obs)) will not only give me the alpha score, but also for each variable, alpha.score if deleted. However - when writing scripts it's very tiresome to load the whole Rcmdr GUI just for this purpose. So I'm looking for an another package that delivers the same feature. the score.items function in the psych package i find is too complicated (it requires a keys vector) and it doesn't report the alpha if deleted score. What have I missed when googling for an alternative? Thx in advance Andreas __ R-help@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. __ R-help@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.
[R] Passing data among multiple instances
Dear R, I have two R instances running at the same time, say instance A and instance B. Is there a simpler way to pass the data in A to B? More precise, I have a stupid example: In instance A, I am running a function test1 test1 - function (x1) { x2 - sin(x1) return(x2) } In instance B, another function test2 test2 - function (x2) { x3 - cos(x2) return(x3) } where test2 receives the input from test1's rueslt. test1 and test2 could be much more complex. They may take one minute each. Now the whole procedure is instance A is running, while instance B is waiting for the result of instance A. Once instance A is done (instance A goes to run with new data), instance B should detect A is done, and instance B receives the parameter from instance A. B begins to work. While B is done, waiting for A's new results. I want to repeat the loop many times and get x3 in the end. Is it possible to do this job? Thanks ! Feng [[alternative HTML version deleted]] __ R-help@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.
[R] reference for ginv
?ginv provides 'Modern Applied Statistics with S' (MASS), 3rd, by Venables and Ripley as the sole reference. I happen to have this book (4th ed) on loan from our library, and as far as I can see, ginv is mentioned there twice, and it is *used*, not *explained* in any way. (It is used on p. 148 in the 4th edition.) ginv does not appear in the index of MASS. ginv is an implementation of the Moore-Penrose generalized inverse, but I can't find any reference to an appropriate publication from Moore and Penrose in MASS either. Admittedly, MASS is inadequate as a reference for ginv, and it is desirable that the reference be corrected. Is this an isolated incident, or a general practice? (Perhaps the appropriate reference has been removed in MASS 4th?) vQ __ R-help@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.
Re: [R] Large file size while persisting rpart model to disk
In R, functions remember their entire calling chain. The good thing about this is that they can find variables further up in the nested context, i.e., mfun - function(x) { x+y} will look for 'y' in the function that called myfun, then in the function that called the function, on up and then through the search() list. This makes life easier for certain things such as minimizers. The bad thing is that to make this work R has to remember all of the variables that were available up the entire chain, and 99-100% of them aren't necessary. (Because of constructs like get(varname) a parser can't read the code to decide what might be needed). This is an issue with embedded functions. I recently noticed an extreme case of it in the pspline routine and made changes to fix it. The short version pspline(x, ...other args) { some computations to define an X matrix, which can be large define a print function ... return(X, printfun, other stuff) } It's even worse in the frailty functions, where X can be VERY large. The print function's environment wanted to 'remember' all of the temporary work that went into defining X, plus X itself and so would be huge. My solution was add the line environment(printfun) - new.env(parent=baseenv()) which marks the function as not needing anything from the local environment, only the base R definitions. This would probably be a good addition to rpart, but I need to look closer. My first cut was to use emptyenv(), but that wasn't so smart. It leaves everything undefined, like + for instance. :-) Terry Therneau __ R-help@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.
Re: [R] Large file size while persisting rpart model to disk
You need to set the environment to the rpart namespace, at least in the print etc functions attached to the return object. One reason is that formatg needs to be found, and in principle that has to be right as you are just going a couple of steps up the environment chain. I've not had time to look further. On Wed, 4 Feb 2009, Terry Therneau wrote: In R, functions remember their entire calling chain. The good thing about this is that they can find variables further up in the nested context, i.e., mfun - function(x) { x+y} will look for 'y' in the function that called myfun, then in the function that called the function, on up and then through the search() list. This makes life easier for certain things such as minimizers. The bad thing is that to make this work R has to remember all of the variables that were available up the entire chain, and 99-100% of them aren't necessary. (Because of constructs like get(varname) a parser can't read the code to decide what might be needed). Actually, it does almost no work to remember them. The work comes only when searches fail (more to search) and in save(), the issue here. This is an issue with embedded functions. I recently noticed an extreme case of it in the pspline routine and made changes to fix it. The short version pspline(x, ...other args) { some computations to define an X matrix, which can be large define a print function ... return(X, printfun, other stuff) } It's even worse in the frailty functions, where X can be VERY large. The print function's environment wanted to 'remember' all of the temporary work that went into defining X, plus X itself and so would be huge. My solution was add the line environment(printfun) - new.env(parent=baseenv()) which marks the function as not needing anything from the local environment, only the base R definitions. This would probably be a good addition to rpart, but I need to look closer. My first cut was to use emptyenv(), but that wasn't so smart. It leaves everything undefined, like + for instance. :-) Terry Therneau -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@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.
Re: [R] reference for ginv
I have the second edition and in that one there are references: Rao Mitra Generalized inverse ..., Wiley, 1971 Pringle Rayner, Generalized inverse ..., Griffin, 1971 Dodge, Analysis of Experiments .., Wiley, 1985 On Wed, Feb 4, 2009 at 9:25 AM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: ?ginv provides 'Modern Applied Statistics with S' (MASS), 3rd, by Venables and Ripley as the sole reference. I happen to have this book (4th ed) on loan from our library, and as far as I can see, ginv is mentioned there twice, and it is *used*, not *explained* in any way. (It is used on p. 148 in the 4th edition.) ginv does not appear in the index of MASS. ginv is an implementation of the Moore-Penrose generalized inverse, but I can't find any reference to an appropriate publication from Moore and Penrose in MASS either. Admittedly, MASS is inadequate as a reference for ginv, and it is desirable that the reference be corrected. Is this an isolated incident, or a general practice? (Perhaps the appropriate reference has been removed in MASS 4th?) vQ __ R-help@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. __ R-help@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.
Re: [R] How to import HTML and SQL files
Arup arup.pramanik27 at gmail.com writes: I can't import any HTML or SQL files into R..:confused: Also confused. HTML and SQL are like apples and bugs. For HTML (assume you want to extract stock quotes from a site) -- If you have strict XHTML, using package XML might be the best choice, but I doubt you get these nowadays. -- Otherwise, read in the file and use regular expressions (grep, gsub) to parse. For SQL: SELECT * from mybase -- Importing that string does not help very much, this is a program telling you what to do when you know your database. -- You might have a look at package RODBC or RSQLite; details depend on the database you are going to use. Dieter __ R-help@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.
[R] simulating genetic data
Dear all, Can someone help me with codes on how to simulate genetic data having 10SNPs and continous trait. [[alternative HTML version deleted]] __ R-help@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.
[R] simulating genetic data
Dear all, Can someone help me with codes on how to simulate genetic data having 10SNPs and continous trait. Jestinah [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Debug help
Thanks Duncan, I am translating code from Matlab into R and am still finding my feet in R. I first run TriskellData and the compute_strategy. In Matlab this is a function, so I would be looking to do the same in R. The bug is in compute_strategy. I would appreciate any help you can give. Thanks, Eduard -Original Message- From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] Sent: 04 February 2009 14:04 To: Eduard Pieterse (Macquarie Securities) Cc: r-help@r-project.org Subject: Re: [R] Debug help On 2/4/2009 6:28 AM, ehxpieterse wrote: Hi, I am getting the following error: argument is of length zero My code: temp - 0 for (j in 1 : 3) { for (k in 1 : 12) { temp - temp + as.double(C[k, (q - 1) * 3 + j]) * as.double(m_ret_reb[i + k - 1, j+1]) } } Why would R handle my temp variable as numeric(0)? You need to send a reproducible example if you want an answer. It's more likely a problem with C or m_ret_reb or q, and we don't have those. Duncan Murdoch If there is any advice in this email, it is general advice only and has been prepared by Macquarie Group or one of its related entities (“Macquarie”). Macquarie has made every reasonable effort to ensure the information provided is correct, but Macquarie makes no representation nor any warranty as to whether the information is accurate, complete or up to date. To the extent permitted by law, Macquarie accepts no responsibility for any errors or misstatements, negligent or otherwise. The information provided may be based on assumptions or market conditions and may change without notice. Macquarie, its associates, officers or employees may also have interests in the financial products referred to in this information by acting in various roles. They may buy or sell the financial products as principal or agent and as such may effect transactions which are not consistent with any recommendations (if any in this information). Macquarie or its associates may also receive fees or brokerage for acting in the above capacities. The information in this email is confidential. If you are not the intended recipient, you are not authorised to use the information in this email in any way. Macquarie does not guarantee the integrity of any emails or attached files. The view or opinions expressed are the author's own and may not reflect the view or opinions of Macquarie. Electronic communications carried within the Macquarie system may be monitored. __ R-help@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.
Re: [R] Passing data among multiple instances
Feng Li wrote: I have two R instances running at the same time, On the same computer, or on different computers? Is the number of Rs likely to change, or will it always be just the two? Is this a simple one-off problem, or are you breaking the problem up into pieces so you can throw lots of hardware at it? Is there a simpler way to pass the data in A to B? Perhaps the simplest option is to write the data structure to a file, using any of the several R ways to do that. When instance 2 sees that a file is available, it slurps its contents in and works on it. The hard part is making the second instance wait until the whole file is written out by the first. You wouldn't want it to read in half the file then hit the end because the first process hasn't finished writing out the file. I don't see any good mechanism in R to fix this. A more robust option is to use sockets. This is suitable even within a single machine. See ?make.socket. This solves the how do I know when I've got the full data structure problem because the second process can just keep reading until it gets an error indicating that the remote peer closed the connection. Once you have the data structure in string form, you can eval() it to get an R object suitable for munching on. Figuring out how to pass the data might be the hardest part. deparse() might be the easiest way. If you're hoping to scale this up to lots of processes, look into Rmpi. This provides a very clean way for an R program on one computer to start slaves on other computers and then pass data to them in native R structures. Setting up MPI itself is not trivial, however. It's best when you already have a cluster of computers linked with MPI. __ R-help@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.
Re: [R] RCurl FTPUpload
Thanks to Hervé, I was able to reproduce the problem and find the trivial cause (a conditional initialization in the C code). So there is a new (source) version (0.94-1) of the package on the Omegahat web site now. http://www.omegahat.org/RCurl/ and in the Omegahat repository. Thanks Hervé. D. Herve Fulchiron wrote: Hello, I am trying to solve a problem but with no success for the past 4 days. I use the RCurl package with R 2.8.1, and when I try to use the function FTPUpload, it uploads the file but does not stop. It repeats the content of the file without stopping and the destination file keeps getting bigger and bigger. Here is the line that I use : ftpUpload(C:/Users/herve/Documents/Document1.txt, sftp:// .dedibox.fr/home/herve/Document1.txt, userpwd = herve:xx) Any idea why it does not work ? Cordially, Hervé [[alternative HTML version deleted]] __ R-help@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. __ R-help@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.
Re: [R] Large file size while persisting rpart model to disk
Brian R makes good points. I made a mistake in the prior post, it should have said new.env(parent=globalenv()) for pspline. You want the saved function to pay attention to the search() path. This is what is actually in the code, I was guilty of mistyping. If the print function uses a not-exported function from the enclosing package then we need to be more careful. This is the case for rpart. __ R-help@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.
Re: [R] Passing data among multiple instances
Very very fruitful. Now I only do the experiment on my single computer with a Quad CPU and more than 2 G ram. Let me have a try first. Feng On Wed, Feb 4, 2009 at 4:02 PM, Warren Young war...@etr-usa.com wrote: Feng Li wrote: I have two R instances running at the same time, On the same computer, or on different computers? Is the number of Rs likely to change, or will it always be just the two? Is this a simple one-off problem, or are you breaking the problem up into pieces so you can throw lots of hardware at it? Is there a simpler way to pass the data in A to B? Perhaps the simplest option is to write the data structure to a file, using any of the several R ways to do that. When instance 2 sees that a file is available, it slurps its contents in and works on it. The hard part is making the second instance wait until the whole file is written out by the first. You wouldn't want it to read in half the file then hit the end because the first process hasn't finished writing out the file. I don't see any good mechanism in R to fix this. A more robust option is to use sockets. This is suitable even within a single machine. See ?make.socket. This solves the how do I know when I've got the full data structure problem because the second process can just keep reading until it gets an error indicating that the remote peer closed the connection. Once you have the data structure in string form, you can eval() it to get an R object suitable for munching on. Figuring out how to pass the data might be the hardest part. deparse() might be the easiest way. If you're hoping to scale this up to lots of processes, look into Rmpi. This provides a very clean way for an R program on one computer to start slaves on other computers and then pass data to them in native R structures. Setting up MPI itself is not trivial, however. It's best when you already have a cluster of computers linked with MPI. __ R-help@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. -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden [[alternative HTML version deleted]] __ R-help@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.
[R] ggplot: problem with fill option in stat_smooth()
Hi all, I am using ggplot2 and continuing to find it very useful and pretty. However, I am trying to create some graphics for publication that would be included in an MS Word document (not my choice!) in Windows Vista. The problem is that I want to use stat_smooth() to add an fitted linear model line along with its 95% confidence band, but I cannot seem to get the confidence band in a format that would import into Word. I have read the documentation and am using the fill=grey50 argument to eliminate transparency as a potential problem. But still, I have tried nearly all export formats and the only one that correctly shows the confidence band is PDF, which I cannot import into Word as a vector graphic. This makes me wonder if the fill=grey50 option is working as advertised. Here is a simple example using the mtcars data set included with ggplot2: qplot(wt,mpg,data=mtcars) + stat_smooth(fill=grey50) I even tried the Cairo library as one R-help post suggested, but to no avail. Any suggestions? Thanks much, Ian Fiske -- View this message in context: http://www.nabble.com/ggplot%3A-problem-with-fill-option-in-stat_smooth%28%29-tp21832398p21832398.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Large file size while persisting rpart model to disk
One correction below, and a suggested alternative approach. On 2/4/2009 9:31 AM, Terry Therneau wrote: In R, functions remember their entire calling chain. The good thing about this is that they can find variables further up in the nested context, i.e., mfun - function(x) { x+y} will look for 'y' in the function that called myfun, then in the function that called the function, on up and then through the search() list. This makes life easier for certain things such as minimizers. This description is not right: it's not the caller, it's the environment where mfun was created. So it applies to nested functions (as you said), but the caller is irrelevant. The bad thing is that to make this work R has to remember all of the variables that were available up the entire chain, and 99-100% of them aren't necessary. (Because of constructs like get(varname) a parser can't read the code to decide what might be needed). I'm not sure what you mean by chain here, but the real issue is that all the variables in the function that creates mfun will be kept as long as mfun exists. This is an issue with embedded functions. I recently noticed an extreme case of it in the pspline routine and made changes to fix it. The short version pspline(x, ...other args) { some computations to define an X matrix, which can be large define a print function ... return(X, printfun, other stuff) } So here printfun captures all the local variables in pspline, even if it doesn't need them. It's even worse in the frailty functions, where X can be VERY large. The print function's environment wanted to 'remember' all of the temporary work that went into defining X, plus X itself and so would be huge. My solution was add the line environment(printfun) - new.env(parent=baseenv()) which marks the function as not needing anything from the local environment, only the base R definitions. This would probably be a good addition to rpart, but I need to look closer. My first cut was to use emptyenv(), but that wasn't so smart. It leaves everything undefined, like + for instance. :-) Another approach is simply to rm() the variables that aren't needed before returning a function. For example, this function has locals x and y, but only needs y for the returned function to work: fnbuilder - function(n) { +x - numeric(n) +y - numeric(n) +noneedforx - function() sum(y) +rm(x) +return(noneedforx) + } f - fnbuilder(1) f() [1] 0 To see what actually got carried along with f, use ls(): ls(environment(f)) [1] n noneedforx y So we've picked up the arg n, and our local copy of noneedforx, but we did manage to get rid of x. (The local copy costs almost nothing: R will just have another reference to the same object as f refers to. The arg could have been rm'd too, if it was big enough to matter.) Duncan Murdoch Terry Therneau __ R-help@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. __ R-help@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.
[R] counting entries in vector
Hi all, I've a vector with entries, which are all of the same type, e.g. string: k - c(bb, bb, bb, aa, cc, cc) and want to create a second vector containing the number of each entry in k in the same order as in k, i.e. c(3, 1, 2) or: k - c(5,5,5,5,2,2,4) = c(4,2,1) thanks __ R-help@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.
Re: [R] How to declare an array with columns storing different datatypes/precision
Ok. Array or Dataframe.. does not matter.. as long as I can extract the required dataelement. :-) Can you please send me pointer or reference to read about usage of fancy floating points or how to declare variables storing different datatypes? Thannk you. Regards, suresh Duncan Murdoch-2 wrote: On 2/4/2009 8:57 AM, Suresh_FSFM wrote: Dear R- Experts, Seek your help. I want to creata data as follows. Ref_array with 4 columns. 1st column should store data of precision: 8.4 (i.e. 8 digits before decimal point and 4 digits after decimal points) 2nd column: should store data of type date -mm-dd hh:mm:ss 3rd column: only integer value. No decimal points 4th column: percentage values In R, an array is all one data type, so you can't do that. However, you can have a dataframe that comes close: but there is no special type for 8.4 or percentage values, you'd need to use floating point (or fancy handling of integers) for those. Duncan Murdoch __ R-help@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. -- View this message in context: http://www.nabble.com/How-to-declare-an-array-with-columns-storing-different-datatypes-precision-tp21830977p21832569.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] overlapping bars on dodge ggplot histogram - can it be fixed?
Hadley, Thank you again for your suggestion. I am going with the second solution. It appears to have a consistent bar width and helps to illustrate when data is not present within a certain bin. One other silly question - how in the world do I get the x-axis label to not show up? I want the x-label, but not the x-axis to appear, e.g. for the example below the not to see the Rural Feamale, Rural Male, ... that are on the lower x-axis? Thank you again for your help. --- On Mon, 2/2/09, hadley wickham h.wick...@gmail.com wrote: From: hadley wickham h.wick...@gmail.com Subject: Re: overlapping bars on dodge ggplot histogram - can it be fixed? To: jasonkrup...@yahoo.com Cc: R-help@r-project.org Date: Monday, February 2, 2009, 8:46 PM Hi Jason, I can't see anyway to do this completely within in ggplot. And it's not easy to do the data processing yourself. Here's one attempt that almost works: counts - ddply(VADeaths_flat_df, .(round_any(Data, 20), Person), nrow) names(counts) - c(bin, person, n) qplot(bin, n, data = counts, fill = person, geom=bar, stat =identity, position=dodge) Or maybe: counts - ddply(VADeaths_flat_df, .(cut(Data, breaks=fullseq(range(Data), 20)), Person), nrow) names(counts) - c(bin, person, n) qplot(person, n, data = counts, fill = person, geom=bar, stat =identity, width = 0.9) + facet_grid(. ~ bin) + opts(axis.text.x = theme_text(angle = 45, hjust = 1, colour = grey60)) Hadley On Mon, Feb 2, 2009 at 8:32 PM, Jason Rupert jasonkrup...@yahoo.com wrote: Using the following code to have a little separation between the individual bins: VADeaths_flat_df = stack(as.data.frame(VADeaths)) names(VADeaths_flat_df) = c('Data','Person') ggplot(VADeaths_flat_df, aes(Data, fill = Person)) + geom_bar(position=position_dodge(width =(15)), binwidth=20) The result shows the bars overlapping. Is there any way to fix it by reducing the bar sizes? Thanks again. --- On Mon, 2/2/09, hadley wickham h.wick...@gmail.com wrote: From: hadley wickham h.wick...@gmail.com Subject: Re: [R] Broke ggplot... To: jasonkrup...@yahoo.com Cc: R-help@r-project.org Date: Monday, February 2, 2009, 5:49 PM On Mon, Feb 2, 2009 at 5:41 PM, Jason Rupert jasonkrup...@yahoo.com wrote: It appears I broke ggplot in my script, but that maybe it is because the caffeine has worn off or maybe it is late in the day. I thought I was beginning to understand ggplot, but I have encountered a silly little issue. For some reason the following does not produce a histogram with fill due to the Person's characteristics: (Note that VADeaths_flat_df$Data works fine...) VADeaths_df-data.frame(VADeaths) ... You can do this a bit more easily with: VADeaths_flat_df - melt(VADeaths) names(VADeaths_flat_df) - c(Age, Person, Data) bin_size-15.0 ggplot(VADeaths_flat_df, aes(x = factor(Data), fill = factor(Person))) + geom_bar(position=position_dodge(width =(20)), binwidth=20) # or ggplot(VADeaths_flat_df, aes(x=factor(Data))) + geom_histogram(binwidth=20) Those plots look fine to me (well they're what I'd expect from the definition), but I'd think you'd want ggplot(VADeaths_flat_df, aes(Data, fill = Person)) + geom_histogram(binwidth=20) or maybe ggplot(VADeaths_flat_df, aes(Person, weight = Data)) + geom_bar() ggplot(VADeaths_flat_df, aes(Person, weight = Data, fill = Age)) + geom_bar() Hadley -- http://had.co.nz/ -- http://had.co.nz/ [[alternative HTML version deleted]] __ R-help@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.
Re: [R] reference for ginv
Gabor Grothendieck wrote: I have the second edition and in that one there are references: Rao Mitra Generalized inverse ..., Wiley, 1971 Pringle Rayner, Generalized inverse ..., Griffin, 1971 Dodge, Analysis of Experiments .., Wiley, 1985 far from obvious. so ?ginv should refer directly to these, or state which page in MASS provides the right references. does 3rd p. 100 (as provided in ?ginv) link to these (or other) publications? vQ On Wed, Feb 4, 2009 at 9:25 AM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: ?ginv provides 'Modern Applied Statistics with S' (MASS), 3rd, by Venables and Ripley as the sole reference. I happen to have this book (4th ed) on loan from our library, and as far as I can see, ginv is mentioned there twice, and it is *used*, not *explained* in any way. (It is used on p. 148 in the 4th edition.) ginv does not appear in the index of MASS. ginv is an implementation of the Moore-Penrose generalized inverse, but I can't find any reference to an appropriate publication from Moore and Penrose in MASS either. Admittedly, MASS is inadequate as a reference for ginv, and it is desirable that the reference be corrected. Is this an isolated incident, or a general practice? (Perhaps the appropriate reference has been removed in MASS 4th?) vQ __ R-help@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. -- --- Wacek Kusnierczyk, MD PhD Email: w...@idi.ntnu.no Phone: +47 73591875, +47 72574609 Department of Computer and Information Science (IDI) Faculty of Information Technology, Mathematics and Electrical Engineering (IME) Norwegian University of Science and Technology (NTNU) Sem Saelands vei 7, 7491 Trondheim, Norway Room itv303 Bioinformatics Gene Regulation Group Department of Cancer Research and Molecular Medicine (IKM) Faculty of Medicine (DMF) Norwegian University of Science and Technology (NTNU) Laboratory Center, Erling Skjalgsons gt. 1, 7030 Trondheim, Norway Room 231.05.060 __ R-help@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.
Re: [R] Passing data among multiple instances
Thanks your information any how. I am using a Quad CPU. That's why I really want two or more than two instances. On Wed, Feb 4, 2009 at 3:46 PM, markle...@verizon.net wrote: There's no need to wait as long as you have the econd function fter the first ( the second won't start until the first one's finished ) but I think it's better to use lexical scoping by putting the second function right inside the first. Something like this: test1 - function (x1) { x2 - sin(x1) test2 - function(x2) { x3- cos(x2) } return(x3) } Then just call test1. But wait till someone else responds because I'm not an expeRt and someone else might say something more useful or different. In instance B, another function test2 test2 - function (x2) { x3 - cos(x2) return(x3) } On Wed, Feb 4, 2009 at 9:08 AM, Feng Li wrote: Dear R, I have two R instances running at the same time, say instance A and instance B. Is there a simpler way to pass the data in A to B? More precise, I have a stupid example: In instance A, I am running a function test1 test1 - function (x1) { x2 - sin(x1) return(x2) } In instance B, another function test2 test2 - function (x2) { x3 - cos(x2) return(x3) } where test2 receives the input from test1's rueslt. test1 and test2 could be much more complex. They may take one minute each. Now the whole procedure is instance A is running, while instance B is waiting for the result of instance A. Once instance A is done (instance A goes to run with new data), instance B should detect A is done, and instance B receives the parameter from instance A. B begins to work. While B is done, waiting for A's new results. I want to repeat the loop many times and get x3 in the end. Is it possible to do this job? Thanks ! Feng [[alternative HTML version deleted]] __ R-help@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. -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Overlaid plots - lines
It works with segments or arrows :-) x-rnorm(10) y-rnorm(10) plot(1:10,x) points(1:10,y, col=2) segments(1:10,y,1:10,x) -- View this message in context: http://www.nabble.com/Overlaid-plots---lines-tp21828330p21829804.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] data editor in R- could it be improved?
Hi all, I've used R for basic programming and data management for a few years now. One of the things that I think could be improved is the data editor. Its a great feature and I use it alot by calling edit(data.frame); very useful to see if what you tried to do actually worked. However, one of the annoying things about it is that when you scroll down the window it doesnt show you all the data (for a large data frame), just subsets of it. It would also be quite useful if the width of the columns could be adjusted or didnt default to the size of the name of the column. (since the names might often be very big if the data frame was created using a function). Side-ways scrolling is quite jerky too. Just wondered if this was on anyone else's wish list? Simon. Dr. Simon Pickett Research Ecologist Land Use Department Terrestrial Unit British Trust for Ornithology The Nunnery Thetford Norfolk IP242PU 01842750050 [[alternative HTML version deleted]] __ R-help@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.
Re: [R] holidays effect
Just an extension of the query posed by the OP --- Similar problem arises in the case when one has to deal with weekly data spanning 2 or more years, and one of the years happens to have 53 weeks because it is a leap year (2004, for ex.). In a sci.stats newsgroup where I had posed this problem for recommendations, one suggestion was to check out time series calendar adjustment topics. I know some commercial software have the option of trading day adjustment where the adjustment is obtained by regression on the days of the week for the months under consideration. I'm currently exploring R time series packages. Any thoughts on this would be appreciated. Thanks! -Girish On Feb 4, 7:18 pm, Gabor Grothendieck ggrothendi...@gmail.com wrote: One possibility if you don't have to have days is to reduce it to a weekly or monthly series. On Wed, Feb 4, 2009 at 8:46 AM, elisia elisabetta.fab...@guest.telecomitalia.it wrote: how can I eliminate the influence of the festivities in a time series with daily data?I tried to remove them and replace their value with a value of interpolation using na.approx (). There is an alternative method? -- View this message in context:http://www.nabble.com/holidays-effect-tp21830785p21830785.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] overlapping bars on dodge ggplot histogram - can it be fixed?
On Wed, Feb 4, 2009 at 9:26 AM, Jason Rupert jasonkrup...@yahoo.com wrote: Hadley, Thank you again for your suggestion. I am going with the second solution. It appears to have a consistent bar width and helps to illustrate when data is not present within a certain bin. One other silly question - how in the world do I get the x-axis label to not show up? I want the x-label, but not the x-axis to appear, e.g. for the example below the not to see the Rural Feamale, Rural Male, ... that are on the lower x-axis? The easiest way is + xlab() or + xlab(NULL) Hadley -- http://had.co.nz/ __ R-help@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.
Re: [R] counting entries in vector
try this: k - c(bb, bb, bb, aa, cc, cc) f - factor(k, levels = unique(k)) as.vector(table(f)) you can put it in one line but it's less readable. I hope it helps. Best, Dimitris axionator wrote: Hi all, I've a vector with entries, which are all of the same type, e.g. string: k - c(bb, bb, bb, aa, cc, cc) and want to create a second vector containing the number of each entry in k in the same order as in k, i.e. c(3, 1, 2) or: k - c(5,5,5,5,2,2,4) = c(4,2,1) thanks __ R-help@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. -- Dimitris Rizopoulos Assistant Professor Department of Biostatistics Erasmus Medical Center Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands Tel: +31/(0)10/7043478 Fax: +31/(0)10/7043014 __ R-help@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.
Re: [R] counting entries in vector
Its not clear whether c(bb, bb, aa, aa, bb) can occur or if it can how it should be handled but this gives the lengths of each run and so would give c(2, 2, 1) in that case (as opposed to c(3, 2)): rle(k)$lengths On Wed, Feb 4, 2009 at 10:19 AM, axionator axiona...@gmail.com wrote: Hi all, I've a vector with entries, which are all of the same type, e.g. string: k - c(bb, bb, bb, aa, cc, cc) and want to create a second vector containing the number of each entry in k in the same order as in k, i.e. c(3, 1, 2) or: k - c(5,5,5,5,2,2,4) = c(4,2,1) thanks __ R-help@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. __ R-help@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.
Re: [R] How to import HTML and SQL files
Dieter Menne wrote: Arup arup.pramanik27 at gmail.com writes: I can't import any HTML or SQL files into R..:confused: Also confused. HTML and SQL are like apples and bugs. For HTML (assume you want to extract stock quotes from a site) -- If you have strict XHTML, using package XML might be the best choice, but I doubt you get these nowadays. -- Otherwise, read in the file and use regular expressions (grep, gsub) to parse. The htmlParse() and htmlTreeParse() functions in the XML package use the non-strict HTML parser in libxml2 and so the HTML document can be malformed. That parser tends to be quite tolerant so that you get an HTML tree back, even if the ambiguities in the original HTML document lead to a tree that one might not expect. I've not had any troubles parsing HTML files with it. D. For SQL: SELECT * from mybase -- Importing that string does not help very much, this is a program telling you what to do when you know your database. -- You might have a look at package RODBC or RSQLite; details depend on the database you are going to use. Dieter __ R-help@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. __ R-help@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.
[R] ANOVA in R
Hi,I'm using a repeated measures ANOVA in R using lme(). The SAS code would be: PROC MIXED DATA=[data set below]; CLASS pid treat period time seq; MODEL Y = seq period treat time treat*time; REPEATED time / SUBJECT=pid TYPE=cs; RUN, I donot have SAS, instead I have R and I would like to try the following: anova(lme(response ~ seq period treat time treat*time,random= ~1|SUB, correlation=corCompSymm())) Is this correct? Can I also write the model as Y_ijklt = m + a_l + b_k + c_j + d_t + (cd)_jt + u_ijkltY_ijklt is the response variable due to pid i, treat j, period k, seq l, and time t. Thank you very much in advance for your help :) Samor [[alternative HTML version deleted]] __ R-help@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.
Re: [R] holidays effect
One possibility if you don't have to have days is to reduce it to a weekly or monthly series. On Wed, Feb 4, 2009 at 8:46 AM, elisia elisabetta.fab...@guest.telecomitalia.it wrote: how can I eliminate the influence of the festivities in a time series with daily data?I tried to remove them and replace their value with a value of interpolation using na.approx (). There is an alternative method? -- View this message in context: http://www.nabble.com/holidays-effect-tp21830785p21830785.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. __ R-help@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.
[R] How to declare an array with columns storing different datatypes/precision
Dear R- Experts, Seek your help. I want to creata data as follows. Ref_array with 4 columns. 1st column should store data of precision: 8.4 (i.e. 8 digits before decimal point and 4 digits after decimal points) 2nd column: should store data of type date -mm-dd hh:mm:ss 3rd column: only integer value. No decimal points 4th column: percentage values Please help. Thank you in advance. Best Regards, Suresh -- View this message in context: http://www.nabble.com/How-to-declare-an-array-with-columns-storing-different-datatypes-precision-tp21830977p21830977.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] overlapping bars on dodge ggplot histogram - can it be fixed?
Yeah. That is the problem. I would ant there to be a x-label, but I don't want the x-axis tick marks for the facet to be labeled. For the example below: VADeaths_flat_df = stack(as.data.frame(VADeaths)) names(VADeaths_flat_df) = c('Data','Person') counts - ddply(VADeaths_flat_df, .(cut(Data, breaks=fullseq(range(Data), 20)), Person), nrow) names(counts) - c(bin, person, n) qplot(person, n, data = counts, fill = person, geom=bar, stat=identity, width = 0.9) + facet_grid(. ~ bin) + opts(axis.text.x = theme_text(angle = 45, hjust = 1, colour = grey60)) I would like the People label to remain, but I would like to remove the individual Male Rural, Female Rural... That is I would like the x-label, like the y-label n, to remain. However, the x-axis text is a little cluttered so I would like to remove all that text. Thanks agian. --- On Wed, 2/4/09, hadley wickham h.wick...@gmail.com wrote: From: hadley wickham h.wick...@gmail.com Subject: Re: overlapping bars on dodge ggplot histogram - can it be fixed? To: jasonkrup...@yahoo.com Cc: R-help@r-project.org Date: Wednesday, February 4, 2009, 10:07 AM On Wed, Feb 4, 2009 at 9:26 AM, Jason Rupert jasonkrup...@yahoo.com wrote: Hadley, Thank you again for your suggestion. I am going with the second solution. It appears to have a consistent bar width and helps to illustrate when data is not present within a certain bin. One other silly question - how in the world do I get the x-axis label to not show up? I want the x-label, but not the x-axis to appear, e.g. for the example below the not to see the Rural Feamale, Rural Male, ... that are on the lower x-axis? The easiest way is + xlab() or + xlab(NULL) Hadley -- http://had.co.nz/ [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Numeric class and sasxport.get
Thanks a lot Frank, One last question, though. I was tempted to remove all attributes of my variables after the sasxport.get call using foo - sasxport.get(...) foo - as.data.frame(lapply(unclass(foo),as.vector)) Since I never worked with the objects of class 'labeled', I was wondering what I will loose by removing this attribute. *Sebastien Bihorel, PharmD, PhD* PKPD Scientist Cognigen Corp Email: sebastien.biho...@cognigencorp.com mailto:sebastien.biho...@cognigencorp.com Phone: (716) 633-3463 ext. 323 Frank E Harrell Jr wrote: sebastien.biho...@cognigencorp.com wrote: The problem is actually not related to a broken command but a attempt of operational qualification of R. A few years ago, my company developed a set of scripts for the 'operational qualification' of Splus. We are switching to R so I am currently trying to port the scripts to R. All Splus scripts imported SAS data using the importData function, which I substituted by sasxport.get. One particular script returns the class of each variable of the imported data frame; the output must match the expected values: numeric, factor, integer, etc... The R 'translation' with sasxport.get is thus problematic. If there is no easy tweak of the function, we will probably have to remove this script from our list of 'qualification' scripts. Although it would be nice Then my advice is to write your own wrapper function for sasxport.get that takes its output, looks for labelled variables, and adds a new class of your choosing depending on properties of the variable, making sure that you write methods needed for that class (if any). Then test your new function, not sasxport.get explicitly. Frank Sebastien Bihorel wrote: Frank, It is a non existing issue for me if the variables of class labelled (and only labelled) can only be numerical variables (integer or numeric). Sebastien 'labelled' can apply to any type of vector. I'm not clear on the problem this causes you. Please provide a command that is broken by this behavior. Frank Frank E Harrell Jr wrote: Sebastien Bihorel wrote: Dear R-users, The sasxport.get function (from the Hmisc package) automatically defines the class of imported variables. I have noticed that the class of theoretically numeric variables is simply labelled, although character variables might end up been defined as labelled Date or labelled factor. Is there a way to tell sasxport.get to define numeric variable as labelled integer or labelled numeric? Sebastien, If that would fix a problem you're having we could look into it. Otherwise I'd tend to leave well enough alone. Frank Thank you Sebastien __ R-help@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. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@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.
Re: [R] chi squared goodness of fit test with R
You might try the cut() function to convert your data from a continuous measure into an ordinal factor. Then use the table() function to get your contingency table. The R help system is very extensive. Type ?cut to get the help on the function cut(). This works with all functions. Look at the examples at the bottom of the help. You might want to run through An Introduction to R which is available through the help menu. Good luck, Ian evrim akar wrote: Dear R users, I am a master student in Mathematics and I am writing my thesis in statistics. I need to use R and unfortunately I do not have any experience with a computer program. Could you please help me about chi squared goodness of fit test with R? In R-help website I saw a message about how to do that but I do not know how to cut the data into bins and calculate the expected numbers in each bin. Moreover I have to count the observed data in each bin and I do not know how to do that either. I really need help as its an essential part of my study. I appreciate if you could help. Thank you in advance, regards, [[alternative HTML version deleted]] __ R-help@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. -- View this message in context: http://www.nabble.com/chi-squared-goodness-of-fit-test-with-R-tp21826916p21832544.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] counting entries in vector
axionator axionator at gmail.com writes: I've a vector with entries, which are all of the same type, e.g. string: k - c(bb, bb, bb, aa, cc, cc) and want to create a second vector containing the number of each entry in k in the same order as in k, i.e. c(3, 1, 2) table(k) Ben Bolker __ R-help@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.
Re: [R] reading .odf spreadsheet into R
Dieter Menne wrote: stephen sefick ssefick at gmail.com writes: I have searched the archives and I did not find the answer to my question. Is there a way to read in a .odf spreadsheet without modification to a .csv file. I am analyzing my classes scores on their first exam, and would like to read the grade book in without converting it to .csv. For very simple cases, i.e. only numbers and headers, it is possible to extract content.xml from the odf (rename it to .zip to see it), and read the required items with package XML. This is very fast and works well for large, but strictly structured data. Indeed. I just put a package ROpenOffice up at http://www.omegahat.org/ROpenOffice which provides a read.ods() function and can read worksheets in a workbook, even those that are not rectangular. This uses the Rcompression package to read the .ods archive. I'll eventually coordinate it with the same facilities we have in the RExcelXML and ROOXML packages which do this and a few other things for xlsx files for Excel. D. Dieter __ R-help@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. __ R-help@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.
Re: [R] holidays effect
Unfortunately, my aim is to identify outliers in a time series, and I would like the holidays, which have in general a higher value and shall not affect such research. If I run the detection of outliers on the whole time series, while maintaining the real values of the holidays, I get results just as the values corresponding to the festivities. How can I solve this problem, by maintaining the daily data? Gabor Grothendieck wrote: One possibility if you don't have to have days is to reduce it to a weekly or monthly series. On Wed, Feb 4, 2009 at 8:46 AM, elisia elisabetta.fab...@guest.telecomitalia.it wrote: how can I eliminate the influence of the festivities in a time series with daily data?I tried to remove them and replace their value with a value of interpolation using na.approx (). There is an alternative method? -- View this message in context: http://www.nabble.com/holidays-effect-tp21830785p21830785.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. __ R-help@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. -- View this message in context: http://www.nabble.com/holidays-effect-tp21830785p21831641.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] loading lme4 fails - function 'cholmod_l_start' notprovided by package 'Matrix'
Dear Megan, It looks like you don't have the latest version of the Matrix package. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Megan Davies Verzonden: woensdag 4 februari 2009 11:46 Aan: r-help@r-project.org Onderwerp: [R] loading lme4 fails - function 'cholmod_l_start' notprovided by package 'Matrix' Hello UseRs, I've just tried to load the lme4 package and got the error message, function 'cholmod_l_start' not provided by package 'Matrix'. I downloaded the latest version of lme4 and its required packages (lattice and Matrix) as suggested in the archives and still got this message. The FAQ and archives suggested to check the R version requirements, but I'm already using the latest available version of R, 2.8.1. I'm using Windows XP Professional. Thanks for any help, Megan Davies Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 ** This email and any files transmitted with it are confid...{{dropped:12}} __ R-help@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. Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document. __ R-help@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.
Re: [R] counting entries in vector
Take a look at the run-length encoding function rle. I believe rle(k)$lengths gives you exactly what you want. -s On Wed, Feb 4, 2009 at 10:19 AM, axionator axiona...@gmail.com wrote: Hi all, I've a vector with entries, which are all of the same type, e.g. string: k - c(bb, bb, bb, aa, cc, cc) and want to create a second vector containing the number of each entry in k in the same order as in k, i.e. c(3, 1, 2) or: k - c(5,5,5,5,2,2,4) = c(4,2,1) thanks __ R-help@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. __ R-help@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.
[R] loading lme4 fails - function 'cholmod_l_start' not provided by package 'Matrix'
Hello UseRs, I've just tried to load the lme4 package and got the error message, function 'cholmod_l_start' not provided by package 'Matrix'. I downloaded the latest version of lme4 and its required packages (lattice and Matrix) as suggested in the archives and still got this message. The FAQ and archives suggested to check the R version requirements, but I'm already using the latest available version of R, 2.8.1. I'm using Windows XP Professional. Thanks for any help, Megan Davies Megan Davies Policy and Advice Officer, Statistician Scottish Natural Heritage 01463 725072 ** This email and any files transmitted with it are confid...{{dropped:12}} __ R-help@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.
Re: [R] holidays effect
Gabor Grothendieck ha scritto: One possibility if you don't have to have days is to reduce it to a weekly or monthly series. Alternatively you can put a dummy variable (1=holiday and zero otherwise) in the regression model for your response. For instance, you could use the xreg argument of the arima() function. This allows to avoid aggregation of your data which, in general, is not recommended.. best, vito On Wed, Feb 4, 2009 at 8:46 AM, elisia elisabetta.fab...@guest.telecomitalia.it wrote: how can I eliminate the influence of the festivities in a time series with daily data?I tried to remove them and replace their value with a value of interpolation using na.approx (). There is an alternative method? -- View this message in context: http://www.nabble.com/holidays-effect-tp21830785p21830785.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. __ R-help@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. -- Vito M.R. Muggeo Dip.to Sc Statist e Matem `Vianelli' Università di Palermo viale delle Scienze, edificio 13 90128 Palermo - ITALY tel: 091 6626240 fax: 091 485726/485612 http://dssm.unipa.it/vmuggeo __ R-help@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.
Re: [R] list.files changed in 2.7.0
My original message referred to the double slash and using grep. The particular behavior on C: wasn't the issue. For example, list.files(C:/test1, full.names=TRUE) [1] C:/test1/file1 C:/test1/file2 list.files(C:/test1/, full.names=TRUE) [1] C:/test1//file1 C:/test1//file2 # Note the double slashes file.exists(list.files(C:/test1, full.names=TRUE)) [1] TRUE TRUE file.exists(list.files(C:/test1/, full.names=TRUE)) [1] TRUE TRUE # Well that's reassuring, but I was using grep grep(C:/test1/file2, list.files(C:/test1, full.names=TRUE)) [1] 2 grep(C:/test1/file2, list.files(C:/test1/, full.names=TRUE)) integer(0) # bummer In older versions of R, the last command also gave the response '2'. While R and the OS can handle the single or double slash, grep cannot know what I'm after. Such unannounced changes make it harder to keep production code running as we upgrade R versions. It's just a fussy change, but I wondered why it was made, and whether the behavior would change in future. -- David -Original Message- From: henrik.bengts...@gmail.com [mailto:henrik.bengts...@gmail.com] On Behalf Of Henrik Bengtsson Sent: Tuesday, February 03, 2009 2:42 PM To: David Reiner dav...@rhotrading.com Cc: r-help@r-project.org Subject: Re: [R] list.files changed in 2.7.0 Hi, I've verified in R version 2.8.1 Patched (2008-12-22 r47296) using both Rterm and Rgui, and list.files(path=C:) list the files that are in the current working directory of C: and this *can* be changed by setwd(), that is, it does not just depend on which directory you started R in. The command list.files(path=C:/) always lists the files under the root of C:. /Henrik On Mon, Jan 26, 2009 at 7:48 AM, dav...@rhotrading.com wrote: Hmm. I get exactly the same files and directories with C: and C:/, except for the double slashes now. Previously the two calls to list.files gave exactly the same results. My current directory (getwd()) is not C:. I'm puzzled by your output. -- David -Original Message- From: henrik.bengts...@gmail.com [mailto:henrik.bengts...@gmail.com] On Behalf Of Henrik Bengtsson Sent: Friday, January 23, 2009 8:36 PM To: David Reiner dav...@rhotrading.com Cc: r-help@r-project.org Subject: Re: [R] list.files changed in 2.7.0 And I'm not sure that list.files(C:, full.names=TRUE) returns correct pathnames, because it lists the files in the current directory (of C:), not the root of C:. There is a difference between C: and C:/, and you should get: list.files(C:, full.names=TRUE) [1] C:aFile.txt [2] C:anotherFile.txt list.files(C:/, full.names=TRUE) [1] C:/Documents and Settings [2] C:/Program Files Now we get: list.files(C:, full.names=TRUE) [1] C:/aFile.txt [2] C:/anotherFile.txt list.files(C:/, full.names=TRUE) [1] C://Documents and Settings [2] C://Program Files This causes pathnames - list.files(C:, full.names=TRUE); file.exists(pathnames); to return all FALSE (not expected), whereas, pathnames - list.files(C:); file.exists(pathnames); returns all TRUE (expected). So, that extract slash seems to be the cause. My $.02 /Henrik On Fri, Jan 23, 2009 at 2:42 PM, dav...@rhotrading.com wrote: I just noticed a change in the behavior of list.files from 2.6.1pat to 2.7.0 (I noticed it in 2.8.1 and traced back.) Previously, if the directory ended with a slash, and full.names=TRUE, the names returned had a single slash at the end of the directory, but now there are two. I noticed since I was getting a list of certain files and then grepping in the list for a full name formed with a single slash. (The double slash would be OK if I were opening the file since the OS treats double slash in a path the same as a single slash.) I searched through the release notes, etc., and couldn't find this announced. Try list.files(C:, full.names=TRUE) list.files(C:/, full.names=TRUE) Is there any chance that this could be put back to the single slash behavior? (This was on Windows XP.) Thanks, David L. Reiner __ R-help@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. __ R-help@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. __ R-help@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.
Re: [R] counting entries in vector
Try: table(k)[rank(unique(k))] -ian Armin Meier wrote: Hi all, I've a vector with entries, which are all of the same type, e.g. string: k - c(bb, bb, bb, aa, cc, cc) and want to create a second vector containing the number of each entry in k in the same order as in k, i.e. c(3, 1, 2) or: k - c(5,5,5,5,2,2,4) = c(4,2,1) thanks __ R-help@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. -- View this message in context: http://www.nabble.com/counting-entries-in-vector-tp21832564p21833066.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] Statistics today on xkcd
http://xkcd.com/539/ Not entirely on topic here, but how often do you see a box plot in a cartoon? __ R-help@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.
Re: [R] counting entries in vector
Try: table(k) On Wed, Feb 4, 2009 at 1:19 PM, axionator axiona...@gmail.com wrote: Hi all, I've a vector with entries, which are all of the same type, e.g. string: k - c(bb, bb, bb, aa, cc, cc) and want to create a second vector containing the number of each entry in k in the same order as in k, i.e. c(3, 1, 2) or: k - c(5,5,5,5,2,2,4) = c(4,2,1) thanks __ R-help@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. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O [[alternative HTML version deleted]] __ R-help@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.
[R] Odp: Factor and Lm functions
Hi r-help-boun...@r-project.org napsal dne 04.02.2009 12:33:57: Hei, I have a formula for a model as follows lm(TS~log(BodyWt)+log(BodyWt):factor(D). I do not use R for programming hence I dont understand what is the second covariate in the model log(BodyWt):factor(D). Where BodyWt = body weight and D = danger index (either 1 or 2). I want to run the same model in other program. Can anyone explain me what is doing the : operator and the factor() function. Factor changes D from numeric (1,2) to factor with levels 1 and 2. As a result from lm with such specified model you shall get one intercept and 2 slopes one for level 1 and second for level 2 of D see x-1:20 A-sample(1:2, 20, replace=T) y-10+x*5*(A==1)+x*12*(A==2)+rnorm(20) fit-lm(y~x+x:factor(A)) plot(x,y) summary(fit) lines(x, 9.38+x*5.07268) lines(x, 9.38+x*5.07268+x*6.98) Regards Petr Thanks -- View this message in context: http://www.nabble.com/Factor-and-Lm-functions- tp21828771p21828771.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. __ R-help@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.
Re: [R] Problems in Recommending R
Hadley put together a couple of nice versions of the main Windows download page cran.r-project.org/bin/windows/base, and I've adopted one of them for the release, and the patched and devel snapshot builds. They should show up on CRAN in a few hours. Thanks a lot for the contribution, Hadley: I hope you also get involved in the larger CRAN redesign mentioned elsewhere in this thread. Duncan Murdoch On 2/3/2009 9:20 AM, hadley wickham wrote: Again I'd disagree, perhaps the most widely used suite of software has a very simple and clean web-site with few bells and whistles, ditto for one of the most popular text-editors. I am of course referring to the suite of GNU utilities (http://www.gnu.org/) that make a working GNU/Linux distribution and Emacs (http://www.gnu.org/software/emacs/ ). I like the R web-site, its clean and simple, present key information prominently (manuals, docs, CRAN, RNew and mailing lists). Have you ever used the R website? To download the latest version for R for windows you have to: 1. avoid clicking on the R version 2.8.1 link - that takes you to a directory listing of strangely named files 2. recognise that you need to click on an CRAN (what is a cran?) 3. successfully select a mirror that is up-to-date (with no information about which mirrors are up-to-date) 4. click Windows (ok, this one is easy) 5. guess that base is the distribution that you want 6. phew, you're there (but don't follow the advice to download from a mirror near you or you'll be back at step 3) And then if you want to email the url of that page to someone else you have to jump through hoops because it's embedded in a frame. Hadley __ R-help@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.
Re: [R] Large file size while persisting rpart model to disk
On Wed, 4 Feb 2009, Duncan Murdoch wrote: One correction below, and a suggested alternative approach. On 2/4/2009 9:31 AM, Terry Therneau wrote: In R, functions remember their entire calling chain. The good thing about this is that they can find variables further up in the nested context, i.e., mfun - function(x) { x+y} will look for 'y' in the function that called myfun, then in the function that called the function, on up and then through the search() list. This makes life easier for certain things such as minimizers. This description is not right: it's not the caller, it's the environment where mfun was created. So it applies to nested functions (as you said), but the caller is irrelevant. The bad thing is that to make this work R has to remember all of the variables that were available up the entire chain, and 99-100% of them aren't necessary. (Because of constructs like get(varname) a parser can't read the code to decide what might be needed). I'm not sure what you mean by chain here, but the real issue is that all the variables in the function that creates mfun will be kept as long as mfun exists. This is an issue with embedded functions. I recently noticed an extreme case of it in the pspline routine and made changes to fix it. The short version pspline(x, ...other args) { some computations to define an X matrix, which can be large define a print function ... return(X, printfun, other stuff) } So here printfun captures all the local variables in pspline, even if it doesn't need them. It's even worse in the frailty functions, where X can be VERY large. The print function's environment wanted to 'remember' all of the temporary work that went into defining X, plus X itself and so would be huge. My solution was add the line environment(printfun) - new.env(parent=baseenv()) which marks the function as not needing anything from the local environment, only the base R definitions. This would probably be a good addition to rpart, but I need to look closer. My first cut was to use emptyenv(), but that wasn't so smart. It leaves everything undefined, like + for instance. :-) Another approach is simply to rm() the variables that aren't needed before returning a function. For example, this function has locals x and y, but only needs y for the returned function to work: fnbuilder - function(n) { +x - numeric(n) +y - numeric(n) +noneedforx - function() sum(y) +rm(x) +return(noneedforx) + } f - fnbuilder(1) f() [1] 0 I would discourage the use of rm() here as it changes at runtime the variables that are defined for subsequent expressions. It isn't a problem here since nothing much happens after the rm but in general it can complicate reading the code for humans or analyzing the code programmatically. It is possible that using rm inside a function may not be fully supported under all circumstances in the future. (E.g. it might signal an error in compiled code or might inhibit useful compilation or something along those lines.) My preference in situations where I need to control the captured environment is to lift the code constructing the closure to the top level of the package, so continuing with this example that would mean defining an auxiliary function that creates the closure, something like fnbuilder_y_only - function(y) function() sum(y) fnbuilder - function(n) { x - numeric(n) y - numeric(n) noneedforx - fnbuilder_y_only(y) return(noneedforx) } This approach also has the advantage that the environment only captures what you explicitly provide, whereas with rm you risk forgetting to take out something large in more complicated code. In principle it is possible to analyze the code of the closure function and only capture bindings that might be needed, but with R's semantics allowing functions to look into callers and such pretty much anything 'might be needed' unless we provide some sort of declaration mechanism for saying, for example, only explicitly referenced variables are to be considered needed. Best, luke To see what actually got carried along with f, use ls(): ls(environment(f)) [1] n noneedforx y So we've picked up the arg n, and our local copy of noneedforx, but we did manage to get rid of x. (The local copy costs almost nothing: R will just have another reference to the same object as f refers to. The arg could have been rm'd too, if it was big enough to matter.) Duncan Murdoch Terry Therneau __ R-help@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.
Re: [R] Passing data among multiple instances
--- On Wed, 2/4/09, Feng Li 840...@gmail.com wrote: From: Feng Li 840...@gmail.com Subject: Re: [R] Passing data among multiple instances To: Warren Young war...@etr-usa.com Cc: r-help@r-project.org Date: Wednesday, February 4, 2009, 10:19 AM On Wed, Feb 4, 2009 at 4:02 PM, Warren Young war...@etr-usa.com wrote: Feng Li wrote: I have two R instances running at the same time, On the same computer, or on different computers? The first trial is only on my single computer with Quad CPU and more than 2G mem. Is the number of Rs likely to change, or will it always be just the two? I am planning to do three tasks at same time. That will be instance A, instance B and instance C. There tasks are more or less the same. But one always depends on others results. Is this a simple one-off problem, or are you breaking the problem up into pieces so you can throw lots of hardware at it? This is just for one project. But if this is available, later I will try more on this! Is there a simpler way to pass the data in A to B? Perhaps the simplest option is to write the data structure to a file, using any of the several R ways to do that. When instance 2 sees that a file is available, it slurps its contents in and works on it. The hard part is making the second instance wait until the whole file is written out by the first. You wouldn't want it to read in half the file then hit the end because the first process hasn't finished writing out the file. I don't see any good mechanism in R to fix this. actually, could this be fixed this way: Instance B waits on instance A for a signal file. Instance A first writes the data file as usual (the file you mentioned above). After instance A finishes the data file, it writes a signal file. Instance B checks on signal file existence but it works on the data file. A more robust option is to use sockets. This is suitable even within a single machine. See ?make.socket. This solves the how do I know when I've got the full data structure problem because the second process can just keep reading until it gets an error indicating that the remote peer closed the connection. Once you have the data structure in string form, you can eval() it to get an R object suitable for munching on. Figuring out how to pass the data might be the hardest part. deparse() might be the easiest way. If you're hoping to scale this up to lots of processes, look into Rmpi. This provides a very clean way for an R program on one computer to start slaves on other computers and then pass data to them in native R structures. Setting up MPI itself is not trivial, however. It's best when you already have a cluster of computers linked with MPI. __ R-help@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. -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden [[alternative HTML version deleted]] __ R-help@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. [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Problems in Recommending R
One of my colleagues is a interdisciplinary PhD in Design and Psychology and he has an in with a design school where we might be able to get students to take on the redesign of the website. Thanks a lot, sounds exactly like what we need. If they don't succeed we can always by time from a professional afterwards. But I'd say let's give them a shot. For the students it should be more thrilling to work on a site that gets thousands of hits per day rather than redoing the menu of the school, cafeteria ;-) It might be good to put some mild restriction on the design: * should be valid (x)html and css * use the YUI css grid framework for layout * use jquery for any (subtle) animated or interactive effects Hadley -- http://had.co.nz/ __ R-help@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.
Re: [R] How to declare an array with columns storing different datatypes/precision
On 2/4/2009 8:57 AM, Suresh_FSFM wrote: Dear R- Experts, Seek your help. I want to creata data as follows. Ref_array with 4 columns. 1st column should store data of precision: 8.4 (i.e. 8 digits before decimal point and 4 digits after decimal points) 2nd column: should store data of type date -mm-dd hh:mm:ss 3rd column: only integer value. No decimal points 4th column: percentage values In R, an array is all one data type, so you can't do that. However, you can have a dataframe that comes close: but there is no special type for 8.4 or percentage values, you'd need to use floating point (or fancy handling of integers) for those. Duncan Murdoch __ R-help@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.
Re: [R] How to import HTML and SQL files
Arup wrote: I can't import any HTML or SQL files into R..:confused: Yeah, I'm confused, too. What exactly is it you're trying to do? Not the technical task you asked about, but the effect you're trying to achieve? Can you give details about the exact nature of your data sources, or, better, examples? I ask because actually importing HTML and SQL files is almost certainly the wrong approach. You almost never want to handle texts in either language directly in R. For SQL, you usually don't have SQL files: files literally containing SQL queries. Or if you do happen to have SQL query files, you probably don't want to parse them with R. I expect what you really want is to be able to query a database using SQL. For that, look up DBI on CRAN. This will let you connect R to a database server, and use SQL to get data from it in a format that R can process directly. For HTML, the problem is that HTML is a very difficult language to parse correctly in the general case. Much of the reason for that is that few web pages are actually legal HTML, but browsers will quietly cope with many classes of errors. To parse such stuff in R, it's usually best to take a case-by-case approach, matching particular structures within the file so you can extract the few bits of data you want. You might want to post a snippet of the HTML here to get suggestions. If you really do have to be able to accept arbitrary HTML, I'd suggest running the HTML through a filter that converts it to XHTML, then use the XML package from CRAN to load it up into R. You might also want to look into the RCurl package, if the HTML lives on a web server. You can download it directly instead of saving it out to an HTML file. Then you can use the methods above to process it. __ R-help@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.
Re: [R] ggplot: problem with fill option in stat_smooth()
On Wed, Feb 4, 2009 at 9:12 AM, Ian Fiske ianfi...@gmail.com wrote: Hi all, I am using ggplot2 and continuing to find it very useful and pretty. However, I am trying to create some graphics for publication that would be included in an MS Word document (not my choice!) in Windows Vista. The problem is that I want to use stat_smooth() to add an fitted linear model line along with its 95% confidence band, but I cannot seem to get the confidence band in a format that would import into Word. I have read the documentation and am using the fill=grey50 argument to eliminate transparency as a potential problem. But still, I have tried nearly all export formats and the only one that correctly shows the confidence band is PDF, which I cannot import into Word as a vector graphic. This makes me wonder if the fill=grey50 option is working as advertised. Here is a simple example using the mtcars data set included with ggplot2: qplot(wt,mpg,data=mtcars) + stat_smooth(fill=grey50) It's not - you actually need alpha = 1. I'll make a note to fix the documentation. Hadley -- http://had.co.nz/ __ R-help@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.
Re: [R] ggplot: problem with fill option in stat_smooth()
Ian: It would work if you copy it as a bitmap. Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish Wildlife Service California, USA --- On Wed, 2/4/09, Ian Fiske ianfi...@gmail.com wrote: From: Ian Fiske ianfi...@gmail.com Subject: [R] ggplot: problem with fill option in stat_smooth() To: r-help@r-project.org Date: Wednesday, February 4, 2009, 7:12 AM Hi all, I am using ggplot2 and continuing to find it very useful and pretty. However, I am trying to create some graphics for publication that would be included in an MS Word document (not my choice!) in Windows Vista. The problem is that I want to use stat_smooth() to add an fitted linear model line along with its 95% confidence band, but I cannot seem to get the confidence band in a format that would import into Word. I have read the documentation and am using the fill=grey50 argument to eliminate transparency as a potential problem. But still, I have tried nearly all export formats and the only one that correctly shows the confidence band is PDF, which I cannot import into Word as a vector graphic. This makes me wonder if the fill=grey50 option is working as advertised. Here is a simple example using the mtcars data set included with ggplot2: qplot(wt,mpg,data=mtcars) + stat_smooth(fill=grey50) I even tried the Cairo library as one R-help post suggested, but to no avail. Any suggestions? Thanks much, Ian Fiske -- View this message in context: http://www.nabble.com/ggplot%3A-problem-with-fill-option-in-stat_smooth%28%29-tp21832398p21832398.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. __ R-help@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.
Re: [R] Passing data among multiple instances
On Wed, Feb 4, 2009 at 4:02 PM, Warren Young war...@etr-usa.com wrote: Feng Li wrote: I have two R instances running at the same time, On the same computer, or on different computers? The first trial is only on my single computer with Quad CPU and more than 2G mem. Is the number of Rs likely to change, or will it always be just the two? I am planning to do three tasks at same time. That will be instance A, instance B and instance C. There tasks are more or less the same. But one always depends on others results. Is this a simple one-off problem, or are you breaking the problem up into pieces so you can throw lots of hardware at it? This is just for one project. But if this is available, later I will try more on this! Is there a simpler way to pass the data in A to B? Perhaps the simplest option is to write the data structure to a file, using any of the several R ways to do that. When instance 2 sees that a file is available, it slurps its contents in and works on it. The hard part is making the second instance wait until the whole file is written out by the first. You wouldn't want it to read in half the file then hit the end because the first process hasn't finished writing out the file. I don't see any good mechanism in R to fix this. A more robust option is to use sockets. This is suitable even within a single machine. See ?make.socket. This solves the how do I know when I've got the full data structure problem because the second process can just keep reading until it gets an error indicating that the remote peer closed the connection. Once you have the data structure in string form, you can eval() it to get an R object suitable for munching on. Figuring out how to pass the data might be the hardest part. deparse() might be the easiest way. If you're hoping to scale this up to lots of processes, look into Rmpi. This provides a very clean way for an R program on one computer to start slaves on other computers and then pass data to them in native R structures. Setting up MPI itself is not trivial, however. It's best when you already have a cluster of computers linked with MPI. __ R-help@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. -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden [[alternative HTML version deleted]] __ R-help@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.
Re: [R] The Origins of R
Patrick Burns wrote: My reaction to the section of the original NYT article under discussion was that it was a disjointed mess due to editing rather than a slight to anyone anywhere. I think that is pretty much spot on. I can imagine Ross or Robert explaining why they couldn't use S-PLUS for computer labs in 1992: The licences were too expensive, and the whole thing was designed to run on Unix workstations or terminals connected to a department minicomputer, plus there was this issue that it stored all variables in files, causing a harddisk bottleneck. Filter that through a journalist and he might well come up with a simplified wording like we see in the article. (The scary bit is that this sort of thing occurs almost every time we happen to know the actual background behind news stories, but still we tend to believe the information we get from the press in any other matter.) -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907 __ R-help@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.
[R] How to import HTML and SQL files
I can't import any HTML or SQL files into R..:confused: Please suggest me the packages for these two file types and also let me know the syntax for importing these two type of files. Thank you in advance. Arup -- View this message in context: http://www.nabble.com/How-to-import-HTML-and-SQL-files-tp21830945p21830945.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] ggplot: problem with fill option in stat_smooth()
Maybe you could try to open the pdf in Inkscape http://www.inkscape.org/ and export it as a .emf or .png ? Etienne Ian Fiske a écrit : Hi all, I am using ggplot2 and continuing to find it very useful and pretty. However, I am trying to create some graphics for publication that would be included in an MS Word document (not my choice!) in Windows Vista. The problem is that I want to use stat_smooth() to add an fitted linear model line along with its 95% confidence band, but I cannot seem to get the confidence band in a format that would import into Word. I have read the documentation and am using the fill=grey50 argument to eliminate transparency as a potential problem. But still, I have tried nearly all export formats and the only one that correctly shows the confidence band is PDF, which I cannot import into Word as a vector graphic. This makes me wonder if the fill=grey50 option is working as advertised. Here is a simple example using the mtcars data set included with ggplot2: qplot(wt,mpg,data=mtcars) + stat_smooth(fill=grey50) I even tried the Cairo library as one R-help post suggested, but to no avail. Any suggestions? Thanks much, Ian Fiske [[alternative HTML version deleted]] __ R-help@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.
[R] Problem installing ad administrating packages
Hello R-User! I am running R 2.8.1 on an Intel Mac. I just tried to install a package using the GUI and got the following error message: Fehler in if (14 + nchar(dcall, type = w) + nchar(sm[1], type = w) : Fehlender Wert, wo TRUE/FALSE nötig ist Error in (14 + nchar(dcall, type = w) + nchar(sm[1], type = w) : missing value, where TRUE/FALSE is necessary also if I try to look at my installed packages using GUI Fehler in .readRDS(pfile) : unbekanntes Eingabeformat Error in .readRDS(pfile) : unknown enter format. Some days ago I used a different working directory and now came back to my usual one. Don`t know if this causes the error. I would be very grateful if somebody could help me. Many thanks in advance B. - The art of living is more like wrestling than dancing. (Marcus Aurelius) -- View this message in context: http://www.nabble.com/Problem-installing-ad-administrating-packages-tp21834632p21834632.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] data editor in R- could it be improved?
Hi ! I am using Tinn R data editor. This is wonderful and also thin one. Try this. I guess, yu will find what you are looking for. Regards, Suresh Simon Pickett-4 wrote: Hi all, I've used R for basic programming and data management for a few years now. One of the things that I think could be improved is the data editor. Its a great feature and I use it alot by calling edit(data.frame); very useful to see if what you tried to do actually worked. However, one of the annoying things about it is that when you scroll down the window it doesnt show you all the data (for a large data frame), just subsets of it. It would also be quite useful if the width of the columns could be adjusted or didnt default to the size of the name of the column. (since the names might often be very big if the data frame was created using a function). Side-ways scrolling is quite jerky too. Just wondered if this was on anyone else's wish list? Simon. Dr. Simon Pickett Research Ecologist Land Use Department Terrestrial Unit British Trust for Ornithology The Nunnery Thetford Norfolk IP242PU 01842750050 [[alternative HTML version deleted]] __ R-help@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. -- View this message in context: http://www.nabble.com/data-editor-in-R--could-it-be-improved--tp21831077p21834015.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Sweave
cameron.bracken wrote: Kjetil Halvorsen wrote: The other problem refered to above comes from this source lines: bubble(NURE.orig, ppm, col = c(#00ff0088, #00ff0088)) You may have to escape the # character (i.e. put \# instead). I know this must be done for backslashes. That shouldn't be a problem in Sweave, and in fact \# will give a warning. I missed the start of the thread, but if the problem is about how some editor handles Sweave, then that's a bug in the editor. Duncan Murdoch __ R-help@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.
Re: [R] D'Hondt method
Hello, I believe that a productionized version of the following would do: dHont - function( candidates, votes, seats ){ tmp - data.frame( candidates = rep( candidates, each = seats ), scores = as.vector(sapply( votes, function(x) x / 1:seats )) ) tmp - tmp$candidates[order( - tmp$scores )] [1:seats] table(tmp) } votes - sample(1:1, 5) votes [1] 448 7685 5445 482 6266 dHont(letters[1:5], votes, 10 ) tmp a b c d e 0 4 3 0 3 Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com On Wed, 2009-02-04 at 12:16 +0100, Thomas Steiner wrote: Is there a R function to calculate the seats in parliament given the total number of seats and the votes for each party -- for different methods including the method of D'Hont? http://en.wikipedia.org/wiki/D%27Hondt_method Thanks, thomas __ R-help@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. __ R-help@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.
Re: [R] data editor in R- could it be improved?
There are three different data editors, so you will need to start by telling us your OS (and the other details asked for in the posting guide). But this is really an R-devel question, and that is where offers to work on this (or to sponsor such work) should be posted. As the author of one version and of a major revision of another, I have no interest in touching the code again. On Wed, 4 Feb 2009, Simon Pickett wrote: Hi all, I've used R for basic programming and data management for a few years now. One of the things that I think could be improved is the data editor. Its a great feature and I use it alot by calling edit(data.frame); very useful to see if what you tried to do actually worked. However, one of the annoying things about it is that when you scroll down the window it doesnt show you all the data (for a large data frame), just subsets of it. It would also be quite useful if the width of the columns could be adjusted or didnt default to the size of the name of the column. (since the names might often be very big if the data frame was created using a function). Side-ways scrolling is quite jerky too. Just wondered if this was on anyone else's wish list? Simon. Dr. Simon Pickett Research Ecologist Land Use Department Terrestrial Unit British Trust for Ornithology The Nunnery Thetford Norfolk IP242PU 01842750050 [[alternative HTML version deleted]] __ R-help@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. -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@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.
Re: [R] Upgrading to TINN - R 2.1.1.6
Glad your problem is solved, I am in California and I grew up around the Mazatlan area so I won't be seing Hector for a while ;-) --- On Wed, 2/4/09, steve_fried...@nps.gov steve_fried...@nps.gov wrote: From: steve_fried...@nps.gov steve_fried...@nps.gov Subject: Re: [R] Upgrading to TINN - R 2.1.1.6 To: mazatlanmex...@yahoo.com Date: Wednesday, February 4, 2009, 6:03 AM Felipe, Thank you it works ! Life is Good. Hey I have a friend from graduate school from Mexico - his name is Hector Franco-Lopez and he is a forest biometry specialists. If you run across him say hello for me. I believe he should be in Mexico City, but I could be wrong. Thanks for the help, Much appreciated. Steve Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 No problem Steve, I know what is like to be frustrated when things don't work right, I have been there a few times trying to figure how these programs run. OK, When I had the problem that you are having now, I unistalled Tinn-R, deleted everything from my Rprofile and re-installed Tinn-R. Try to do the same and after that,open R, click on 'packages', 'install packages' click on a mirror close to you (I usually use USA(CA 1)),then select Tinn-R and svSocket packages and click on OK. Now close R and Open Tinn-R. From the Tinn-R menu click on RConfigurePermanent ( this will open your Rprofile),delete everything from your Rprofile and then copy and paste the code that I sent you earlier. Next, click on R start/close and connections Rgui. If you are able to open R from Tinn-R, run a test from Tinn-R with something like plot(rnorm(100)).You need to be connected to the internet in order to download the above packages. This is the .strPaths..Make sure is no missing any quotations or commas.I copied it from my Rprofile so it should be correct. Let me know .trPaths - paste(paste(Sys.getenv('APPDATA'), '\\Tinn-R\\tmp\\', sep=''),c('', 'search.txt', 'objects.txt','file.r', 'selection.r', 'block.r','lines.r'), sep='') --- On Tue, 2/3/09, steve_fried...@nps.gov steve_fried...@nps.gov wrote: From: steve_fried...@nps.gov steve_fried...@nps.gov Subject: Re: [R] Upgrading to TINN - R 2.1.1.6 To: mazatlanmex...@yahoo.com Date: Tuesday, February 3, 2009, 12:29 PM Felipe, Sorry to be taking so much of your time. I copied and pasted the code as you provided it. when I start R from within Tinn-R, it opens a CRAN mirror site list asking that I select a mirror. After I select one, it returns the warnings and error messages shown next. --- Please select a CRAN mirror for use in this session --- Warning: unable to access index for repository http://lib.stat.cmu.edu/R/CRAN/bin/windows/contrib/2.8 Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.8 Warning message: packages ‘TinnR’, ‘svSocket’ are not available Error in library(TinnR) : there is no package called 'TinnR' You suggested that I make sure that the .trPath was correct. I have no idea how to determine this Any other suggestions ? Thanks Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 Felipe Carrillo wrote: Steve: Download the Tinn-r package from cran, then save your current Rprofile just in case something goes wrong(use notepad or something similar). After you have saved your Rprofile,copy the code below to the empty Rprofile. I had the same problem and after tweaking this code a bit now works great. Let me know if it works for you.. Make sure .trPaths is correct. # Tinn-R: necessary packages and functions # Tinn-R: = 2.0.0.1 #=== library(utils) # check necessary packages necessary = c('TinnR', 'svSocket') installed = necessary %in% installed.packages()[, 'Package'] if (length(necessary[!installed]) =1) install.packages(necessary[!installed], dep=T) # set options options(use.DDE=T) # uncoment the line below if you want Tinn-R starts # always R starts #options(IDE='C:/Tinn-R/bin/Tinn-R.exe') # load packages library(TinnR) library(svSocket) # start DDE trDDEInstall() .trPaths - paste(paste(Sys.getenv('APPDATA'), '\\Tinn-R\\tmp\\', sep=''), c('', 'search.txt', 'objects.txt', 'file.r', 'selection.r', 'block.r', 'lines.r'), sep='') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide