[R] Installing ROracle in windows.. Pls help
I have installed R 2.7.2 in windows, now i am trying to install R oracle... I am using Oracle 10g. i have downloaded the Roracle 0.5-9 sources, and i am trying to compile it using Vc++, i found from readme files and forum that, we need to use the makefile.win in the \src folder and nmake utility of vc++, since i have not worked with vc++, i don't have any idea , how to use the nmake utility, can anybody help me with the steps required in compiling the R oracle sources please.. ? -- View this message in context: http://www.nabble.com/Installing-ROracle-in-windows..-Pls-help-tp19912547p19912547.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] how to store lme/lmer fit result
Dear R users, I am building a hierarchical model on a large data set. It can take quite some time to finish one fit, I was just wondering whether it is possible to store the fit object (the result) to a file for later (offline) analysis. thanks Julia -- View this message in context: http://www.nabble.com/how-to-store-lme-lmer-fit-result-tp19910951p19910951.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] Spatstat - Several density plots using the same scale
Arthur Weiss wrote: Hi everyone, I am using the package spatstat for ploting kernel maps of my data. It is a marked point pattern, the result of mosquito surveillance in a area in a week. For each trap, the number of individuals captured is the mark of the point. plot(density(X, weights=X$marks)) makes a nice kernel, but the problem is that I've got several weeks and for each week the density is re-scaled, which makes comparisons useless. I've been trying to find some way to pass the scale limits to the function but just couldn't find. See help(plot.im) for information about how to plot a pixel image in spatstat. The argument 'zlim' controls the range of numerical values that are mapped to colours in the display. If you have, say, 4 pixel images Z1, Z2, Z3, Z4 and want to plot them all with the same colour map, try the following. Zlist - list(week1=Z1, week2=Z2, week3=Z3, week4=Z4) Zrange - range(unlist( lapply(Zlist, function(x){summary(x)$range}))) plot(as.listof(Zlist), zlim=Zrange, ncols=2) However, it's not clear that the command density() is really what you want to use in this context. This command estimates the spatially-varying average intensity (`density') of points. Are the insect traps at fixed locations that were chosen by the experimenter? If so, then it is somewhat meaningless to estimate their average density What you need is a method for spatially interpolating the insect counts (number of trapped insects) observed at these locations. In spatstat you can use the command 'smooth.ppp' to perform kernel-weighted spatial interpolation. If the insect counts are small, then it would be more appropriate to do spatial Poisson regression (using other packages). Adrian Baddeley __ 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] Credit Scoring Model - SPEC (specificity) and SENS (sensitivity)
Dear R helpers, Hi I am working on credit scoring model using logistic regression. I have main sample of 42500 clentes and based on their status as regards to defaulted / non - defaulted, I have genereted the probability of default. I have a hold out sample of 5000 clients. I have calculated (1) No of correctly classified goods Gg, (2) No of correcly classified Bads Bg and also (3) number of wrongly classified bads (Gb) and (4) number of wrongly classified goods (Bg). My prolem is how to interpret these results? What I have arrived at are the absolute figures. Using these I hav ecalculated Specificity (SPEC) and sensitivity (SENS) as SPEC = Bb / (Bb + Gg) and SENS = Gg / (Gg + Bg) With regards Maithili __ 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 store lme/lmer fit result
liujb liujulia7 at yahoo.com writes: I am building a hierarchical model on a large data set. It can take quite some time to finish one fit, I was just wondering whether it is possible to store the fit object (the result) to a file for later (offline) analysis. Like with any other R object, you can use save and load for this. 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] Correlation among correlation matrices cor() - Interpretation
Hello, If I have two correlation matrices (e.g. one for each of two treatments) and then perform cor() on those two correlation matrices is this third correlation matrix interpreted as the correlation between the two treatments? In my sample below I would interpret that the treatments are 0.28 correlated. Is this correct? var1- c(.0008, .09, .1234, .5670008, .00110011002200, 8, 9, 12.34, 56.7, 1015245698745859) var2- c(11, 222, 333, , 5, 1.1, 2.2, 3.3, 4.4, .55) var3 -c(22.2, 66.7, 99.9, 108, 123123, .1, .2, .3, .4, .5) var4- c(.01,.1,.0001, .001, .1, .12345, .56789, .67890, .78901, .89012) dat - cbind(var1,var2,var3,var4) dat.d - data.frame(dat) treatment1 - dat.d[1:5,] treatment2 -dat.d[6:10,] t1.d.cor - cor(treatment1) t2.d.cor - cor(treatment2) I -lower.tri(t1.d.cor) t1.t2 - cor(cbind(T1 = t1.d.cor[I], T2 = t2.d.cor[I])) t1.t2 T1T2 T1 1.000 0.2802750 T2 0.2802750 1.000 My code may be unpolished, Thanks, Michael [[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] help
Bing Shen wrote: Hello, I'm not sure this is doable but I'm having trouble running my R script with multithreaded capability. With 16x2.93Ghz CPUs available, only one is running with 100%. Any suggestions? Yes: Run 16 R jobs or use some other way to make your job parallel (e.g. the snow framework that can make use of several techniques for parallelization). Uwe Ligges Thanks, Bing My system configuration is: egenera virtual machine running Linux Red Hat Enterprise Linux Server release 5.1 (Tikanga) 16x2.93GHz CUPs 99G memory __ 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] nls, lattice, and conversion over to ggplot
It worked for me, do you have the latest version of ggplot2 released a few days ago (ggplot2_0.7) ? Baptiste On 9 Oct 2008, at 20:55, stephen sefick wrote: Error in `[.data.frame`(df, , var) : undefined columns selected I got this error in a fresh R session after rerunning all of the commands On Thu, Oct 9, 2008 at 3:45 PM, hadley wickham [EMAIL PROTECTED] wrote: On Thu, Oct 9, 2008 at 2:29 PM, stephen sefick [EMAIL PROTECTED] wrote: I am trying to figure out how to use ggplot2. I would like to do the below with ggplot, but I can not figure out how. The data provided is a subset of a much larger data set, but these data are the data necessary to make the plot. I think I would rather have the colors become symbols, and I do know how to do that in lattice, but here is a quick and dirty version. thanks Here's one way: pred - data.frame(GPP = f, TSS = y) qplot(TSS, GPP, data=r, colour=RiverMile) + geom_line(data=pred, colour =black) * ggplot2 works with data frames, so the key is to create one from your model predictions. Naming the variables to match the names of the model inputs makes sense, and saves some typing. * You no longer need to specify xlim because ggplot2 knows about everything you are plotting and can calculate the limits appropriately. * You have have to manually set the colour in geom_line to override the default mapping that you created between colour and RiverMile. Hadley -- http://had.co.nz/ -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[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] formal argument axes matched by multiple actual arguments
I don't know where you got the idea that 'axes' was a valid argument. From ?plot.Sample ...: further graphical parameters. and 'axes' is *not* a graphical parameter. (It also suggests you call plot, not plot.Sample.) 'xaxt' and 'yaxt' are graphics parameters which control whether axes are plotted, but this will not help in this case since plot.Sample calls axis() directly. You need to take a copy of the function and modify it to suit your needs (and perhaps contribute your improvements back to the maintainer?). On Fri, 10 Oct 2008, rajesh j wrote: Hi, I'm using the add-on package sound.I have the following q-loadSample(a.wav) plot.Sample(q,axes=FALSE) this gives me the error. Error in plot.default(sound(s)[1, ], type = l, col = red, ylim = c(-1, : formal argument axes matched by multiple actual arguments I'm guessing the package has some predefined arguments.How do I overwrite them? -- Rajesh.J [[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, [EMAIL PROTECTED] 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] Multi-scale SSA (singular spectrum analysis)
Hi everybody! I am searching for an R implementation of multi-scale SSA (singular spectrum analysis), which was introduced by Yiou etal (2000) (Data-adaptive wavelets and *multi*-*scale *singular-spectrum analysishttp://linkinghub.elsevier.com/retrieve/pii/S016727890452) and further described in Ghil etal (2002). For SSA alone I found an package recently published on r-forge: http://r-forge.r-project.org/projects/simsalabim/ I am happy about any suggestions! Maik [[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] Correlation among correlation matrices cor() - Interpret
On 10-Oct-08 08:07:34, Michael Just wrote: Hello, If I have two correlation matrices (e.g. one for each of two treatments) and then perform cor() on those two correlation matrices is this third correlation matrix interpreted as the correlation between the two treatments? In my sample below I would interpret that the treatments are 0.28 correlated. Is this correct? var1- c(.0008, .09, .1234, .5670008, .00110011002200, 8, 9, 12.34, 56.7, 1015245698745859) var2- c(11, 222, 333, , 5, 1.1, 2.2, 3.3, 4.4, .55) var3 -c(22.2, 66.7, 99.9, 108, 123123, .1, .2, .3, .4, .5) var4- c(.01,.1,.0001, .001, .1, .12345, .56789, .67890, .78901, .89012) dat - cbind(var1,var2,var3,var4) dat.d - data.frame(dat) treatment1 - dat.d[1:5,] treatment2 -dat.d[6:10,] t1.d.cor - cor(treatment1) t2.d.cor - cor(treatment2) I -lower.tri(t1.d.cor) t1.t2 - cor(cbind(T1 = t1.d.cor[I], T2 = t2.d.cor[I])) t1.t2 T1T2 T1 1.000 0.2802750 T2 0.2802750 1.000 My code may be unpolished, Thanks, Michael You cannot conclude that, because corresponding elements of two correlation matrices are correlated, the two sets of variables that they were derived from are correlated (between the two sets). Here (in R) is an example of the contrary. One set of 4 variables (X1, X2, X3, X4) is such that there are correlations (by construction) between X1, X2, X3, X4. The other set of four variables Y1, Y2, Y3, Y4 is constructed in the same way. But the four variables (X1,X2,X3,X4) are independent of the four variables (Y1,Y2,Y3,Y4) and hence the two sets are not correlated. Nevertheless, the correlation matrix (analagous to your t1.t2) between the corresponding elements of the two correlation matrices is in general quite high. N - 500 ; Cors - numeric(N) for(i in (1:500)){ X1-rnorm(10);X2-rnorm(10);X3-rnorm(10);X4-rnorm(10) V1-X1; V2-X1+X2; V3-X1+X2+X3; V4-X1+X2+X3+X4 D-cor(cbind(V1,V2,V3,V4)) Y1-rnorm(10);Y2-rnorm(10);Y3-rnorm(10);Y4-rnorm(10) W1-Y1; W2-Y1+Y2; W3-Y1+Y2+Y3; W4-Y1+Y2+Y3+Y4 E-cor(cbind(W1,W2,W3,W4)) I - lower.tri(D) D.E - cor(cbind(D=D[I],E=E[I])) Cors[i] - D.E[2,1] } hist(Cors) In any case, with the distribution of values exhibited by some of your variables, even the primary correlation matrices are of very questionable interpretability. Indeed, I wonder, if these are real data, what on Earth (literally) they are data on? The ratio of the largest to the smallest of, for instance, your var1 is (approx) 10^26. A cup of small cup of Espresso coffee is about 60 grams (2 ounces). 60 gm * 10^26 = 6*(10^27) gm = 6*(10^24) kg, which is the mass of the Earth. Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 10-Oct-08 Time: 11:40:50 -- XFMail -- __ 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] histogram loses top row with alpha transparency under Windows
Richard.Cotton wrote: The rectangles being drawn extend higher than the top of the panel. (Your y axis ranges from 0 to 50, but the bars go up to 100.) Thankyou - I can also make the bars on the lower panels vanish by tinkering with ylim. In the top row of plots, depending upon the shape of your device window, the bars can extend beyond the range of the device window. For some reason, (take a look in panel.rect), when you specify alpha less than 1, this prevents the bar being drawn. The problem lies deeper. I can demonstrate the same effect with raw grid calls (but cannot find a way into grid.draw to see what is going on): cols - rainbow(2,alpha=0.5) library(grid) grid.newpage() pushViewport(plotViewport(c(5,4,2,2))) # draw viewport limits: grid.rect() # VISIBLE: small projection outside viewport, transparent fill and edge grid.rect(gp=gpar(fill=cols[2],col=cols[1]),height=unit(1.1,npc),width =unit(0.18,npc),x=0.1) # VISIBLE: small projection outside viewport, standard colours fill and edge grid.rect(gp=gpar(fill=2,col=3),height=unit(1.1,npc),width=unit(0.18, npc),x=0.3) # INVISIBLE: larger projection outside viewport, transparent colours fill and edge grid.rect(gp=gpar(fill=cols[2],col=cols[1]),height=unit(1.5,npc),width =unit(0.18,npc),x=0.5) # VISIBLE: larger projection outside viewport, standard colours fill and edge grid.rect(gp=gpar(fill=2,col=3),height=unit(1.5,npc),width=unit(0.18, npc),x=0.7) # MIXED: larger projection outside viewport, standard colour edge visible, transparent fill not grid.rect(gp=gpar(fill=cols[2],col=3),height=unit(1.5,npc),width=unit( 0.18,npc),x=0.9) I can also show the same effect using standard graphics calls: par(xpd=NA) plot(c(1,2)) rect(1.01,1,1.19,2.2,border=cols[1],col=cols[2]) rect(1.21,1,1.39,2.2,border=3,col=2) rect(1.41,1,1.59,4,border=cols[1],col=cols[2]) rect(1.61,1,1.79,4,border=3,col=2) rect(1.81,1,1.99,4,border=3,col=cols[2]) Both of these examples have missing alpha transparency colours under Windows but produce the expected filled rectangles under Linux. You need to add type=count to the call to histogram, or rescale the bar heights. My post was a rather simplified example - I am actually trying to make visible a small distribution on the skirt of a large one, which means that scaling the bar heights is not sufficient. I have worked around the problem by modifying panel.histogram to _clip_ the bar heights. Keith Keith Ponting Aurix Ltd, Malvern WR14 3SZ UK __ 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] Creating GUIs for R
I haven't heard Rpad mentioned yet, so I will mention it. Rpad allows you to run R code inside a browser window. You can many any kind of GUI you want using html forms and then call the R function from the html page. The Apache/Rpad install works on any platform and anyone who uses it just need a browser. I use it at my work to make my R function available to everyone else (none of whom know R). Very happy with it. Good luck, Roger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [Ricardo Rodriguez] Your XEN ICT Team Sent: Thursday, October 09, 2008 5:05 PM To: Greg Snow Cc: Antonio Martinez Cortizas; [EMAIL PROTECTED]; Wade Wall Subject: Re: [R] Creating GUIs for R Thanks Greg, Greg Snow wrote: I am not involved in the RExcel project. I have just had some discussions with the people that are, so you should contact them for specific questions. I believe that this currently only works on windows, there was some mention of possibly expanding it to OpenOffice so that it would be cross platform, but I have no idea if that has made it past the good idea stage. If we must away from Excel, don't you think that Gnumeric/R could be a nice option? Cheers, Ricardo -- Ricardo Rodríguez Your XEN ICT Team __ 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. ** * This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No right to confidential or privileged treatment of this message is waived or lost by any error in transmission. If you have received this message in error, please immediately notify the sender by e-mail, delete the message and all copies from your system and destroy any hard copies. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient. __ 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] multi-scale singular spectrum analysis (SSA)
wmtsa has some wavelet processing things, but It sounds like you need a very specific implementation. Sorry I would not be of more help- good luck. Stephen On Fri, Oct 10, 2008 at 7:26 AM, Maik Renner [EMAIL PROTECTED] wrote: Hi everybody! I am searching for an R implementation of multi-scale singular spectrum analysis (SSA), which was introduced by Yiou etal (2000) (Data-adaptive wavelets and multi-scale singular-spectrum analysis) and further described in Ghil etal (2002). For SSA alone I found an package recently published on r-forge: http://r-forge.r-project.org/projects/simsalabim/ I am happy about any suggestions! Maik __ 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. -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis __ 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] rgl-snapshot failed (err-msg: failed)
Zitat von Duncan Murdoch [EMAIL PROTECTED]: On 10/10/2008 8:13 AM, Oliver Bandel wrote: Hello, I tried to use rgl.snapshot and it failed. The error message was not very verbose: == plot3d( motion[[idx+2]], motion[[idx+1]], motion[[idx]] ) rgl.snapshot(filename=/tmp/shot_01.png, fmt=png) [1] failed == There was a graphic created by rgl, but the snapshot was not created. The same problem occurs, when I use example(rgl.snapshot) The graphic/animation will be created, but there is no possibility to create the output-files. I use R version 2.4.0 Patched (2006-11-25 r39997). Is this a problem of this old version? or is there maybe a general problem, independent of the version? This is a problem with the build. rgl is not easy to build, because it links to a lot of external libraries. In this case it looks as though your build (the one from R-forge? You should say...) did not link to libpng. [...] I installed a binary (Debian etch). I may try the same things at my laptop. There I have Ubuntu, and it uses much newer R versions. maybe they also have fixed this problem. If the error messages would be a littlebid more verbose, this could help. Is it possible to configure the verboseness of the error messages? Ciao, Oliver __ 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] Credit Scoring Model - SPEC (specificity) and SENS (sensitivity)
Maithili Shiva wrote: Dear R helpers, Hi I am working on credit scoring model using logistic regression. I have main sample of 42500 clentes and based on their status as regards to defaulted / non - defaulted, I have genereted the probability of default. I have a hold out sample of 5000 clients. I have calculated (1) No of correctly classified goods Gg, (2) No of correcly classified Bads Bg and also (3) number of wrongly classified bads (Gb) and (4) number of wrongly classified goods (Bg). My prolem is how to interpret these results? What I have arrived at are the absolute figures. Using these I hav ecalculated Specificity (SPEC) and sensitivity (SENS) as SPEC = Bb / (Bb + Gg) and SENS = Gg / (Gg + Bg) With regards Maithili Sensitivity and specificity have no usefulness in your situation as they are in reverse time order (condition on the unknown and fail to condition on what was already known). Your test sample is too small. You are not addressing absolute calibration through precise high-resolution methods. My book Regression Modeling Strategies goes into this. Frank -- 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.
[R] rgl-snapshot failed (err-msg: failed)
Hello, I tried to use rgl.snapshot and it failed. The error message was not very verbose: == plot3d( motion[[idx+2]], motion[[idx+1]], motion[[idx]] ) rgl.snapshot(filename=/tmp/shot_01.png, fmt=png) [1] failed == There was a graphic created by rgl, but the snapshot was not created. The same problem occurs, when I use example(rgl.snapshot) The graphic/animation will be created, but there is no possibility to create the output-files. I use R version 2.4.0 Patched (2006-11-25 r39997). Is this a problem of this old version? or is there maybe a general problem, independent of the version? Any ideas? Best, oliver __ 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] formal argument axes matched by multiple actual arguments
Hi, I'm using the add-on package sound.I have the following q-loadSample(a.wav) plot.Sample(q,axes=FALSE) this gives me the error. Error in plot.default(sound(s)[1, ], type = l, col = red, ylim = c(-1, : formal argument axes matched by multiple actual arguments I'm guessing the package has some predefined arguments.How do I overwrite them? -- Rajesh.J [[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] Plot grouped histograms
[EMAIL PROTECTED] wrote: r11 -- r16 are variables showing a reason for usage of a product in 6 different situations. Each variable is a factor with 4 levels imported from a SPSS sav file with labels ranging from not important to very important, and NA's for a sample of N = 276. (1) I need a chi square test of independence showing that the reason does not differ depending on the situation. (2) I need a single coloured histogram plot. The x axis should be grouped by the 6 situation with small space between the groups, each group should show different bars for each factor value (not important, little..., ..., NA's), but NA's is not necessary. I've been googling the whole day, searching the mailing list and handbooks, and struggled through the somewhat R programmer specific documentation. Beeing a newby in R, I'm now afraid that I have to go back to SPSS and Excel where my tasks would be a work of an hour. But I was told euphoric that R may solve many of the problems I have (and don't like) with SPSS, or having to separate calculation (SPSS, Excel by hand) and plotting (GNUplot). So my two questions are: How can I easily solve my 2 tasks? Secondly, is R really recommended for R newbys in daily work? Hi Soeren, For number 1: chisq.test(svfreqs) #see below but I don't think that this is the best way to test this. For number 2: faclevels-c(Not,Little,Somewhat,Very) svdf-data.frame(r11=sample(faclevels,276,TRUE), r12=sample(faclevels,276,TRUE), r13=sample(faclevels,276,TRUE), r14=sample(faclevels,276,TRUE), r15=sample(faclevels,276,TRUE), r16=sample(faclevels,276,TRUE)) library(prettyR) svfreqs-t(matrix(unlist(sapply(svdf,freq,display.na=FALSE)),nrow=6,byrow=TRUE)) library(plotrix) barp(svfreqs,main=Frequencies of importance ratings,ylim=c(0,100), names.arg=paste(r1,1:6,sep=),col=2:5,xlab=Situation, ylab=Frequency) legend(2.3,98,c(Not,Little,Somewhat,Very),fill=2:5) 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] R seven years ago
Not to detract from John's very interesting work, but there is a problem with citations as a measure of penetration. When R totally succeeds, there will be no citations. How many citations are there for Excel? However, for the moment, citations are probably a pretty good measure. Using traffic on R-help is even more problematic in this regard. Each question sent to R-help is clearly a failure (of documentation) rather than a success. Plus, unlike citations, there is a limit to the capacity of a mailing list -- exponential growth in messages on a single list is clearly unsustainable. To look at such statistics it would make sense to sum over all the R mailing lists. Tangential: In the early days of S-news it was apparent that traffic was a proxy not for total users but for new users. Clarification: Saying that a question to R-help is a failure of documentation is neither denigrating R documentation nor letting questioners off the hook when the answer to their question is clearly and prominently documented. I'm saying that for whatever reason the questioner found it less costly to post a question than to find the answer in the documentation. Cost functions vary. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) John Maindonald wrote: So what is the answer to the question: Can success continue? I suspect that R is now so firmly entrenched that it will inevitably continue, in one or other incarnation, for a long time to come. The negative factors that John Fox lists will surely, in time, make some changes inevitable. Will these come from force of circumstance rather than from conscious planning? In an August 12 message I posted details of R citation rates that I had gleaned, following a lead from Simon Blomberg, from Web of Science. This, or some such measure, seems to me important as giving a handle on the penetration of R into statistical application areas. The numbers I obtained [IG = Ihaka Gentleman 1996; RSTAT is the citation suggested by citation()] were: IG: 1998=4, 1999=15, 2000=17, 2001=39, 2002=119, 2003=276 RSTAT+IG: 2004:68+455 = 523 2005:433+512 = 945 2006:1049+426 = 1475 2007:1605+410 = 2015 2008, (to ~Aug10):1389+255 = 1644 cit - c(1998 = 4, 1999 = 15, 2000 = 17, 2001 = 39, 2002 = 119, 2003 = 276, 2004 = 523,2005 = 945,2006 = 1475, 2007 = 2015, 2008=1644) These will not be all that accurate; there will be omissions and duplications. Growth is close to exponential. John Maindonald email: [EMAIL PROTECTED] 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. On 09/10/2008, at 9:00 PM, [EMAIL PROTECTED] wrote: From: Peter Dalgaard [EMAIL PROTECTED] Date: 9 October 2008 5:42:19 AM To: [EMAIL PROTECTED] Cc: r-help@R-project.org r-help@r-project.org Subject: Re: [R] R seven years ago (Ted Harding) wrote: On 08-Oct-08 18:00:27, Liviu Andronic wrote: Hello everyone, As some may know, today Google unveiled its 2001 search index [1]. I was curious to see how was R like at that time, and was not disappointed. Compared to today's main page [2], seven years ago the page looked [3] a bit rudimentary, especially the graphic. (It is wort noting that structurally the pages are very similar.) What definitely changed is the `Contributed packages' section. Then R featured 29 contributed packages [4], while now it features 1500+ [5]. It was surprising to realize the growth of R during the past seven years. Regards, Liviu [1] http://www.google.com/search2001.html [2] http://www.r-project.org/ [3] http://web.archive.org/web/20010722202756/www.r-project.org/ [4] http://web.archive.org/web/20010525004023/cran.r-project.org/bin/macos/c ontrib/src/ [5] http://cran.at.r-project.org/web/packages/ Many thanks for this, Liviu! One might also compare the mailing list usage: [R-help 1997]: 484 messages [R-help 2001]: 4309 messages [R-help 2007]: 26250 1721+1909+2196+2145+2210+2309+ 2142+2246+2028+2711+2602+2031 So we now get more posts in a week than we did in the whole of 1997! Those not present at the useR in Dortmund might want to skim John Fox's talk http://www.statistik.uni-dortmund.de/useR-2008/slides/Fox.pdf (Actually, he did something at the end to avoid ending on a negative note. Flipped back to one of the increasing graphs, I suppose.) -- 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 ~~ - ([EMAIL PROTECTED]) FAX:
Re: [R] how to store lme/lmer fit result
I am building a hierarchical model on a large data set. It can take quite some time to finish one fit, I was just wondering whether it is possible to store the fit object (the result) to a file for later (offline) analysis. See ?save. Regards, Richie. Mathematical Sciences Unit HSL ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} __ 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
Hello, R users I like to draw a cluster tree with a hclust and plot command. But,instead of labels, it is giving number of variables in dendogram. Could anyone tell me , how to print the labels of variables used for drawing. Thank you. -- Vijaykumar Yogesh Muley Senior Research Fellow, Dr. Akash Ranjan's Group, Computational and Functional Genomics Laboratory, Sun Centre of Excellence in Medical Bioinformatics, Centre for DNA Fingerprinting and Diagnostics, Hyderabad. Andhra Pradesh, INDIA. Ph.No: +91 9441189013 E-mail : [EMAIL PROTECTED] Life : A journey from Cell to Cell -- [[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] plot-parameter pch without influence when plotting a data-frame
--- On Fri, 10/10/08, Oliver Bandel [EMAIL PROTECTED] wrote: From: Oliver Bandel [EMAIL PROTECTED] Subject: Re: [R] plot-parameter pch without influence when plotting a data-frame To: [EMAIL PROTECTED] what is the result of: [...] Try something like mm - matrix(1:128, nrow= 4) matplot(mm, pch=1:128) OK, it plots some symbols, but also after plotting there was printed a message that 24 warnings occured. Forgot to mention that some values do not have a character defined. Ignore the warings :) to get some idea of what symbols are available. Do you know how to plot very small dots? pch=20 makes dots that are too big for my plot. matplot(mm, pch=20, cex=.5) Oh, interesting and this seems to be the solution to get small-enough points! I'm just playing around with cex (as plot-param and set by par()) and it is the thing I looked for. Now I can use those filled circles and scale them down in size. :) Good question. I am at a machine that does not have R today. See if this example will do what you want. === car - c(rep(Mazda,3), rep(Renault, 5), rep(Trabant, 2)) speed - c( 45,64,28,56,76,43,56,69, 10,20) seat - c(2,3,4,3,2,4,3,4,2,1) # Number of seats in each type of car plot (speed, seat, pch=, xlim=c(0,100), ylim=c(0,5)) symbols(speed, seat, circles=seat*2, inches=FALSE, add=TRUE) text(speed,seat, labels=car, cex=.4, col='red') __ Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now at http://ca.toolbar.yahoo.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] Turn factors to numeric
Not an answer but I find that DF - data.frame(let = letters[1:3], num = 1:3, stringsAsFactors = FALSE) is very handy. Damn it, if I want a factor I'll tell the machine I do :) Or you can also set this option globally with options(stringsAsFactors = TRUE) Gabor Grothendieck warns that this last can possibly cause problems when using R programs from other places. I ran into this problem once with reshape. --- On Thu, 10/9/08, Michael Kubovy [EMAIL PROTECTED] wrote: From: Michael Kubovy [EMAIL PROTECTED] Subject: Re: [R] Turn factors to numeric To: Charilaos Skiadas [EMAIL PROTECTED] Cc: r-help r-help@r-project.org Received: Thursday, October 9, 2008, 8:25 AM Dear R-helpers, The FAQ in question says: It may happen that when reading numeric data into R (usually, when reading in a file), they come in as factors. If f is such a factor object, you can use as.numeric(as.character(f)) to get the numbers back. More efficient, but harder to remember, is as.numeric(levels(f))[as.integer(f)] I wonder why the R Core group did not choose to make such a useful operation simpler for the user (i.e., something like a factor2numeric() function that would be a wrapper to the more efficient command). _ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400Charlottesville, VA 22904-4400 Parcels:Room 102Gilmer Hall McCormick RoadCharlottesville, VA 22903 Office:B011+1-434-982-4729 Lab:B019+1-434-982-4751 Fax:+1-434-982-4766 WWW:http://www.people.virginia.edu/~mk9y/ On Oct 9, 2008, at 7:16 AM, Charilaos Skiadas wrote: R-FAQ 7.10: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f On Oct 9, 2008, at 6:59 AM, joseph kambeitz wrote: I am having some problems while trying to fit simple data. I aggregated some data using: data1 - aggregate(data1$T2, list=(SOA=data1$SOA), mean) unfortunatly this coerces my variable SOA into a factor. Therefore when a afterwards try to fit a simple equation to my variable T2 using a formula on SOA i get a error because SOA is a factor and that * is not meaningful for factors... nls(T2 ~ a + b*SOA, start=list(a=1,b=1), data=data1, trace=TRUE) In fact SOA is a numeric variable (in my experiments it is the time that passed!) so i would like to re-coerce it into a numeric variable to do the fit or to find a method to do the fit even though SOA is a factor. Thanks a lot for your help! Best Jokel [[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] plot-parameter pch without influence when plotting a data-frame
On Thu, Oct 9, 2008 at 8:19 AM, John Kane [EMAIL PROTECTED] wrote: --- On Thu, 10/9/08, Oliver Bandel [EMAIL PROTECTED] wrote: From: Oliver Bandel [EMAIL PROTECTED] Subject: Re: [R] plot-parameter pch without influence when plotting a data-frame To: Gerhard Schön, UKE Hamburg [EMAIL PROTECTED] Cc: R-help r-help@r-project.org Received: Thursday, October 9, 2008, 9:00 AM Zitat von Gerhard Schön, UKE Hamburg [EMAIL PROTECTED]: what is the result of: df - data.frame(x = 1:5, y = 1:5) plot(df, pch = 1:5) It prints different symbols. It seemed, that my pch-settings had an effect, but some symbols were very similar, especially, when a lot of them are plotted at similar places. But I also had the effect, that some symbol numbers didn't print enything, but *after* the loop I used, warnings were printed. Have a look at ?points for some discussion of pch values. Some values are undefined. Try something like mm - matrix(1:128, nrow= 4) matplot(mm, pch=1:128) to get some idea of what symbols are available. Do you know how to plot very small dots? pch=20 makes dots that are too big for my plot. matplot(mm, pch=20, cex=.5) See also pch = . Value 'pch=.' (equivalently 'pch = 46') is handled specially. It is a rectangle of side 0.01 inch (scaled by 'cex'). In addition, if 'cex = 1' (the default), each side is at least one pixel (1/72 inch on the 'pdf', 'postscript' and 'xfig' devices). from ?points. 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.
[R] ggplot adding points
I would like to do the following in ggplot: what am I missing? River.Mile -c(202, 198, 190, 185, 179, 148, 119, 61) TSS - c(1:8) DOC - seq(2, by= 0.6, length.out=8) z - data.frame(River.Mile, TSS, DOC) xyplot(TSS+DOC~River.Mile, data=z, auto.key=TRUE) thanks -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis __ 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] Plot grouped histograms
Another solution would be faclevels-c(Not,Little,Somewhat,Very, NA) group - factor(1:6) svdf-data.frame(value = sample(group, 400, TRUE), category = sample(faclevels,400,TRUE)) library(ggplot2) ggplot(svdf, aes(x = value, fill = category)) + geom_histogram(position = dodge) 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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Jim Lemon Verzonden: vrijdag 10 oktober 2008 14:26 Aan: [EMAIL PROTECTED] CC: r-help@r-project.org Onderwerp: Re: [R] Plot grouped histograms [EMAIL PROTECTED] wrote: r11 -- r16 are variables showing a reason for usage of a product in 6 different situations. Each variable is a factor with 4 levels imported from a SPSS sav file with labels ranging from not important to very important, and NA's for a sample of N = 276. (1) I need a chi square test of independence showing that the reason does not differ depending on the situation. (2) I need a single coloured histogram plot. The x axis should be grouped by the 6 situation with small space between the groups, each group should show different bars for each factor value (not important, little..., ..., NA's), but NA's is not necessary. I've been googling the whole day, searching the mailing list and handbooks, and struggled through the somewhat R programmer specific documentation. Beeing a newby in R, I'm now afraid that I have to go back to SPSS and Excel where my tasks would be a work of an hour. But I was told euphoric that R may solve many of the problems I have (and don't like) with SPSS, or having to separate calculation (SPSS, Excel by hand) and plotting (GNUplot). So my two questions are: How can I easily solve my 2 tasks? Secondly, is R really recommended for R newbys in daily work? Hi Soeren, For number 1: chisq.test(svfreqs) #see below but I don't think that this is the best way to test this. For number 2: faclevels-c(Not,Little,Somewhat,Very) svdf-data.frame(r11=sample(faclevels,276,TRUE), r12=sample(faclevels,276,TRUE), r13=sample(faclevels,276,TRUE), r14=sample(faclevels,276,TRUE), r15=sample(faclevels,276,TRUE), r16=sample(faclevels,276,TRUE)) library(prettyR) svfreqs-t(matrix(unlist(sapply(svdf,freq,display.na=FALSE)),nrow=6,byro w=TRUE)) library(plotrix) barp(svfreqs,main=Frequencies of importance ratings,ylim=c(0,100), names.arg=paste(r1,1:6,sep=),col=2:5,xlab=Situation, ylab=Frequency) legend(2.3,98,c(Not,Little,Somewhat,Very),fill=2:5) 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. 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.
[R] boxplot and stripchart
I want to make illustrations a la boxplot for a data material with several groups. Some of the groups are very small, so a boxplot doesn't make sense. I would like to use stripchart for these groups. On the other hand, some of the groups are very large, so for them stripchart isn't so good. So my question is: Is it possible to combine boxplots and and stripcharts in one figure? (Of course, in R anything is possible, but I mean in a simple way.) Or is there some other good alternative for a case like this? -- Göran Broström __ 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] Leap year?
Given a Date object or simply a year is there an R function to tell me if the it is a leap year or not? I was hoping for something like 'is.leapyear'. I probably can build my own function (year divisible by 4 etc.) but I would rather use an existing function if it is available. Thank you. Kevin __ 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] linear expenditure model
Hi, I would like to estimate a linear expendire with Systemfit package. (method: SUR) As someone could show me how to define the equations? Thanks. -- Think before you print ! ** Disclaimer: This e-mail may contain confidential informa...{{dropped:9}} __ 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] boxplot and stripchart
Göran Broström wrote: I want to make illustrations a la boxplot for a data material with several groups. Some of the groups are very small, so a boxplot doesn't make sense. I would like to use stripchart for these groups. On the other hand, some of the groups are very large, so for them stripchart isn't so good. So my question is: Is it possible to combine boxplots and and stripcharts in one figure? (Of course, in R anything is possible, but I mean in a simple way.) Or is there some other good alternative for a case like this? Here's a first approximation. library(ISwR) l - split(juul$igf1,juul$tanner) sel - sapply(l, length) 100 boxplot(l[sel],horizontal=TRUE,at=(1:5)[sel], xlim=c(0,6)) stripchart(l[!sel],at=(1:5)[!sel], add=TRUE) The y axis needs a bit more diddling. In this case, I actually find that it is quite sufficint to do stripchart(igf1 ~ tanner, data=juul, method=jitter, pch=19) -- 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 ~~ - ([EMAIL PROTECTED]) 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.
Re: [R] plot-parameter pch without influence when plotting a data-frame
Zitat von John Kane [EMAIL PROTECTED]: --- On Thu, 10/9/08, Oliver Bandel [EMAIL PROTECTED] wrote: From: Oliver Bandel [EMAIL PROTECTED] Subject: Re: [R] plot-parameter pch without influence when plotting a data-frame To: Gerhard Schön, UKE Hamburg [EMAIL PROTECTED] Cc: R-help r-help@r-project.org Received: Thursday, October 9, 2008, 9:00 AM Zitat von Gerhard Schön, UKE Hamburg [EMAIL PROTECTED]: what is the result of: [...] Try something like mm - matrix(1:128, nrow= 4) matplot(mm, pch=1:128) OK, it plots some symbols, but also after plotting there was printed a message that 24 warnings occured. to get some idea of what symbols are available. Do you know how to plot very small dots? pch=20 makes dots that are too big for my plot. matplot(mm, pch=20, cex=.5) Oh, interesting and this seems to be the solution to get small-enough points! I'm just playing around with cex (as plot-param and set by par()) and it is the thing I looked for. Now I can use those filled circles and scale them down in size. :) Thanks again, Oliver __ 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 adding points
Dear Stephen, You need the data in long format. Try melt()ing it first. River.Mile -c(202, 198, 190, 185, 179, 148, 119, 61) TSS - c(1:8) DOC - seq(2, by= 0.6, length.out=8) z - data.frame(River.Mile, TSS, DOC) zMelt - melt.data.frame(z, id.vars = River.Mile) library(ggplot2) ggplot(zMelt, aes(x = River.Mile, y = value, colour = variable)) + geom_point() HTH, Thierry PS your example was not reproducible as you forgot library(lattice) in your code. 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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens stephen sefick Verzonden: vrijdag 10 oktober 2008 16:18 Aan: R Help Onderwerp: [R] ggplot adding points I would like to do the following in ggplot: what am I missing? River.Mile -c(202, 198, 190, 185, 179, 148, 119, 61) TSS - c(1:8) DOC - seq(2, by= 0.6, length.out=8) z - data.frame(River.Mile, TSS, DOC) xyplot(TSS+DOC~River.Mile, data=z, auto.key=TRUE) thanks -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis __ 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.
[R] multi-scale singular spectrum analysis (SSA)
Hi everybody! I am searching for an R implementation of multi-scale singular spectrum analysis (SSA), which was introduced by Yiou etal (2000) (Data-adaptive wavelets and multi-scale singular-spectrum analysis) and further described in Ghil etal (2002). For SSA alone I found an package recently published on r-forge: http://r-forge.r-project.org/projects/simsalabim/ I am happy about any suggestions! Maik __ 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] Fatal error: unable to restore saved data in .RData
Hello, I am unable to start an R session by double-clicking on an existing .RData file from the Windoze file explorer. A dialogue appears with the message Fatal error: unable to restore saved data in .RData, and I notice in the R Console the last few lines are: Loading required package: R2HTML NULL error in function () : unused argument(s) (1:43) I tried starting a fresh R session, changing the working directory, saving a new empty workspace, closing R, and restarting with the new (empty) .RData file to the same effect. I tried with the --vanilla option, changing the working directory and loading the existing workspace, and get the error message: Error in function () : unused argument(s) (1:43) And again with the --no-restore-data option, same effect. Suggestions? Thanx, DaveT. ### # system info: sessionInfo() ; cat(\n) ; Sys.info()[c(1:3,5)] R version 2.7.2 (2008-08-25) i386-pc-mingw32 locale: LC_COLLATE=English_Canada.1252;LC_CTYPE=English_Canada.1252;LC_MONETARY= English_Canada.1252;LC_NUMERIC=C;LC_TIME=English_Canada.1252 attached base packages: [1] stats graphics grDevices datasets tcltk utils methods base other attached packages: [1] debug_1.1.0 mvbutils_1.1.1 lattice_0.17-14 plotrix_2.4-7 svSocket_0.9-5 TinnR_1.0.2 R2HTML_1.59 Hmisc_3.4-3 loaded via a namespace (and not attached): [1] cluster_1.11.11 grid_2.7.2 svMisc_0.9-5tools_2.7.2 sysname release version machine Windows XP build 2600, Service Pack 2 x86 # system info: ### * Silviculture Data Analyst Ontario Forest Research Institute Ontario Ministry of Natural Resources [EMAIL PROTECTED] http://ontario.ca/ofri __ 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] linear expenditure model
Hi Marie! On Friday 10 October 2008 12:40:23, Marie Vandresse wrote: I would like to estimate a linear expendire with Systemfit package. (method: SUR) If I remember correctly, the linear expenditure system (LES) is linear in income but non-linear in the parameters. Hence, you have to estimate a system of non-linear equations. Unfortunately, the nlsystemfit() function in the systemfit package that estimates systems of non-linear equations is still under development and has convergence problems rather often. Since the systemfit() function in the systemfit package that estimates systems of linear equations is very reliable [1], I suggest that you choose a demand system that is linear in parameters (e.g. the Almost Ideal Demand System, AIDS) [1] http://www.jstatsoft.org/v23/i04 As someone could show me how to define the equations? If you use the aidsEst() function in the micEcon package [2], you don't have to specify the equations of the Almost Ideal Demand System yourself. [2] http://www.micEcon.org Best wishes, Arne -- Arne Henningsen http://www.arne-henningsen.name __ 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] Fatal error: unable to restore saved data in .RData
Hello, I may have found the problem, although I don't understand it. When I commented out the following line in my Rprofile.site file the problem _seemed_ to disappear. # ans as shorthand for .Last.value # makeActiveBinding(ans, function() .Last.value, .GlobalEnv) I decided to do this after reading the help for bindenv {base} and the phrase . . . experimental interface . . . JUMPED right out at me. Again, I don't know if this was _actually_ the cause of my problem but, I am underway again. Thanx, DaveT. -Original Message- From: Thompson, David (MNR) Sent: October 10, 2008 10:26 AM To: 'r-help@r-project.org' Subject: Fatal error: unable to restore saved data in .RData Hello, I am unable to start an R session by double-clicking on an existing .RData file from the Windoze file explorer. A dialogue appears with the message Fatal error: unable to restore saved data in .RData, and I notice in the R Console the last few lines are: Loading required package: R2HTML NULL error in function () : unused argument(s) (1:43) I tried starting a fresh R session, changing the working directory, saving a new empty workspace, closing R, and restarting with the new (empty) .RData file to the same effect. I tried with the --vanilla option, changing the working directory and loading the existing workspace, and get the error message: Error in function () : unused argument(s) (1:43) And again with the --no-restore-data option, same effect. Suggestions? Thanx, DaveT. ### # system info: sessionInfo() ; cat(\n) ; Sys.info()[c(1:3,5)] R version 2.7.2 (2008-08-25) i386-pc-mingw32 locale: LC_COLLATE=English_Canada.1252;LC_CTYPE=English_Canada.1252;LC_ MONETARY=English_Canada.1252;LC_NUMERIC=C;LC_TIME=English_Canada.1252 attached base packages: [1] stats graphics grDevices datasets tcltk utils methods base other attached packages: [1] debug_1.1.0 mvbutils_1.1.1 lattice_0.17-14 plotrix_2.4-7 svSocket_0.9-5 TinnR_1.0.2 R2HTML_1.59 Hmisc_3.4-3 loaded via a namespace (and not attached): [1] cluster_1.11.11 grid_2.7.2 svMisc_0.9-5tools_2.7.2 sysname release version machine Windows XP build 2600, Service Pack 2x86 # system info: ### * Silviculture Data Analyst Ontario Forest Research Institute Ontario Ministry of Natural Resources [EMAIL PROTECTED] http://ontario.ca/ofri * __ 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 adding points
On Fri, Oct 10, 2008 at 9:18 AM, stephen sefick [EMAIL PROTECTED] wrote: I would like to do the following in ggplot: what am I missing? River.Mile -c(202, 198, 190, 185, 179, 148, 119, 61) TSS - c(1:8) DOC - seq(2, by= 0.6, length.out=8) z - data.frame(River.Mile, TSS, DOC) xyplot(TSS+DOC~River.Mile, data=z, auto.key=TRUE) You need to do the data manipulation yourself. The easiest way is to use melt: zm - melt(z, id = River.Mile) qplot(River.Mile, value, data=dz, colour = variable) 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.
[R] Antwort: FW: R loops
it did help to create the separate vectors. The problem is, I would like to continue working with each vector on its own and make some further analysis. For that i need to allocate each vector in the filePatterns a unique name, which I just can't do. I'm not so great in R loops and the help over the net regards for loops in R is quite rare. I'm really thankful for every help. Mit freundlichen Grüßen / Best Regards Assa Yeroslaviz Richard Pugh [EMAIL PROTECTED] 09.10.2008 14:06 An [EMAIL PROTECTED] Kopie Thema FW: [R] R loops Hi Assa, I happened to have some code on my screen that does exactly what you want: myDir - D:\\Temp allFiles - list.files(myDir) somePatterns - c(xls, csv, sas7bdat) filePatterns - lapply(somePatterns, function(pat, files) files[grep(pat, files)], files=allFiles) cat(paste(\n, somePatterns, : , sapply(filePatterns, paste, collapse=, ), sep=)) Hope this helps, Rich. mangosolutions S R Consulting Training -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 09 October 2008 12:56 To: r-help@r-project.org Subject: [R] R loops hello everybody, I have a directory with over 3000 files with different names. I would like to make some vectors with the file names which are belong together. I'm trying to do it with a for loop in R: SF - c(ad, cd, cer, stress, salty, PC, high, transfer, cold, heat) # the pattern to look for names(SF) - as.vector(SF) for (i in 1:length(SF)){ write(names(SF)[i], ) for (j in 1:length(SF)) {list[j] - grep(names(SF)[j], list.files(),value=TRUE) #character vector with the specified stress factor } } but all I'm getting is this Error in list[j] - grep(names(SF)[j], list.files(), value = TRUE) : object of type 'builtin' is not subsettable I would like the loop to make in each round a list of the files with the pattern in the directory I'm looking in. what am i doing wrong? If I doing it for each element I'm getting the correct list. THX for the help Best Regards Assa Yeroslaviz [[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.
[R] Creating a new connection type
Hello. I have an instrument, actually a step motor indexer that I want to drive from R. It uses an RS-232 connection. I already have a few C subroutines that I access from R but I would like to be able use R's connection related functions - readLines, writeLines, cat, read.table, etc - directly. Does any one have any suggestions on how a I should proceed to create a new connection type? Is it even possible without going down to R's guts? Thanks for any help Paulo Jabardo Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com. http://br.new.mail.yahoo.com/addresses __ 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] Fatal error: unable to restore saved data in .RData
If you are able to create a .Rdata file for which this fails can you record the last few commands before you create the .Rdata file? luke On Fri, 10 Oct 2008, Thompson, David (MNR) wrote: Hello, I am unable to start an R session by double-clicking on an existing .RData file from the Windoze file explorer. A dialogue appears with the message Fatal error: unable to restore saved data in .RData, and I notice in the R Console the last few lines are: Loading required package: R2HTML NULL error in function () : unused argument(s) (1:43) I tried starting a fresh R session, changing the working directory, saving a new empty workspace, closing R, and restarting with the new (empty) .RData file to the same effect. I tried with the --vanilla option, changing the working directory and loading the existing workspace, and get the error message: Error in function () : unused argument(s) (1:43) And again with the --no-restore-data option, same effect. Suggestions? Thanx, DaveT. ### # system info: sessionInfo() ; cat(\n) ; Sys.info()[c(1:3,5)] R version 2.7.2 (2008-08-25) i386-pc-mingw32 locale: LC_COLLATE=English_Canada.1252;LC_CTYPE=English_Canada.1252;LC_MONETARY= English_Canada.1252;LC_NUMERIC=C;LC_TIME=English_Canada.1252 attached base packages: [1] stats graphics grDevices datasets tcltk utils methods base other attached packages: [1] debug_1.1.0 mvbutils_1.1.1 lattice_0.17-14 plotrix_2.4-7 svSocket_0.9-5 TinnR_1.0.2 R2HTML_1.59 Hmisc_3.4-3 loaded via a namespace (and not attached): [1] cluster_1.11.11 grid_2.7.2 svMisc_0.9-5tools_2.7.2 sysname release version machine Windows XP build 2600, Service Pack 2 x86 # system info: ### * Silviculture Data Analyst Ontario Forest Research Institute Ontario Ministry of Natural Resources [EMAIL PROTECTED] http://ontario.ca/ofri __ 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. -- Luke Tierney Chair, Statistics and Actuarial Science Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Science 241 Schaeffer Hall email: [EMAIL PROTECTED] Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu __ 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] nls, lattice, and conversion over to ggplot
I just got it and it works wonderfully. thank you both for your help Stephen On Fri, Oct 10, 2008 at 4:01 AM, baptiste auguie [EMAIL PROTECTED] wrote: It worked for me, do you have the latest version of ggplot2 released a few days ago (ggplot2_0.7) ? Baptiste On 9 Oct 2008, at 20:55, stephen sefick wrote: Error in `[.data.frame`(df, , var) : undefined columns selected I got this error in a fresh R session after rerunning all of the commands On Thu, Oct 9, 2008 at 3:45 PM, hadley wickham [EMAIL PROTECTED] wrote: On Thu, Oct 9, 2008 at 2:29 PM, stephen sefick [EMAIL PROTECTED] wrote: I am trying to figure out how to use ggplot2. I would like to do the below with ggplot, but I can not figure out how. The data provided is a subset of a much larger data set, but these data are the data necessary to make the plot. I think I would rather have the colors become symbols, and I do know how to do that in lattice, but here is a quick and dirty version. thanks Here's one way: pred - data.frame(GPP = f, TSS = y) qplot(TSS, GPP, data=r, colour=RiverMile) + geom_line(data=pred, colour =black) * ggplot2 works with data frames, so the key is to create one from your model predictions. Naming the variables to match the names of the model inputs makes sense, and saves some typing. * You no longer need to specify xlim because ggplot2 knows about everything you are plotting and can calculate the limits appropriately. * You have have to manually set the colour in geom_line to override the default mapping that you created between colour and RiverMile. Hadley -- http://had.co.nz/ -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[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. -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis __ 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] rgl_081.708: rgl.snapshot fails, causing persistent problems
Thanks, Duncan, I was encountered with the same problem as Michael, and just now I found the version you provided in your homepage could solve this problem well. Regards, Yihui -- Yihui Xie [EMAIL PROTECTED] Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Thu, Oct 9, 2008 at 1:16 AM, Duncan Murdoch [EMAIL PROTECTED] wrote: Sorry to take a while to respond on this. I don't see the behaviour you're describing. I see that rgl.snapshot fails when I use the R-forge build, but it doesn't affect anything else. (I can guess why rgl.snapshot fails, but it makes no sense that this would have the side effects you're seeing.) A wild guess is that the OpenGL driver on your desktop system has problems, but those shouldn't persist over a system reboot. Another guess is that you've got something in your workspace (e.g. an r3dDefaults variable) and it is causing trouble. But then you should see Attaching package: 'rgl' The following object(s) are masked _by_ .GlobalEnv : r3dDefaults and you would notice that. I have put a good build of rgl 0.81.708 online, but I can't see how it would behave any better than the CRAN 0.81. If you feel like trying something that probably won't help, download and install http://www.stats.uwo.ca/faculty/murdoch/temp/rgl_0.81.708.zip 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] rgl-snapshot failed (err-msg: failed)
On 10/10/2008 8:13 AM, Oliver Bandel wrote: Hello, I tried to use rgl.snapshot and it failed. The error message was not very verbose: == plot3d( motion[[idx+2]], motion[[idx+1]], motion[[idx]] ) rgl.snapshot(filename=/tmp/shot_01.png, fmt=png) [1] failed == There was a graphic created by rgl, but the snapshot was not created. The same problem occurs, when I use example(rgl.snapshot) The graphic/animation will be created, but there is no possibility to create the output-files. I use R version 2.4.0 Patched (2006-11-25 r39997). Is this a problem of this old version? or is there maybe a general problem, independent of the version? This is a problem with the build. rgl is not easy to build, because it links to a lot of external libraries. In this case it looks as though your build (the one from R-forge? You should say...) did not link to libpng. 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] Leap year?
rkevinburton at charter.net writes: Given a Date object or simply a year is there an R function to tell me if the it is a leap year or not? I was hoping for something like 'is.leapyear'. I probably can build my own function (year divisible by 4 etc.) but I would rather use an existing function if it is available. Simply try leap year on R site search. Many alternatives are offered, package chron has probably the most standard one. 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.
Re: [R] Creating a new connection type
Dear Paulo, Hello. I have an instrument, actually a step motor indexer that I want to drive from R. It uses an RS-232 connection. I already have a few C subroutines that I access from R but I would like to be able use R's connection related functions - readLines, writeLines, cat, read.table, etc - directly. Does any one have any suggestions on how a I should proceed to create a new connection type? Is it even possible without going down to R's guts? I've played with an RS 232 connection from R some months ago: For sending it is convenient to use a connection to the serial port as file e.g. file = COM1: or /dev/ttyS0 I got into trouble with reading. It works fine with the file connection as long as really an answer is waiting - otherwise the timeout is too long for this being a practical solution. I could neither figure out how to change this timeout nor how to find out whether data is waiting (e.g. like BytesAvailable). HTH and if you figure out how to read nicely, please let me know. Claudia -- Claudia Beleites Dipartimento dei Materiali e delle Risorse Naturali Università degli Studi di Trieste Via Alfonso Valerio 2 I-34127 Trieste phone: +39 (0 40) 5 58-34 47 email: [EMAIL PROTECTED] __ 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] map + some arbitrary locations' heights: some kind of perspective or contour plot possible?
Hi, I thought about this but programming it seems rather difficult so I was wondering if a function exists for this in R (as most of the times it turns out that it does): I have a map (shapefile) and for about 50 points on that map (GPS locations) I have heights. Is there a function which can make a perspective plot or contour plot or the like from this little data? Or maybe some function I can abuse? Thanks for any suggestions, Werner __ 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] Fatal error: unable to restore saved data in .RData
On Fri, 10 Oct 2008, Thompson, David (MNR) wrote: Hello, I may have found the problem, although I don't understand it. When I commented out the following line in my Rprofile.site file the problem _seemed_ to disappear. # ans as shorthand for .Last.value # makeActiveBinding(ans, function() .Last.value, .GlobalEnv) What I believe is happening is that your profile sets this up as an active binding that cannot be assigned to before the .RDate is loaded and loading the .RData is trying to assign to it. If you want to avoid the error you can use ## the argument 'v' means assignment to 'ans' will be ignored instead of ## generating an error message. makeActiveBinding(ans, function(v) .Last.value, .GlobalEnv) I decided to do this after reading the help for bindenv {base} and the phrase . . . experimental interface . . . JUMPED right out at me. Again, I don't know if this was _actually_ the cause of my problem but, I am underway again. It would probably be best to recommend that the functins used in active bindings always take one argument and, if assignment is not supposed to happen, either ignore that argument it it is supplied or signal an explicit error. I'll look at the help page and think about appropriate changes. Best, luke Thanx, DaveT. -Original Message- From: Thompson, David (MNR) Sent: October 10, 2008 10:26 AM To: 'r-help@r-project.org' Subject: Fatal error: unable to restore saved data in .RData Hello, I am unable to start an R session by double-clicking on an existing .RData file from the Windoze file explorer. A dialogue appears with the message Fatal error: unable to restore saved data in .RData, and I notice in the R Console the last few lines are: Loading required package: R2HTML NULL error in function () : unused argument(s) (1:43) I tried starting a fresh R session, changing the working directory, saving a new empty workspace, closing R, and restarting with the new (empty) .RData file to the same effect. I tried with the --vanilla option, changing the working directory and loading the existing workspace, and get the error message: Error in function () : unused argument(s) (1:43) And again with the --no-restore-data option, same effect. Suggestions? Thanx, DaveT. ### # system info: sessionInfo() ; cat(\n) ; Sys.info()[c(1:3,5)] R version 2.7.2 (2008-08-25) i386-pc-mingw32 locale: LC_COLLATE=English_Canada.1252;LC_CTYPE=English_Canada.1252;LC_ MONETARY=English_Canada.1252;LC_NUMERIC=C;LC_TIME=English_Canada.1252 attached base packages: [1] stats graphics grDevices datasets tcltk utils methods base other attached packages: [1] debug_1.1.0 mvbutils_1.1.1 lattice_0.17-14 plotrix_2.4-7 svSocket_0.9-5 TinnR_1.0.2 R2HTML_1.59 Hmisc_3.4-3 loaded via a namespace (and not attached): [1] cluster_1.11.11 grid_2.7.2 svMisc_0.9-5tools_2.7.2 sysname release version machine Windows XP build 2600, Service Pack 2x86 # system info: ### * Silviculture Data Analyst Ontario Forest Research Institute Ontario Ministry of Natural Resources [EMAIL PROTECTED] http://ontario.ca/ofri * __ 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. -- Luke Tierney Chair, Statistics and Actuarial Science Ralph E. Wareham Professor of Mathematical Sciences University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Science 241 Schaeffer Hall email: [EMAIL PROTECTED] Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu __ 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] Help MLE
Dear Ben Bolker, Thanks a lot for your help. I have two more questions: 1) My goal is maximize the function ( r = Y*log(comb)) but the parameters found, minimized the function (r = Y*log(comb)). 2) What this function do? model2 - function(p) { do.call(Model,as.list(p)) } Best regards, LFRC Ben Bolker wrote: LFRC feliperiehs at yahoo.com.br writes: Dear, I'm starting on R language. I would like some help to implement a MLE function. I wish to obtain the variables values (alpha12, w_g12, w_u12) that maximize the function LL = Y*ln(alpha12 + g*w_g12 + u*w_u12). You're running into a problem because your linear combination goes negative in the course of the optimization, which makes the logarithm NaN, which crashes the optimizer. The quick hack would be to calculate the linear combination and then set it to max(value,some_small_positive_number) -- this will (probably) work if the solution is not on the boundary. Alternatively you can use constrOptim (see below), because you need to impose a linear inequality constraint. rm(list=ls()) ls() library(stats4) Model = function(alpha12,w_g12,w_u12) { Y = 1 u = 0.5 g = -1 comb = alpha12 + g*w_g12 + u*w_u12 r = Y*log(comb) cat(alpha12,w_g12,w_u12,comb,log(comb),r,\n) ## debug r } res = mle(minuslog=Model,start=list(alpha12=0.1,w_u12=0.1,w_g12=0.1), method = BFGS) model2 - function(p) { do.call(Model,as.list(p)) } constrOptim(theta=c(0.1,0.1,0.1),f=model2, grad=NULL, ui = c(1,-1,0.5), ci = rep(0,3)) 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. -- View this message in context: http://www.nabble.com/Help-MLE-tp19904724p19917390.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] Implied GARCH parameters - Error in chol.default(Hessian) : the leading minor of order 1 is not positive definite
Dear R-Users, I'm trying to estimate GARCH parameters implied by options prices (on wednesdays only) by minimizing the average mean squared dollar error between the market and the model price, but I always get the following error message: Error in chol.default(Hessian) : the leading minor of order 1 is not positive definite # model mean under the risk neutral measure: R[t] = r-0.5*hh[t]+sqrt(hh[t])*z[t] # cond. variance under the risk neutral measure: hh[t] = alpha0 + beta*hh[t-1] + alpha*hh[t-1]*z[t-1] # z~N(0,1), lambda = 0 Any help will be greatly appreciated. Desislava Kavrakova __ 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] Overlay Plots
Hi, I have three vectors and I would like to plot them in one window. So R should overlay them in the quartz. I achieved this by plotting the first vector: plot(v1) and add the other two with points(v2) and points(v3). Is there another way to achieve the same result? Cheers -- View this message in context: http://www.nabble.com/Overlay-Plots-tp19918234p19918234.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] Space between bars in barplot
Hi, thanks again for your help. I played around with your suggestions to change the appearance of my graph, but there is still a problem I could not fix. The vector, which I want to plot, contains 60 entries. After 3 bars I want to have a large gap between the next 3 bars. But what always happens is, that R took at the beginning just 2 bars and then always 3 bars ending up with one bar at the end. So I have created a new vector v - c(0,0,vectorToPrint) plotting this vector with the following command: barplot(v, space=rep(c(0,0,2)) ). It works but getting always some warning messages. Instead of 0,0 I tried as well NA, NA but same result. So is there a way to achieve that without warning messages? Cheers, Mentor -- View this message in context: http://www.nabble.com/Space-between-bars-in-barplot-tp19878227p19919930.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] glmmPQL
Dear all, I am experiencing problems with glmmmPQL. I am trying to analyze binomial data with some spatial autocorrelation. Here is my code and some of the outputs colnames(d.glmm) [1] BV Longitude Latitudenb_pc_02 nb_expr_02 [6] pc_02 nb_pc_07nb_expr_07 pc_07 PSDC99 [11] PSDC68 POPACTP99 HOMACT99FEMACT99 CHOM99 [16] CHOMHOM99 CHOMFEM99 PCCHOM99PCFEMCHOM RFUCQ201 [21] RFUCQ202RFUCQ203RFUCQ204RFUCQ205 sd_RFUCQ201 [26] sd_RFUCQ202 sd_RFUCQ203 sd_RFUCQ204 sd_RFUCQ205 langue [31] bidon dim(d.glmm) [1] 1916 31 attach(d.glmm) search() [1] .GlobalEnvd.glmmpackage:nlme [4] package:MASS package:ade4 package:RMySQL [7] package:DBI package:stats package:graphics [10] package:grDevices package:utils package:datasets [13] package:methods Autoloads package:base m.1 - glmmPQL(fixed=cbind(nb_pc_02,I(nb_expr_02-nb_pc_02))~(PSDC99 +I(log(RFUCQ202))+PCCHOM99+sd_RFUCQ202+PCFEMCHOM)^2+langue, + random= ~ 1 | bidon, + correlation = corExp(form = ~ Longitude +Latitude), + family=quasibinomial, + na.action=na.exclude, + data=d.glmm) iteration 1 Erreur dans model.frame.default(formula = ~Longitude + Latitude + bidon les longueurs des variables diffèrent (trouvé pour 'bidon') Sorry about the french here... It is just saying that variables have different lengths. Which is obviously untrue, as they all are columns of the same data frame. The search() shows that I have attached the data.frame, as it is told in some FAQs. If somebody has an idea on how to sort this issue out, I would appreciate ! Another question: is the option correlation active in the latest version of lmer ? If it is, it might be an option to consider instead of glmmPQL. Thanks in advance for your help ! -- Jean-Baptiste Ferdy Institut des Sciences de l'Évolution de Montpellier - UMR 5554 Université Montpellier 2 tèl. (0)4 67 14 42 27 fax (0)4 67 14 36 22 __ 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] Space between bars in barplot
I played around with your suggestions to change the appearance of my graph, but there is still a problem I could not fix. The vector, which I want to plot, contains 60 entries. After 3 bars I want to have a large gap between the next 3 bars. But what always happens is, that R took at the beginning just 2 bars and then always 3 bars ending up with one bar at the end. So I have created a new vector v - c(0,0,vectorToPrint) plotting this vector with the following command: barplot(v, space=rep(c(0,0,2)) ). It works but getting always some warning messages. Instead of 0,0 I tried as well NA, NA but same result. So is there a way to achieve that without warning messages? Seeing as it's late on a friday afternoon, could you give us a fighting chance of helping you by 1) providing enough code to reproduce the problem, and 2) telling us what the warning said. (As per the posting guide.) Regards, Richie. Mathematical Sciences Unit HSL ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} __ 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] Leap year?
perhaps leapyear() http://finzi.psych.upenn.edu/R/library/pheno/html/leapyear.html --- On Fri, 10/10/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: [R] Leap year? To: r-help r-help@r-project.org Received: Friday, October 10, 2008, 10:29 AM Given a Date object or simply a year is there an R function to tell me if the it is a leap year or not? I was hoping for something like 'is.leapyear'. I probably can build my own function (year divisible by 4 etc.) but I would rather use an existing function if it is available. Thank you. Kevin __ 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. __ [[elided Yahoo spam]] __ 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] a question about diparate device quality
List, I have a question about why plots sent to certain devices can be of so much worse quality than others. Whenever I plot to x11 or pdf the graphs are of excellent quality. eps is a bit poorer, but of passable quality, and jpeg or tiff are terrible. I tried all manner of parameters, on many versions of R (most major releases from about 2.2 - present) under linux and windows and on a few different (pc) hardware setups and this patterns seems to be invariant. Could anyone explain why this is the case? For school and work I just pdflatex my pdf graphs into latex so it isn't a problem, but my new job likes to include them in, say, MS word documents for which I cannot easily use pdf. TIA, Kyle [[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] help
Vijaykumar Muley vijay.muley at gmail.com writes: I like to draw a cluster tree with a hclust and plot command. But,instead of labels, it is giving number of variables in dendogram. Could anyone tell me , how to print the labels of variables used for drawing. Thank you. Please post str(of your data), and the command you used. 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.
Re: [R] Overlay Plots
?matplot On Fri, Oct 10, 2008 at 9:50 AM, mentor_ [EMAIL PROTECTED] wrote: Hi, I have three vectors and I would like to plot them in one window. So R should overlay them in the quartz. I achieved this by plotting the first vector: plot(v1) and add the other two with points(v2) and points(v3). Is there another way to achieve the same result? Cheers -- View this message in context: http://www.nabble.com/Overlay-Plots-tp19918234p19918234.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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? __ 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 on quantile
Hi, I would like to use the quantile function, but I have some doubts to choose the value of type parameter. Does this depend on the shape/structure of my distribution? I cannot unde rstand what mean the expressions Discontinuous sample quantile and Continuous sample quantile, respectively. My distributions (histograms) sometimes have some holes, that is I have some bins with zero samples. Someone can help me, please? thank you! giov -- View this message in context: http://www.nabble.com/help-on-quantile-tp19921087p19921087.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] Coefficients in a polynomial glm with family poisson/binomial
Dear R-users When running a glm polynomial model with one explanatory variable (example Y~X+X^2), with a poisson or binomial error distribution, the predicted values obtained from using the predict() function and those obtained from using the coefficients from the summary table as is in an equation of the form Y=INTERCEPT+ XCoef x X + XCoef x X^2, differ considerably. The former are correct and the latter are wrong. This does not occur using lm() or in a glm with family as normal. I conclude that this is due to the link function, predict() having some way of back transforming the data. But if this is so, are the estimated coefficients wortheless in this case? I need to get accurate coefficients (for use in another model using offset), and have resorted to re-estimating them by running a second polynomial (lm() this time) on the predicted values from predict() of the glm. This is clearly not a nice way of doing things. Could anyone please inform me of why this is happening and of a better way around this? Code: glm2-glm(FEDSTATUS1~AGE+I(AGE^2), family=binomial(link=probit)) summary(glm2) ### first set of wrong coefficients nd1-expand.grid(AGE=c(1:70)) Pred.Fed1-predict(glm2,nd1,type=response) points(predict(glm2,nd1,type=response)~nd1$AGE, col=2) AGE11-c(11:70) Pred-t(rbind(Pred.Fed1,AGE11)) Pred-as.data.frame(Pred) model-lm(Pred$Pred.Fed1~Pred$AGE11+I(Pred$AGE11^2)) summary(model) ### accurate coefficients Thanks Samuel Riou University of Leeds __ 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] lag function doesn't work - what am i doing wrong?
I am trying to lag a time series. My data is in a matrix, but I coerce it into a ts object. But when I lag it and then look at the result, nothing has changed. What am I doing wrong? residsq-resid^2 residsq-as.ts(residsq) lag1residsq-lag(residsq,-1) residsq[1:5] 1 2 3 4 5 87.759 329882.188 5325849.333 31512.334 70865.228 lag1residsq[1:5] 1 2 3 4 5 87.759 329882.188 5325849.333 31512.334 70865.228 PS: I tried to lag the series manually using rbind(0, residsq), but the result ended up returning me [ 0, residsq(1), 0, residsq(2), 0, ] WTF how do you stack 1 element onto another in R? -- View this message in context: http://www.nabble.com/lag-function-doesn%27t-work---what-am-i-doing-wrong--tp19922651p19922651.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] Problems and bugs in vgam()
Hello R-Users, I have recently run into several problems using vgam() in the VGAM package. I am hoping someone might have some solutions... Briefly, I have been trying to fit GAM models for zero-altered negative binomial models. 1. When fitting smoothed parameters (e.g. s(X, df=2)) changing the degrees-of-freedom has no effect on the level of smoothing (e.g. number of knots for the spline). This appears to be the case even for the example on the vgam help page. data(hunua) fit2 = vgam(agaaus ~ s(altitude, df=2), binomialff, hunua) coef(fit2) (Intercept) s(altitude, df = 2) -1.16612592800.0003932463 fit10 = vgam(agaaus ~ s(altitude, df=10), binomialff, hunua) coef(fit10) (Intercept) s(altitude, df = 10) -1.1661259280 0.0003932463 2. There may be a bug when trying to run gam (mgcv) and vgam(VGAM) together. When I run vgam first, I am unable to get smoothed parameters using gam. This presents a problem if one would like to use the parameter estimates from a gam model to try to fit a vgam model. 3. For my own data, I have been having a very difficult time getting vgam to converge. The help pages says that convergence may depend strongly on the initial values (coefstart) provided, and I have been modifying them but to no avail. Is there another way or more values that need to be given to make vgam models fit? I frequently run into the error below. Any advice on how to overcome it? Applying Greenstadt modification to 357 matrices Error in ans[, index] - tmp777 : number of items to replace is not a multiple of replacement length In addition: Warning message: In checkwz(wz, M = M, trace = trace, wzeps = control$wzepsilon) : 357 elements replaced by 1.819e-12 In case someone has the interest or time in helping me get models to converge, I provide an example model and data. (Data are attached and the model code is below.) Thanks for your help. library(VGAM) Cnictdat=read.csv(Cnictdat.csv, header=T, sep=,) coefnict=c(-6.249e+00, -8.049e+00, -1.0e+01, -1.66e+00, 6.620960e-01, -1.046e-02, 4.586179e-01, -1.189e+00, -2.712e-03, -2.126218e+00, 7.242e-01, -1.149e+00, 9.377e-01, -8.457e-03, -3.035807e-02, -1.697e-02, 2.279305e-02, -4.7e-07, -1.797e-07, -1.183e-07, -4.3494e-05) abunddst=c(Cnictdat$SegDistKm)*1000 esw=0.5 fit4=vgam(Cnict~factor(Hab)+s(Clr, spar=2)+s(Rd, spar=2)+s(YL, spar=2)+ s(Pop, spar=2)+offset(log(2*esw*abunddst)), zanegbinomial, data=Cnictdat, coefstart=coefnict, control=vgam.control(se.fit=T, exp=1e-4, maxit=500, trace=T)) Thanks, John __ 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] lag function doesn't work - what am i doing wrong?
lag1resid is a time series, try str(residsq) str(lag1residsq) The problem is that when you subscript lag1resid you don't get a time series out from that. See ?window.ts or try the zoo or xts packages where subscripting of time series works. On Fri, Oct 10, 2008 at 1:27 PM, Scotty Nelson [EMAIL PROTECTED] wrote: I am trying to lag a time series. My data is in a matrix, but I coerce it into a ts object. But when I lag it and then look at the result, nothing has changed. What am I doing wrong? residsq-resid^2 residsq-as.ts(residsq) lag1residsq-lag(residsq,-1) residsq[1:5] 1 2 3 4 5 87.759 329882.188 5325849.333 31512.334 70865.228 lag1residsq[1:5] 1 2 3 4 5 87.759 329882.188 5325849.333 31512.334 70865.228 PS: I tried to lag the series manually using rbind(0, residsq), but the result ended up returning me [ 0, residsq(1), 0, residsq(2), 0, ] WTF how do you stack 1 element onto another in R? -- View this message in context: http://www.nabble.com/lag-function-doesn%27t-work---what-am-i-doing-wrong--tp19922651p19922651.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] Coefficients in a polynomial glm with family poisson/binomial
I don't know what you mean by XCoef x X. But your problem is (as it works if you specify normal in a glm) that the functional relationship between your predictors, i.e. Intercept+X+X^2, and Y is not linear for a binomial or a poisson distribution. Generalized linear model implies that the model is linear in the predictors. It does not mean, however, that the functional relationship between the linear predictor and Y is linear. E.g. Y=exp(Intercept+X+X^2) is linear in the predictor, but it is a nonlinear function because e is raised to the linear predictor. Consult any book on generalized linear models for more help. The estimated coefficients are typically not worthless as allow you to say how much your Y will change with a change of delta*x at the mean of X, for example, you just have to respect the functional form of the relationship between X and Y. Thus, the coefficients you get are accurate. Just what you do with them is not. For the last part of your question, I am not sure what you are trying to do there, but it does not sound right to me in the first place. Cheers, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von [EMAIL PROTECTED] Gesendet: Friday, October 10, 2008 12:30 PM An: r-help@r-project.org Betreff: [R] Coefficients in a polynomial glm with family poisson/binomial Dear R-users When running a glm polynomial model with one explanatory variable (example Y~X+X^2), with a poisson or binomial error distribution, the predicted values obtained from using the predict() function and those obtained from using the coefficients from the summary table as is in an equation of the form Y=INTERCEPT+ XCoef x X + XCoef x X^2, differ considerably. The former are correct and the latter are wrong. This does not occur using lm() or in a glm with family as normal. I conclude that this is due to the link function, predict() having some way of back transforming the data. But if this is so, are the estimated coefficients wortheless in this case? I need to get accurate coefficients (for use in another model using offset), and have resorted to re-estimating them by running a second polynomial (lm() this time) on the predicted values from predict() of the glm. This is clearly not a nice way of doing things. Could anyone please inform me of why this is happening and of a better way around this? Code: glm2-glm(FEDSTATUS1~AGE+I(AGE^2), family=binomial(link=probit)) summary(glm2) ### first set of wrong coefficients nd1-expand.grid(AGE=c(1:70)) Pred.Fed1-predict(glm2,nd1,type=response) points(predict(glm2,nd1,type=response)~nd1$AGE, col=2) AGE11-c(11:70) Pred-t(rbind(Pred.Fed1,AGE11)) Pred-as.data.frame(Pred) model-lm(Pred$Pred.Fed1~Pred$AGE11+I(Pred$AGE11^2)) summary(model) ### accurate coefficients Thanks Samuel Riou University of Leeds __ 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] map + some arbitrary locations' heights: some k ind of perspective or contour plot possible?
Werner Wernersen pensterfuzzer at yahoo.de writes: Hi, I thought about this but programming it seems rather difficult so I was wondering if a function exists for this in R (as most of the times it turns out that it does): I have a map (shapefile) and for about 50 points on that map (GPS locations) I have heights. Is there a function which can make a perspective plot or contour plot or the like from this little data? Or maybe some function I can abuse? The perspective, image, and contour plots all expect you to have interpolated to a regular grid first. It is perhaps easiest to use interp() in the akima package for this, although there are lots of alternatives. There has just been a thread on this on R-sig-geo, subject: interp.old and write.ascii.grid, showing how also to export the interpolated values to a grid file. Roger Bivand Thanks for any suggestions, Werner __ 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] number format in plots
Thanks, really it is difficult to find solution Jarek Peter Dalgaard pisze: Jarek Jasiewicz wrote: Hi It is probably simple but how to force in plot command number format: 2, 3, 4 etc. instead of 2e+04, 3e+04 etc. Not all that simple! It's one of those cases where you need to regain some control that you normally leave to the automatics. What you can do is to use one of format(), formatC(), sprintf(), to get the values into the format you want, xaxt=n to get rid of the default x axis and then axis(1, at=value, labels=fvalue). example of command: plot(x=data$along, y=data$rzedna,type=l, xlim=c(0,max(data$along)), ylim=c(200,1200), main=, xlab=length, ylab=height, cex.main=2, cex.lab=1.5, cex.axis=1.2, lwd=2) thanks Jarek __ 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] lag function doesn't work - what am i doing wrong?
thanks. i'll try zoo or xts. ts is a p.i.t.a. Gabor Grothendieck wrote: lag1resid is a time series, try str(residsq) str(lag1residsq) The problem is that when you subscript lag1resid you don't get a time series out from that. See ?window.ts or try the zoo or xts packages where subscripting of time series works. On Fri, Oct 10, 2008 at 1:27 PM, Scotty Nelson [EMAIL PROTECTED] wrote: I am trying to lag a time series. My data is in a matrix, but I coerce it into a ts object. But when I lag it and then look at the result, nothing has changed. What am I doing wrong? residsq-resid^2 residsq-as.ts(residsq) lag1residsq-lag(residsq,-1) residsq[1:5] 1 2 3 4 5 87.759 329882.188 5325849.333 31512.334 70865.228 lag1residsq[1:5] 1 2 3 4 5 87.759 329882.188 5325849.333 31512.334 70865.228 PS: I tried to lag the series manually using rbind(0, residsq), but the result ended up returning me [ 0, residsq(1), 0, residsq(2), 0, ] WTF how do you stack 1 element onto another in R? -- View this message in context: http://www.nabble.com/lag-function-doesn%27t-work---what-am-i-doing-wrong--tp19922651p19922651.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/lag-function-doesn%27t-work---what-am-i-doing-wrong--tp19922651p19923295.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] GWR Predictions' standard deviation
Eduardo Marinho eduardomarinho at gmail.com writes: Dear all, I would like to use a GWR model in order to spatially predict food insecurity in Africa. I have a georeferenced village data-bases and I've run a classic regression model (taking into account the spatial dependence of the errors) that works fairly well for Niger that is a quite homogenous country. Now, I would like to make the same thing for countries where it should be some heterogeneity in the spatial process, so I think it is essential to use a GWR. The problem comes when I try to get the standard deviation of my predicted values (not of my estimated coefficients). Indeed, this function seems not to be available in R or in any other software that runs GWR (I've checked for STATA and Matlab also). Does somebody know if there is any package that calculates that? If not, I would be interested to get some ideas about how can I program it in R. There has been a thread on this on the R-sig-geo list recently (this month), perhaps you could join that discussion? Since the chief aim of GWR (geographically weighted regression) is to explore variation in local coefficient estimates as an aid in resolving model misspecification, would it be sensible to try to handle the heterogeneity in some other way, leaving GWR as a last resort? The gwr() function in the spgwr package does not return the weighted lm fits that you would need to predict from. An argument could be added to the function to do this, but it involves coding, though not coding from scratch. Roger Bivand Thank you very much, Eduardo. __ 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] lag function doesn't work - what am i doing wrong?
Note that there is actually a good reason why this is so. ts can only represent regularly spaced series but the result of a subscripting operation might not be a regularly spaced series so you would not be able to guarantee that it could be a ts series as well. That's the reason for window.ts too since window.ts is constructed in such a way that the result is always a regular series so it can be presented as a ts object. The reason that zoo and xts can handle this is that they work with irregularly spaced series and subscripting an irregularly spaced series always creates another. For example: library(zoo) z - zoo(11:15) z[c(1, 3, 4)] The result of the last line is another zoo object but it would be impossible to do that with ts since the result in this case the result is irregularly spaced. On Fri, Oct 10, 2008 at 2:11 PM, Scotty Nelson [EMAIL PROTECTED] wrote: thanks. i'll try zoo or xts. ts is a p.i.t.a. Gabor Grothendieck wrote: lag1resid is a time series, try str(residsq) str(lag1residsq) The problem is that when you subscript lag1resid you don't get a time series out from that. See ?window.ts or try the zoo or xts packages where subscripting of time series works. On Fri, Oct 10, 2008 at 1:27 PM, Scotty Nelson [EMAIL PROTECTED] wrote: I am trying to lag a time series. My data is in a matrix, but I coerce it into a ts object. But when I lag it and then look at the result, nothing has changed. What am I doing wrong? residsq-resid^2 residsq-as.ts(residsq) lag1residsq-lag(residsq,-1) residsq[1:5] 1 2 3 4 5 87.759 329882.188 5325849.333 31512.334 70865.228 lag1residsq[1:5] 1 2 3 4 5 87.759 329882.188 5325849.333 31512.334 70865.228 PS: I tried to lag the series manually using rbind(0, residsq), but the result ended up returning me [ 0, residsq(1), 0, residsq(2), 0, ] WTF how do you stack 1 element onto another in R? -- View this message in context: http://www.nabble.com/lag-function-doesn%27t-work---what-am-i-doing-wrong--tp19922651p19922651.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/lag-function-doesn%27t-work---what-am-i-doing-wrong--tp19922651p19923295.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] glmmPQL
Jean-Baptiste Ferdy jean-baptiste.ferdy at univ-montp2.fr writes: Dear all, I am experiencing problems with glmmmPQL. I am trying to analyze binomial data with some spatial autocorrelation. Here is my code and some of the outputs m.1 - glmmPQL(fixed=cbind(nb_pc_02,I(nb_expr_02-nb_pc_02))~(PSDC99 +I(log(RFUCQ202))+PCCHOM99+sd_RFUCQ202+PCFEMCHOM)^2+langue, + random= ~ 1 | bidon, + correlation = corExp(form = ~ Longitude +Latitude), + family=quasibinomial, + na.action=na.exclude, + data=d.glmm) iteration 1 Erreur dans model.frame.default(formula = ~Longitude + Latitude + bidon les longueurs des variables diffèrent (trouvé pour 'bidon') Sorry about the french here... It is just saying that variables have different lengths. Which is obviously untrue, as they all are columns of the same data frame. The search() shows that I have attached the data.frame, as it is told in some FAQs. Hmm, that would seem unnecessary as long as you have the data= argument? If somebody has an idea on how to sort this issue out, I would appreciate ! I don't know. My only guess is that it _might_ have something to do with your na.action? What happens if you try the model on na.omit(d.glmm) ? You can try traceback() to see exactly where the crash happens (although that may not be directly useful). More usefully, can you provide a reproducible example (e.g. post the data somewhere, or cut it down to a subset that still causes the problem)? Another question: is the option correlation active in the latest version of lmer ? If it is, it might be an option to consider instead of glmmPQL. No, and not on Doug Bates' high-priority list. You might want to follow up to [EMAIL PROTECTED] ... cheers 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] Help MLE
LFRC feliperiehs at yahoo.com.br writes: Dear Ben Bolker, Thanks a lot for your help. I have two more questions: 1) My goal is maximize the function ( r = Y*log(comb)) but the parameters found, minimized the function (r = Y*log(comb)). Oh. Oops. Just change the sign ( r = -Y*log(comb)) or set fnscale=-1 (see ?optim) 2) What this function do? model2 - function(p) { do.call(Model,as.list(p)) } I got a little carried away, this is R Magic. mle() expects the function to be written out with a list of parameters ( func(param1,param2,param3) ), while optim and constrOptim want the function to have a single vector argument ( func(paramvec) ). model2() is a wrapper that converts a vector p into a list and passes it to the Model function. 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] rgl_081.708: rgl.snapshot fails, causing persistent problems
Yihui Xie wrote: Thanks, Duncan, I was encountered with the same problem as Michael, and just now I found the version you provided in your homepage could solve this problem well. Thanks very much, Yihui -- Using Duncan's homepage version also worked for me, and your test helped me slay the fear that something had gone horribly wrong with my desktop PC. I award you the rgl Medal of Valor. ;-) -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 4700 Keele Streethttp://www.math.yorku.ca/SCS/friendly.html Toronto, ONT M3J 1P3 CANADA __ 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] follow-up on Error when reading a SAS transport file (with sasxport.get from Hmisc)
I have done what P. Dalgaard has suggested and I don't find a descrepancy between the number of values and the number of labels: there 15 each... Any hint on what might go wrong here ? Here is the output The SAS format from proc contents VISITF . = INEXTXT -10 = Visit 1 [Screening] 0 = Visit 2 [Baseline] 1 = CRF Tracking 6 = Visit 6 7 = Tel.Contact (day 7) 14 = Visit 3 21 = Tel.Contact (day 21) 28 = Visit 4 35 = Tel.Contact (day 35) 43 = Visit 5 [EOT] 65 = Visit 6 [Follow-up] 777 = End of Study 888 = Concomitant Med. 999 = Adverse Events the cat output with sep= * (manual CR edit due to line length) Processing SAS dataset ADMIN .x= * 43 * 28 * 0 * 14 * 43 * 0 * 28 * 14 * 28 * 43 * 14 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 0 * 28 * 43 * 14 * 14 * 0 * 28 * 43 * 0 * 43 * 0 * 43 * 14 * 0 * 28 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 14 * 0 * 43 * 28 * 0 * 14 * 43 * 28 * 14 * 43 * 28 * 0 * 28 * 14 * 0 * 43 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 14 * 28 * 43 * 0 * 43 * 14 * 28 * 0 * 28 * 14 * 43 * 0 * 0 * 14 * 0 * 28 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 0 * 43 * 28 * 14 * 28 * 43 * 0 * 14 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 14 * 43 * 28 * 28 * 14 * 0 * 43 * 43 * 28 * 0 * 14 * 28 * 0 * 14 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 28 * 14 * 0 * 0 * 14 * 0 * 43 * 28 * 0 * 43 * 14 * 28 * 14 * 43 * 28 * 0 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 14 * 28 * 43 * 14 * 28 * 0 * 43 * 43 * 28 * 0 * 14 * 28 * 0 * 14 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 14 * 0 * 28 * 43 * 14 * 0 * 43 * 28 * 43 * 28 * 0 * 14 * 43 * 14 * 0 * 28 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 14 * 0 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 14 * 0 * 43 * 28 * 14 * 28 * 0 * 28 * 43 * 0 * 14 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 14 * 43 * 28 * 0 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 14 * 0 * 28 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0
[R] Sampling
Hi Guys, I am in desperate need with sampling. I am suppose to sample from a dataset. I use the following code: for(i in 1:5){temp[i]-sample(T2,40,replace=F) + show(temp)} but all the samples are the same, but I want them to be different.any suggestion? Thanks -- View this message in context: http://www.nabble.com/Sampling-tp19923768p19923768.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] follow-up on Error when reading a SAS transport file (with sasxport.get from Hmisc)
Jean-Louis Abitbol wrote: I have done what P. Dalgaard has suggested and I don't find a descrepancy between the number of values and the number of labels: there 15 each... Any hint on what might go wrong here ? Actually, I think you got it: factor(1,c(NA,1:4),c(1:5)) Error in factor(1, c(NA, 1:4), c(1:5)) : invalid labels; length 5 should be 1 or 4 but factor(1,c(NA,1:4),c(1:5),exclude=NULL) [1] 2 Levels: 1 2 3 4 5 so the issue is more than likely that your SAS format puts a label on . (missing). You probably need something like factor(x, f$value, f$label, exclude=if (!any(is.na(f$value))) NA) Here is the output The SAS format from proc contents VISITF . = INEXTXT -10 = Visit 1 [Screening] 0 = Visit 2 [Baseline] 1 = CRF Tracking 6 = Visit 6 7 = Tel.Contact (day 7) 14 = Visit 3 21 = Tel.Contact (day 21) 28 = Visit 4 35 = Tel.Contact (day 35) 43 = Visit 5 [EOT] 65 = Visit 6 [Follow-up] 777 = End of Study 888 = Concomitant Med. 999 = Adverse Events the cat output with sep= * (manual CR edit due to line length) Processing SAS dataset ADMIN .x= * 43 * 28 * 0 * 14 * 43 * 0 * 28 * 14 * 28 * 43 * 14 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 0 * 28 * 43 * 14 * 14 * 0 * 28 * 43 * 0 * 43 * 0 * 43 * 14 * 0 * 28 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 14 * 0 * 43 * 28 * 0 * 14 * 43 * 28 * 14 * 43 * 28 * 0 * 28 * 14 * 0 * 43 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 14 * 28 * 43 * 0 * 43 * 14 * 28 * 0 * 28 * 14 * 43 * 0 * 0 * 14 * 0 * 28 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 0 * 43 * 28 * 14 * 28 * 43 * 0 * 14 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 14 * 43 * 28 * 28 * 14 * 0 * 43 * 43 * 28 * 0 * 14 * 28 * 0 * 14 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 28 * 14 * 0 * 0 * 14 * 0 * 43 * 28 * 0 * 43 * 14 * 28 * 14 * 43 * 28 * 0 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 14 * 28 * 43 * 14 * 28 * 0 * 43 * 43 * 28 * 0 * 14 * 28 * 0 * 14 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 14 * 0 * 28 * 43 * 14 * 0 * 43 * 28 * 43 * 28 * 0 * 14 * 43 * 14 * 0 * 28 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 14 * 0 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 14 * 0 * 43 * 28 * 14 * 28 * 0 * 28 * 43 * 0 * 14 * 43 * 28 * 14 *
Re: [R] follow-up on Error when reading a SAS transport file (with sasxport.get from Hmisc)
You appear to have a label for an NA value, and that's the problem. I think you need to send an example to the package maintainers (see the posting guide) to help them debug what looks like a bug or undocumented restriction in their code (and it seems this is the same codebase in the two packages -- it is NOT R's read.xport in package foreign). On Fri, 10 Oct 2008, Jean-Louis Abitbol wrote: I have done what P. Dalgaard has suggested and I don't find a descrepancy between the number of values and the number of labels: there 15 each... Any hint on what might go wrong here ? Here is the output The SAS format from proc contents VISITF . = INEXTXT -10 = Visit 1 [Screening] 0 = Visit 2 [Baseline] 1 = CRF Tracking 6 = Visit 6 7 = Tel.Contact (day 7) 14 = Visit 3 21 = Tel.Contact (day 21) 28 = Visit 4 35 = Tel.Contact (day 35) 43 = Visit 5 [EOT] 65 = Visit 6 [Follow-up] 777 = End of Study 888 = Concomitant Med. 999 = Adverse Events the cat output with sep= * (manual CR edit due to line length) Processing SAS dataset ADMIN .x= * 43 * 28 * 0 * 14 * 43 * 0 * 28 * 14 * 28 * 43 * 14 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 0 * 28 * 43 * 14 * 14 * 0 * 28 * 43 * 0 * 43 * 0 * 43 * 14 * 0 * 28 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 14 * 0 * 43 * 28 * 0 * 14 * 43 * 28 * 14 * 43 * 28 * 0 * 28 * 14 * 0 * 43 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 14 * 28 * 43 * 0 * 43 * 14 * 28 * 0 * 28 * 14 * 43 * 0 * 0 * 14 * 0 * 28 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 0 * 43 * 28 * 14 * 28 * 43 * 0 * 14 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 14 * 0 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 14 * 43 * 28 * 28 * 14 * 0 * 43 * 43 * 28 * 0 * 14 * 28 * 0 * 14 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 28 * 14 * 0 * 0 * 14 * 0 * 43 * 28 * 0 * 43 * 14 * 28 * 14 * 43 * 28 * 0 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 14 * 28 * 43 * 14 * 28 * 0 * 43 * 43 * 28 * 0 * 14 * 28 * 0 * 14 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 14 * 0 * 28 * 43 * 14 * 0 * 43 * 28 * 43 * 28 * 0 * 14 * 43 * 14 * 0 * 28 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 14 * 0 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 28 * 14 * 0 * 43 * 14 * 0 * 43 * 28 * 14 * 28 * 0 * 28 * 43 * 0 * 14 * 43 * 28 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 43 * 28 * 14 * 14 * 43 * 28 * 0 * 14 * 0 * 14 * 0 * 43 * 28 * 43 * 14 * 0 * 28 * 0 * 43 * 28 * 14 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 43 * 28 * 14 * 0 * 0 * 28 * 14 * 28 * 14 * 0 * f$value= * NA * -10 * 0 * 1 * 6 * 7 * 14 * 21 * 28 * 35 * 43 * 65 * 777 * 888 * 999 * f$label= * INEXTXT * Visit 1 [Screening] * Visit 2 [Baseline] * CRF Tracking * Visit 6 * Tel.Contact (day 7) * Visit 3 * Tel.Contact (day 21) * Visit 4 * Tel.Contact (day 35) * Visit 5 [EOT] * Visit 6 [Follow-up] * End
[R] predicting from a local regression and plotting in lattice
Hi R community, I'm running R 2.7.2 on Windows XP SP2. I'm trying to (1) plot loess lines for each of my groupings using the same color for each group; (2) plot loess predicted values. The first part is easy: data1 - data.frame(Names=c(rep(Jon,9),rep(Karl,9)),Measurements=c(2,4,16,25,36,49,64,81,100,1,2,5,12,17,21,45,54,67),PlotAt=c(1:9,1:9)) data2 - data.frame(Names=c(rep(Jonah,9),rep(Beth,9)),Measurements=c(1:5,1,1,1,1,rep(20,9)),PlotAt=c(1:9,1:9)) xyplot(Measurements ~ PlotAt, data = data1, groups=Names, panel = function(...) { panel.superpose(...,col=gray,lty=1,lwd=2); }, panel.groups = function(...) panel.loess(...) ) My question is, how do I plot predicted values from loess to extend the lines beyond the range of x? Let's say I want all lines to stop at x = 15. Is there an easy way to do this? Thanks for any help, -AK [[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] plotCI
Hi all, I am using the function plotCI with the following command: plotCI(m.residuos.p.2 [1:41],li=m.residuos.p.3 [1:41],ui=m.residuos.p.4 [1:41],lty=1,ylab=) This generates exactly what I want except for the fact that I wanna drawn a line linking the points (m.residuos). How could I do that? Thanks a lot in advance, Caio [[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] plotCI
On 11/10/2008, at 10:15 AM, Caio Azevedo wrote: Hi all, I am using the function plotCI with the following command: plotCI(m.residuos.p.2 [1:41],li=m.residuos.p.3 [1:41],ui=m.residuos.p.4 [1:41],lty=1,ylab=) This generates exactly what I want except for the fact that I wanna drawn a line linking the points (m.residuos). For crying out loud don't write ``wanna''. In spoken English it may be acceptable (to some people) to *pronounce* ``want to'' as ``wanna''. It is *not* acceptable to write it that way. Rolf Turner ## Attention:\ This e-mail message is privileged and confid...{{dropped:9}} __ 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] Creating GUIs for R
Thanks, Roger, It seems simply great to me. I am far from being able to detect the drawbacks of the system, if any. I don't understand why this kind of programs are not of general use... With my best regards, Ricardo Bos, Roger wrote: I haven't heard Rpad mentioned yet, so I will mention it. Rpad allows you to run R code inside a browser window. You can many any kind of GUI you want using html forms and then call the R function from the html page. The Apache/Rpad install works on any platform and anyone who uses it just need a browser. I use it at my work to make my R function available to everyone else (none of whom know R). Very happy with it. Good luck, Roger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [Ricardo Rodriguez] Your XEN ICT Team Sent: Thursday, October 09, 2008 5:05 PM To: Greg Snow Cc: Antonio Martinez Cortizas; [EMAIL PROTECTED]; Wade Wall Subject: Re: [R] Creating GUIs for R Thanks Greg, Greg Snow wrote: I am not involved in the RExcel project. I have just had some discussions with the people that are, so you should contact them for specific questions. I believe that this currently only works on windows, there was some mention of possibly expanding it to OpenOffice so that it would be cross platform, but I have no idea if that has made it past the good idea stage. If we must away from Excel, don't you think that Gnumeric/R could be a nice option? Cheers, Ricardo -- Ricardo Rodríguez Your XEN ICT Team __ 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. ** * This message is for the named person's use only. It ma...{{dropped:23}} __ 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] bivariate non-parametric smoothing
Hi, I was wondering if there is a function in R which performs bivariate non parametric smoothing which allows for the possibility of including some weights in the smoothing (for each data points in my grid I have some predefined weights that I would like to include in the smoothing). Thanks, Ben _ [[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] rgl-snapshot failed (err-msg: failed)
On 10/10/2008 8:55 AM, Oliver Bandel wrote: Zitat von Duncan Murdoch [EMAIL PROTECTED]: On 10/10/2008 8:13 AM, Oliver Bandel wrote: Hello, I tried to use rgl.snapshot and it failed. The error message was not very verbose: == plot3d( motion[[idx+2]], motion[[idx+1]], motion[[idx]] ) rgl.snapshot(filename=/tmp/shot_01.png, fmt=png) [1] failed == There was a graphic created by rgl, but the snapshot was not created. The same problem occurs, when I use example(rgl.snapshot) The graphic/animation will be created, but there is no possibility to create the output-files. I use R version 2.4.0 Patched (2006-11-25 r39997). Is this a problem of this old version? or is there maybe a general problem, independent of the version? This is a problem with the build. rgl is not easy to build, because it links to a lot of external libraries. In this case it looks as though your build (the one from R-forge? You should say...) did not link to libpng. [...] I installed a binary (Debian etch). I may try the same things at my laptop. There I have Ubuntu, and it uses much newer R versions. maybe they also have fixed this problem. If the error messages would be a littlebid more verbose, this could help. Is it possible to configure the verboseness of the error messages? No. Better error messages would help, but this is an error you shouldn't see. You should have seen the failure to find libpng at configure time, and not tried to run rgl.snapshot. (On Windows it looks like this when it works: checking for libpng...yes I forget what it looks like on Linux.) But you're installing a binary, so you should complain to whoever produced it that they're producing a defective one. 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.
[R] TTR getYahooData?
Would it be possible to get data from uk.finance.yahoo.com instead from finance.yahoo.com. 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] how to evaluate a cubic Bezier curve (B-spline?) given the four control points
I'm trying to use R to determine the quality of a cubic Bezier curve approximation of an elliptical arc. I know the four control points and I want to compute (x,y) coordinates of many points on the curve. I can't find anything in either the base distribution or CRAN that does this; all the spline-related packages seem to be about *fitting* piecewise Bezier curves to a data set. Presumably, internally they have the capability I need, but it doesn't seem to be exposed in a straightforward way. Help? __ 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] Course of R in two days
Hi I have to teach a course of R in two day , I need some an advice about what must I teach? Thanks in advance [[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.