Re: [R] Likelihood optimization numerically
Dear List, Probably i am missing something important in optimize: llk.1st - function(alpha){ x - c(20.0, 23.9, 20.9, 23.8, 25.0, 24.0, 21.7, 23.8, 22.8, 23.1, 23.1, 23.5, 23.0, 23.0) n - length(x) llk1 - -n*log(gamma(alpha)) - n*alpha*log(sum(x)/(n*alpha)) + (alpha - 1)*(sum(log(x))) - (sum(x))/(sum(x)/(n*alpha)) return(llk1) } plot(llk.1st, 1,1000) optimize(f=llk.1st, interval =c(0,1000), tol = 0.0001) Reported result is approximately - alpha = 500 beta = 0.05 But i get - $minimum [1] 1000 ## whatever the upper bound is!! $objective [1] -Inf There were 50 or more warnings (use warnings() to see the first 50) also, optim(par = 500, fn = llk.1st) Error in optim(par = 500, fn = llk.1st) : function cannot be evaluated at initial parameters In addition: Warning messages: 1: In optim(par = 500, fn = llk.1st) : one-diml optimization by Nelder-Mead is unreliable: use optimize 2: In fn(par, ...) : value out of range in 'gammafn' Can anyone provide me hint? Thank you for your time. Ehsan http://www.youtube.com/profile_play_list?user=wildsc0p - Original Message From: Mohammad Ehsanul Karim [EMAIL PROTECTED] To: r-help@r-project.org Sent: Sunday, January 27, 2008 12:47:40 AM Subject: Likelihood optimization numerically Dear List, I am not sure how should i optimize a log-likelihood numerically: Here is a Text book example from Statistical Inference by George Casella, 2nd Edition Casella and Berger, Roger L. Berger (2002, pp. 355, ex. 7.4 # 7.2.b): data = x = c(20.0, 23.9, 20.9, 23.8, 25.0, 24.0, 21.7, 23.8, 22.8, 23.1, 23.1, 23.5, 23.0, 23.0) n - length(x) # likelihood from a 2 parameter Gamma(alpha, beta), both unknown llk = -n*log(gamma(alpha)) - n*alpha*log(beta) + (alpha - 1)*(sum(log(x))) - (sum(x))/beta # analytic 1st derivative solution w.r.t alpha, assuming beta known # by putting MLE of beta = sum(x)/(n*alpha) # (to simplify as far as possible analytically) llk.1st = - n*digamma(alpha) -n*(log(sum(x)/(n*alpha))+1) + (sum(log(x))) It feels like i should use nls(... , trace=T, start=c(alpha=...),nls.control(maxiter=100,tol=.1)) but not sure how. R.Version() $platform [1] i386-pc-mingw32 $arch [1] i386 $os [1] mingw32 $system [1] i386, mingw32 $status [1] $major [1] 2 $minor [1] 6.1 $year [1] 2007 $month [1] 11 $day [1] 26 $`svn rev` [1] 43537 $language [1] R $version.string [1] R version 2.6.1 (2007-11-26) Never miss a thing. Make Yahoo your home page. __ 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] [OT] vernacular names for circular diagrams
Dear useRs, by a circular diagram representation I mean what you will get by entering this at your R promt: pie(1:5) Nice to have R as a lingua franca :-) The folowing quote is from page 360 in this very interesting paper: @article{SpenceI2005, title = {No Humble Pie: The Origins and Usage of a Statistical Chart}, author = {Spence, I.}, journal = {Journal of Educational and Behavioral Statistics}, volume = {30}, pages = {353-368}, year = {2005} } QUOTE Like us, the French employ a gastronomical metaphor when they refer to Playfair's pie chart, but they have preferred instead to invoke the name of the wonderful round soft cheese from Normandy - the camembert. When I spent 4 months in Paris a few years ago, a friend invited my wife and me to lunch with her elderly father who lives in Rouen, Normandy, about an hour North of Paris. Her father inquired - coincidentally during the cheese course - what work I was doing in Paris; I replied that I was researching the activities of a Scot, William Playfair, during the revolutionary period. I told him that Playfair had invented several statistical graphs, including the pie chart, which I referred to, in French, as le camembert. After a stunned silence of perhaps a couple of seconds, the distinguished elderly gentleman looked me in the eye and exclaimed, Mon Dieu ! Notre camembert? UNQUOTE So, I'm just curious: how do you refer in your own language to this kind of graphic? How do you call it? Best, Jean Thanks to all who replied either privately or on the list. I have summarized the answers at the beginning of the following document: http://pbil.univ-lyon1.fr/members/lobry/R/diaposcam.pdf Let me know if you have more eatable examples. Best, Jean -- Jean R. Lobry([EMAIL PROTECTED]) Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I, 43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE allo : +33 472 43 27 56 fax: +33 472 43 13 88 http://pbil.univ-lyon1.fr/members/lobry/ __ 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] EXCUSE ME
excuse me if i cant formulate my question i start working with R im not a statistician but i need use statistics . THANK YOU - [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Putting frame around single panels in ggplot 2 and facet_grid()
Hi I want to highlight two panels in a grid created with facet_grid() by putting a box around it or usiong another background colour. Is this possible, and if yes, how? Thanks Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Plant Conservation Unit Department of Botany University of Cape Town Rondebosch 7701 South Africa Tel:+27 - (0)21 650 5776 (w) Fax:+27 - (0)86 516 2782 Fax:+27 - (0)21 650 2440 (w) Cell: +27 - (0)83 9479 042 Skype: RMkrug Google Chat: [EMAIL PROTECTED] 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.
Re: [R] [OT] vernacular names for circular diagrams
Jean lobry wrote: Dear useRs, by a circular diagram representation I mean what you will get by entering this at your R promt: pie(1:5) Nice to have R as a lingua franca :-) The folowing quote is from page 360 in this very interesting paper: @article{SpenceI2005, title = {No Humble Pie: The Origins and Usage of a Statistical Chart}, author = {Spence, I.}, journal = {Journal of Educational and Behavioral Statistics}, volume = {30}, pages = {353-368}, year = {2005} } QUOTE Like us, the French employ a gastronomical metaphor when they refer to Playfair's pie chart, but they have preferred instead to invoke the name of the wonderful round soft cheese from Normandy - the camembert. When I spent 4 months in Paris a few years ago, a friend invited my wife and me to lunch with her elderly father who lives in Rouen, Normandy, about an hour North of Paris. Her father inquired - coincidentally during the cheese course - what work I was doing in Paris; I replied that I was researching the activities of a Scot, William Playfair, during the revolutionary period. I told him that Playfair had invented several statistical graphs, including the pie chart, which I referred to, in French, as le camembert. After a stunned silence of perhaps a couple of seconds, the distinguished elderly gentleman looked me in the eye and exclaimed, Mon Dieu ! Notre camembert? UNQUOTE So, I'm just curious: how do you refer in your own language to this kind of graphic? How do you call it? Best, Jean Thanks to all who replied either privately or on the list. I have summarized the answers at the beginning of the following document: http://pbil.univ-lyon1.fr/members/lobry/R/diaposcam.pdf Let me know if you have more eatable examples. Best, Jean Nice. Two minor points: - the illustration for Danish has a cake which is speaking Polish - Stastistical (on the ISI page) -- 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.
[R] OR estimate
Hello, I have a loop with 1000 repetitions which includes OR computation of an exposure factor and outcome. I compute OR like this: t-table(exposure,outcome) oddsratio(t)$measure[estimate] This gives me the estimates for exposure=0 and exposure=1 but exposure=0 is the reference group and i need only the estimate for exposure=1. I specified a matrix OR with 3 columns (for OR estimate and lower and upper confidence limits) and 1000 rows OR[k,]-oddsratio(t)$measure[estimate]? I tried: exposure==1 or measure[estimate] and it gives me missing value NA. I appriciate any help, Sigalit. [[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] [OT] vernacular names for circular diagrams
Nice. Two minor points: - the illustration for Danish has a cake which is speaking Polish - Stastistical (on the ISI page) Ooops! I have changed the picture and fixed the typo, Thanks. -- Jean R. Lobry([EMAIL PROTECTED]) Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I, 43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE allo : +33 472 43 27 56 fax: +33 472 43 13 88 http://pbil.univ-lyon1.fr/members/lobry/ __ 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] scatterplot3d with categorical data
On 26/01/2008 9:21 PM, Geoff Russell wrote: On Jan 26, 2008 11:23 PM, Duncan Murdoch [EMAIL PROTECTED] wrote: On 26/01/2008 5:24 AM, Geoff Russell wrote: Dear users, I'm trying to produce a 3d bar plot but the x and y dimensions have categorical data -- so I only want 3 points on each axis. So I try: require(scatterplot3d) mymat-data.frame( x=c(1,1,1,2,2,2,3,3,3), y=c(1,2,3,1,2,3,1,2,3), z=c(1,2,3,4,5,6,7,8,9)) scatterplot3d(mymat, type=h, lwd=5, pch= , xlab=xlabel, ylab=ylabel, zlab=zlabel, xlim=c(1,3), ylim=c(1,3), lab=c(3,3), x.ticklabs=c(Low,Medium,High), y.ticklabs=c(Green,Blue,Black), main=My Bar Plot) But I still get x ticks at 1, 1.5, 2, 2.5, 3 on both x and y axes. I thought lab controlled this (according to the documentation). What am I doing wrong, or is there some restriction on the way the function works? I don't know the answer about scatterplot3d, but you can get approximately what you want with the rgl package using plot3d(mymat, type=h, xlab=xlabel, ylab=ylabel, zlab=zlabel, xlim=c(1,3), ylim=c(1,3), size=5, axes=FALSE, main=My Bar Plot) axis3d(x, at=1:3, labels=c(Low,Medium,High)) axis3d(y, at=1:3, labels=c(Green,Blue,Black)) grid3d(z, n=3) I couldn't install rgl due to the following problems: g++ -I/usr/local/lib/R/include -I/usr/local/lib/R/include -DHAVE_PNG_H -Iext -I/usr/local/include-fPIC -c par3d.cpp -o par3d.o par3d.cpp: In function 'void Specify(const char*, SEXPREC*)': par3d.cpp:128: error: invalid conversion from 'const char*' to 'char*' par3d.cpp:128: error: initialising argument 1 of 'Rboolean Rf_psmatch(char*, char*, Rboolean)' par3d.cpp:135: error: invalid conversion from 'const char*' to 'char*' par3d.cpp:135: error: initialising argument 1 of 'Rboolean Rf_psmatch(char*, char*, Rboolean)' make: *** [par3d.o] Error 1 chmod: cannot access `/usr/local/lib/R/library/rgl/libs/*': No such file or directory ERROR: compilation failed for package 'rgl' I think you're not using R 2.6.x or later, which has a different signature in psmatch. But I didn't realize changing rgl to match the new one would make it incompatible with older ones. You should be able to get rgl version 0.75 to compile. Duncan Murdoch But Uwe's suggestion with scatterplot3d gives a better result than I had. But I might use multiple 2d plots instead. Many thanks, Geoff. You might prefer to change the mouse controls to par3d(mouseMode=c(zAxis,zoom,fov)) so that the main mouse button does rotation about the vertical axis, rather than completely general rotation. 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] how to choose between adf and pp
Hi, I was wondering if there is a test that would help one choose whether adf or pp should be used. Would the shapiro.test work for this purpose? Thanks! -- Tom [[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] calling a list element from a list name passed to a function
Its a FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f On Jan 27, 2008 8:42 AM, Gonçalo Ferraz [EMAIL PROTECTED] wrote: Hi, 'true_name' is a list of numerical, matrix, and text items I do pass_name - true_name and pass the name of the list to a function so that the character class variable 'passed_name' contains the name of the list called 'true_name' Inside the function, how can I get a specified element from the list? For example, if I want to get true_name$month How do I get that item with the passed name? Thank you for any help! Gonçalo __ 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] double-click in RData file versus load( file )
On 26/01/2008 9:03 PM, Cleber Nogueira Borges wrote: hi Gabor and Duncan, I make a test and I find that the key of problem is the setwd() command in my Rprofile.site I don't understand this behaviour yet! :-( I understand it now. It's a small bug in the startup code. When you specify a file to restore on the command line, it has two effects: it changes the working directory to the directory of that file, and it loads the file. Unfortunately, the code that loaded the file assumed it was in the current directory and used a relative filename, not an absolute path. (I think this was due to workarounds for behaviour of old Windows versions that are no longer supported.) When your Rprofile.site file changed the working directory, R tried to load the test.RData file from there, and failed. So you didn't get what you wanted. I'll fix this in R-devel and R-patched, and it should make it into the next release. 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] OR estimate
sigalit mangut-leiba [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Hello, I have a loop with 1000 repetitions which includes OR computation of an exposure factor and outcome. I compute OR like this: t-table(exposure,outcome) oddsratio(t)$measure[estimate] This gives me the estimates for exposure=0 and exposure=1 but exposure=0 is the reference group and i need only the estimate for exposure=1. I specified a matrix OR with 3 columns (for OR estimate and lower and upper confidence limits) and 1000 rows OR[k,]-oddsratio(t)$measure[estimate]? I tried: exposure==1 or measure[estimate] and it gives me missing value NA. Things.you.should.learn-c(Read the posting guidelines, When asking question ... specify the package being used, Use str() to figure the inner details of objects, Provide examples) library(epitools) tapw - c(Lowest, Intermediate, Highest) outc - c(Case, Control) dat - matrix(c(2, 29, 35, 64, 12, 6),3,2,byrow=TRUE) dimnames(dat) - list(Tap water exposure = tapw, Outcome = outc) oddsratio(dat, rev=c) $data Outcome Tap water exposure Control Case Total Lowest29231 Intermediate 64 3599 Highest6 1218 Total 99 49 148 $measure odds ratio with 95% C.I. Tap water exposure estimatelowerupper Lowest1.00 NA NA Intermediate 7.355436 2.028317 51.3340 Highest 24.991793 5.139475 210.8298 $p.value two-sided Tap water exposure midp.exact fisher.exact chi.square Lowest NA NA NA Intermediate 1.018658e-03 0.0012611784 1.857572e-03 Highest 1.357958e-05 0.131817 6.858659e-06 $correction [1] FALSE attr(,method) [1] median-unbiased estimate mid-p exact CI ORtbl-oddsratio(dat, rev=c) str(ORtbl) List of 4 $ data : num [1:4, 1:3] 29 64 6 99 2 35 12 49 31 99 ... ..- attr(*, dimnames)=List of 2 .. ..$ Tap water exposure: chr [1:4] Lowest Intermediate Highest Total .. ..$ Outcome : chr [1:3] Control Case Total $ measure : num [1:3, 1:3] 1.00 7.36 24.99NA 2.03 ... ..- attr(*, dimnames)=List of 2 .. ..$ Tap water exposure : chr [1:3] Lowest Intermediate Highest .. ..$ odds ratio with 95% C.I.: chr [1:3] estimate lower upper $ p.value : num [1:3, 1:3] NA 1.02e-03 1.36e-05 NA 1.26e-03 ... ..- attr(*, dimnames)=List of 2 .. ..$ Tap water exposure: chr [1:3] Lowest Intermediate Highest .. ..$ two-sided : chr [1:3] midp.exact fisher.exact chi.square $ correction: logi FALSE - attr(*, method)= chr median-unbiased estimate mid-p exact CI # Now that you know that ORtbl os a list with 4 elements, # assing that list to a new object and it will be simpler measure.list - ORtbl$measure measure.list odds ratio with 95% C.I. Tap water exposure estimatelowerupper Lowest1.00 NA NA Intermediate 7.355436 2.028317 51.3340 Highest 24.991793 5.139475 210.8298 measure.list[1,2] [1] NA str(measure.list) num [1:3, 1:3] 1.00 7.36 24.99NA 2.03 ... - attr(*, dimnames)=List of 2 ..$ Tap water exposure : chr [1:3] Lowest Intermediate Highest ..$ odds ratio with 95% C.I.: chr [1:3] estimate lower upper measure.list[1] [1] 1 measure.list[1,] estimatelowerupper 1 NA NA measure.list[2] [1] 7.355436 measure.list[2,1] [1] 7.355436 measure.list[1,2] [1] NA measure.list[,1] Lowest Intermediate Highest 1.00 7.35543624.991793 #So you want the first column of the second row of the measure list: ORtbl$measure[2,1] [1] 7.355436 -- David Winsemius __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] using facet_grid() from ggplot2 with additional text in labels
I am using ggplot2 at the moment and I must say it is definitely better then ggplot - good work. My problem is that I am using facet_grid() in the following way: p - ggplot(ssq, aes(x=year, y=-log(ssq))) p + geom_point() + facet_grid(me*gi~cs*rz) and it works nicely, except that I would like to have, in naddition to the values of me, gi, cs and rz the name of the variable. I.e: if gi is 1, 2 and 3 I would like to have gi = 1:, gi = 2 and gi = 3 as labels of the p[anels. I did it with ggplot, but I don't remember and I have lost the code ... ggopt(strip.text = function(variable, value) paste(variable, value, sep== )) Just a small comment on the package: as I am using emacs with ess, I have to press _ twice to get the underscore in the commands (as the first one is replaced with - and then reverted to _) - would it be possible to change these in the next release with . (but still provide an alias with _)? I know it's a pain but I think emacs users need to change their ways (and default settings) because as time goes by I think you'll see increasing numbers of packages using _ instead of . to prevent conflicts with S3. It would be nice if R had a standard convention for separating words in functions. Hadley -- http://had.co.nz/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] maptools no such file
can you open your shapefile using reaPolyShape in sp? [EMAIL PROTECTED] wrote: Hello, I'm having problems reading a shapefile with read.shape (maptools). I'm absolutely sure my file is there, but I get no such file. The wd is ok, since read.table for example does find the file. getwd() [1] D:/somedirectory/R scripts read.table(cities.shp) Error in read.table(cities.shp) : empty beginning of file In addition: Warning message: In read.table(cities.shp) : incomplete final line found by readTableHeader on 'cities.shp' read.shape(cities.shp) Error in getinfo.shape(filen) : No such file Any thoughts? Thanks Pieter -- This message was sent on behalf of [EMAIL PROTECTED] at openSubscriber.com http://www.opensubscriber.com/messages/r-help@r-project.org/topic.html __ 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] bug in difftime with as.POSIXct
Oh, I'm sorry to be posting a reply to my own stupid question, but the problem is that I had not specified GMT, and so it was using local time, which changes to 'save daylight. This is demonstrated below: unclass(as.POSIXct(1975-04-27,tz=GMT))[1]-unclass(as.POSIXct(1975-04-28,tz=GMT))[1] [1] -86400 unclass(as.POSIXct(1975-04-27))[1]-unclass(as.POSIXct(1975-04-28))[1] [1] -82800 -- View this message in context: http://www.nabble.com/bug-in-difftime-with-as.POSIXct-tp15122749p15122755.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] Putting frame around single panels in ggplot 2 and facet_grid()
What about using geom_vline and geom_hline to draw borders. I just couldn't find the way to set the intercept max value for geom_vline and hardcoded it to 5.5 d- ggplot(mtcars, aes(x=mpg, y=wt)) + geom_point() + facet_grid(. ~ cyl)+ scale_y_continuous(limits=c(0,NA))+ scale_x_continuous(limits=c(0,NA)) mtcars2-data.frame((mtcars),intercept=0) dd- d + geom_hline(data=mtcars2,colour=red,size=3)+ geom_vline(data=mtcars2,colour=red,size=3) mtcars3-data.frame((mtcars),intercept=5.5) ddd - dd + geom_hline(data=mtcars3,colour=red,size=3) ddd Hi I want to highlight two panels in a grid created with facet_grid() by putting a box around it or usiong another background colour. Is this possible, and if yes, how? It's possible, but not particularly easy. You could do something like: # Background colours background - data.frame( cyl = c(4, 6, 8), fill = c(NA, alpha(red, 0.2), alpha(black, 0.3)) ) # Points defining square region for background square - with(mtcars, data.frame( x = c(min(mpg), max(mpg), max(mpg), min(mpg)), y = c(min(wt), min(wt), max(wt), max(wt)) )) ggplot(mtcars, aes(x=mpg, y=wt)) + geom_polygon(aes(x=x,y=y, fill=fill), data=merge(background, square)) + geom_point() + scale_fill_identity() + facet_grid(. ~ cyl) 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. Felipe D. Carrillo Fishery Biologist US Fish Wildlife Service California, USA Be a better friend, newshound, and __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Data manipulation question (opposite of table?)
Dear R users, I am a new user (probably obvious by my question) and have really learned a lot from reading this list. Thank you all very much. My main struggles with R are with data manipulation. So here is my question... I have data that is organized as below, this is a short example. value count 1123225 1588524 2246420 etc... the 'value' field is distances and the 'count' field is the number of times that each distance occurs. So I guess it is in the same format as the output for the table() function. What I need to do is make one long vector (or list) that includes all the actual numbers. In other words 11232 listed 25 times followed by 15885 listed 24 times etc. etc. Thank you again in advance, Michael Never miss a thing. Make Yahoo your home page. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Data manipulation question (opposite of table?)
Michael Denslow [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Dear R users, I am a new user (probably obvious by my question) and have really learned a lot from reading this list. Thank you all very much. My main struggles with R are with data manipulation. So here is my question... I have data that is organized as below, this is a short example. value count 1123225 1588524 2246420 etc... the 'value' field is distances and the 'count' field is the number of times that each distance occurs. So I guess it is in the same format as the output for the table() function. What I need to do is make one long vector (or list) that includes all the actual numbers. In other words 11232 listed 25 times followed by 15885 listed 24 times etc. etc. Try something like this? dt-data.frame(value=c(11123,14585),count=c(3,5)) exp.dt-with(dt,rep(value,count)) exp.dt [1] 11123 11123 11123 14585 14585 14585 14585 14585 -- David Winsemius __ 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] [OT] Open source archive program on windows
I am looking for a recommendation for an open source competitor to Winzip. I seem to recall Brian Ripley mentioning one in the last year or so, but couldn't find it in the mail archives. (Searching on Ripley there is somehow not terribly useful.) Suggestions? David Scott _ David Scott Department of Statistics, Tamaki Campus The University of Auckland, PB 92019 Auckland 1142,NEW ZEALAND Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 Email: [EMAIL PROTECTED] Graduate Officer, Department of Statistics Director of Consulting, Department of Statistics __ 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] titles with superscript and variale value
Try this plot(rnorm(100), main=bquote(Family ~ Gaussian ~ ; ~ D^2 == .(d2))) On 27/01/2008, Monica Pisica [EMAIL PROTECTED] wrote: Hi everyone, I am trying to write a title for a plot which has a superscript like D^2 and a value of a variable stored in that variable. i am not sure if i am clear so i will try an example: Suppose i want my title to be like: Family: Gaussian; D^2 = 0.45 where i have the value 0.45 stored in variable d2 (which comes from some previous calculations, and depending which actual variables i am plotting, this d2 can have different values), and i want D^2 to be D superscrip 2. I've tried the following command lines: title(main = expression(paste( Family: Gaussian; , D^2, = , d2))) which gives me the right superscript but instead of the value stored in d2 i get actually d2 or title(main = paste(Family: Gaussian; , expression(D^2), = ,d2)) which gives me the real value stored in d2 but no superscript for D it comes like D^2 instead. I've tried few other command lines more foolish than the ones above with no result. I will really appreciate if you have any suggestions to get this title right. Thanks, Monica _ Climb to the top of the charts! Play the word scramble challenge with star power. n __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O __ 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] [OT] Open source archive program on windows
i've been using 7zip and am very happy with it. On Jan 27, 2008 4:46 PM, David Scott [EMAIL PROTECTED] wrote: I am looking for a recommendation for an open source competitor to Winzip. I seem to recall Brian Ripley mentioning one in the last year or so, but couldn't find it in the mail archives. (Searching on Ripley there is somehow not terribly useful.) Suggestions? David Scott _ David Scott Department of Statistics, Tamaki Campus The University of Auckland, PB 92019 Auckland 1142,NEW ZEALAND Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 Email: [EMAIL PROTECTED] Graduate Officer, Department of Statistics Director of Consulting, Department of Statistics __ 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. -- === WenSui Liu Statistical Project Manager ChoicePoint Precision Marketing (http://spaces.msn.com/statcompute/blog) __ 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] maptools no such file
No, I get the same error message there... -- This message was sent on behalf of [EMAIL PROTECTED] at openSubscriber.com http://www.opensubscriber.com/message/r-help@r-project.org/8476734.html __ 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] bug in difftime with as.POSIXct
Thanks, that article is very helpful. D. Gabor Grothendieck wrote: Read relevant article in R News 4/1. -- View this message in context: http://www.nabble.com/bug-in-difftime-with-as.POSIXct-tp15122749p15125302.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] Linux, UNIX, XP32, Vista X64 or ...? [SEC=UNCLASSIFIED]
Thank you very much for the explanation and clarification, Patrick. It is a great help. Best regards, Jin -Original Message- From: Patrick Burns [mailto:[EMAIL PROTECTED] Sent: Friday, 25 January 2008 9:48 To: Li Jin Cc: [EMAIL PROTECTED]; r-help@r-project.org Subject: Re: [R] Linux, UNIX, XP32, Vista X64 or ...? [SEC=UNCLASSIFIED] Perhaps there are other opinions, but from my point of view R is spectacularly similar in Linux and Windows (and will be virtually identical in Linux and Unix). As long as you are doing R things, you should be in home territory. I regularly transfer R objects between 64-bit Linux and Windows, and have never had any problems. 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) [EMAIL PROTECTED] wrote: Hi Peter, Thank you for the quick answer. Given that we have UNIX system available here in Geoscience Australia, I am wondering if UNIX is also faster and with 64 bit build. Perhaps they may be kind enough to let me have a Linux system. As I only have experience in using Windows PC, what kind of challenges are there for using R in other systems like UNIX and Linux? Thanks again, Jin -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Thursday, 24 January 2008 10:23 To: Li Jin Cc: r-help@r-project.org Subject: Re: [R] Linux, UNIX, XP32, Vista X64 or ...? [SEC=UNCLASSIFIED] [EMAIL PROTECTED] wrote: Dear All, I am currently using R in Windows PC with a 2 GB of RAM. Some pretty large datasets are expected soon, perhaps in an order of several GB. I am facing a similar situation like Ralph, either to get a new PC with a bigger RAM or else. I am just wondering if R is getting faster in other systems like UNIX or Linux. Any suggestions are appreciated. Regards, Jin It has always been faster in Linux than in Windows on the same hardware. In addition, the toolchain issues have been holding up 64 bit development on 64 bit Windows, whereas 64 bit build has been working on Linux for years. Jin Li, PhD Spatial Modeller/ Computational Statistician Marine Coastal Environment Geoscience Australia Ph: 61 (02) 6249 9899 Fax: 61 (02) 6249 9956 email: [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley Sent: Thursday, 24 January 2008 12:05 To: Ralph79 Cc: r-help@r-project.org Subject: Re: [R] Problems with XP32-3GB-patch?/ Worth upgrading to Vista X64? On Wed, 23 Jan 2008, Ralph79 wrote: Dear R-Users, as I will start a huge simulation in a few weeks, I am about to buy a new and fast PC. I have noticed, that the RAM has been the limiting factor in many of my calculations up to now (I had 2 GB in my old system, but Windows still used quite a lot of virtual memory), hence my new computer will have 4 GB of fast DDR2-800 RAM. However, I know that 1.) Windows 32 bit cannot make use of more than about 3,2 GB RAM and 2.) it is normally not allowed to allocate more than 2 GB of RAM to one single application (at least under XP, I don't know if that has changed under Vista?). I remember from the R-FAQ that you can manually adjust XP so that it allocates up to 3 GB to one application (the 3GB patch), but I read in a PC-magazine and some message boards that this may cause problems. Does anybody of you successfully use this trick without any problems? Yes, many people: most 32-bit Exchange servers use it. Please don't rate the advice in the R documentation below tittle-tattle you read on the web. Would it be wise to use a 64bit OS, as e.g. Vista X64? I think, under Vista X64 it should be no problem to allocate 4 GB of RAM to R. Any experiences with that? That's what the rw-FAQ says, and we do write answers based on experience! Thanks in advance, Ralph Wirth - Ralph Wirth University Erlangen-Nuremberg, Chair of Statistics GfK Group, Department of Methods and Product Development __ 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] [OT] Open source archive program on windows
On 27/01/2008 4:46 PM, David Scott wrote: I am looking for a recommendation for an open source competitor to Winzip. I seem to recall Brian Ripley mentioning one in the last year or so, but couldn't find it in the mail archives. (Searching on Ripley there is somehow not terribly useful.) The R toolset includes the Info-zip program zip and unzip. These are open source, but not exactly competitors to Winzip, in that they are command-line only. 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] titles with superscript and variale value
Hi Henrique, Thanks a lot - this works like a charm . and actually i can have it in the plot command instead of writing a different line of command for tile ;-) Monica Date: Sun, 27 Jan 2008 19:52:59 -0200 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [R] titles with superscript and variale value CC: r-help@r-project.org Try this plot(rnorm(100), main=bquote(Family ~ Gaussian ~ ; ~ D^2 == .(d2))) On 27/01/2008, Monica Pisica [EMAIL PROTECTED] wrote:Hi everyone,I am trying to write a title for a plot which has a superscript like D^2 and a value of a variable stored in that variable. i am not sure if i am clear so i will try an example: Suppose i want my title to be like: Family: Gaussian; D^2 = 0.45 where i have the value 0.45 stored in variable d2 (which comes from some previous calculations, and depending which actual variables i am plotting, this d2 can have different values), and i want D^2 to be D superscrip 2. I've tried the following command lines: title(main = expression(paste( Family: Gaussian; , D^2, = , d2)))which gives me the right superscript but instead of the value stored in d2 i get actually d2 or title(main = paste(Family: Gaussian; , expression(D^2), = ,d2))which gives me the real value stored in d2 but no superscript for D it comes like D^2 instead.I've tried few other command lines more foolish than the ones above with no result. I will really appreciate if you have any suggestions to get this title right. Thanks,Monica _ Climb to the top of the charts! Play the word scramble challenge with star power. n __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O _ Need to know the score, the latest news, or you need your Hotmail®-get your fix. [[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] [OT] Open source archive program on windows
This is a popular one: http://www.7-zip.org/ Cheers, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Duncan Murdoch Sent: Sunday, January 27, 2008 6:37 PM To: David Scott Cc: [EMAIL PROTECTED] Subject: Re: [R] [OT] Open source archive program on windows On 27/01/2008 4:46 PM, David Scott wrote: I am looking for a recommendation for an open source competitor to Winzip. I seem to recall Brian Ripley mentioning one in the last year or so, but couldn't find it in the mail archives. (Searching on Ripley there is somehow not terribly useful.) The R toolset includes the Info-zip program zip and unzip. These are open source, but not exactly competitors to Winzip, in that they are command-line only. 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-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] Linux, UNIX, XP32, Vista X64 or ...? [SEC=UNCLASSIFIED]
On the PC there is a builtin GUI but not on UNIX and there are some packages that are OS specific in which case you might get more or less selection but probably more. Also depending on the specific system you may have greater difficulty installing certain packages due to the need to compile them on UNIX and the possibility exists that you don't quite have the right libraries. On Windows you get binaries so this is not a problem. I have repeatedly found that common packages that I took for granted on Windows had some problem with installation on UNIX and I had to hunt around and figure out what the problem was with my UNIDX libraries or possibly some other problem. For all R packages this won't be a problem but for packages that use C and FORTRAN this can be. Although I am lumping all UNIX systems together I think this varies quite a bit from one particular type/distro of UNIX/Linux to another and I suspect if you are careful in picking out the right one (if you have a choice) you will actually have zero problems. On Jan 23, 2008 6:08 PM, [EMAIL PROTECTED] wrote: Dear All, I am currently using R in Windows PC with a 2 GB of RAM. Some pretty large datasets are expected soon, perhaps in an order of several GB. I am facing a similar situation like Ralph, either to get a new PC with a bigger RAM or else. I am just wondering if R is getting faster in other systems like UNIX or Linux. Any suggestions are appreciated. Regards, Jin Jin Li, PhD Spatial Modeller/ Computational Statistician Marine Coastal Environment Geoscience Australia Ph: 61 (02) 6249 9899 Fax: 61 (02) 6249 9956 email: [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prof Brian Ripley Sent: Thursday, 24 January 2008 12:05 To: Ralph79 Cc: r-help@r-project.org Subject: Re: [R] Problems with XP32-3GB-patch?/ Worth upgrading to Vista X64? On Wed, 23 Jan 2008, Ralph79 wrote: Dear R-Users, as I will start a huge simulation in a few weeks, I am about to buy a new and fast PC. I have noticed, that the RAM has been the limiting factor in many of my calculations up to now (I had 2 GB in my old system, but Windows still used quite a lot of virtual memory), hence my new computer will have 4 GB of fast DDR2-800 RAM. However, I know that 1.) Windows 32 bit cannot make use of more than about 3,2 GB RAM and 2.) it is normally not allowed to allocate more than 2 GB of RAM to one single application (at least under XP, I don't know if that has changed under Vista?). I remember from the R-FAQ that you can manually adjust XP so that it allocates up to 3 GB to one application (the 3GB patch), but I read in a PC-magazine and some message boards that this may cause problems. Does anybody of you successfully use this trick without any problems? Yes, many people: most 32-bit Exchange servers use it. Please don't rate the advice in the R documentation below tittle-tattle you read on the web. Would it be wise to use a 64bit OS, as e.g. Vista X64? I think, under Vista X64 it should be no problem to allocate 4 GB of RAM to R. Any experiences with that? That's what the rw-FAQ says, and we do write answers based on experience! Thanks in advance, Ralph Wirth - Ralph Wirth University Erlangen-Nuremberg, Chair of Statistics GfK Group, Department of Methods and Product Development -- 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-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Package simex
Dear R-helpers, It is not clear to me how you get measurement.error SD when you have a single dataset, and it is not clear to me how sensitive SIMEX is to errors in the estimates of measurement error. Could someone please point me to the relevant literature? _ 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/ __ 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 fill bar plot with textile rather than color
Hi, I'm looking for a tool which can fill bar chart with dash, skewed line, or grids, rather than pure color. Any one have the idea how to do that in R? Or maybe in Matlab will also be helpful. Thanks very much. -- View this message in context: http://www.nabble.com/How-to-fill-bar-plot-with-textile-rather-than-color-tp15127737p15127737.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] Package Installation produces gcc fails sanity check error when installing RODBC error
Dear Friends, I haven't used R very much, but am hoping to use it more. I recently installed it again on my Linux machine and began to install a few packages, which I figure I will need. I am also new to this forum. I hope I am posting it in the right place. I am trying to install a few packages in R and am receiving error messages. Since the error messages are different for each install package request, I am posting them separately. The first error is with the installation of RODBC. I suspect the problem is with how the R package installer interfaces with gcc. The basic error message is: gcc -std=gnu99 -E configure: error: C preprocessor gcc -std=gnu99 -E fails sanity check See `config.log' for more details. ERROR: configuration failed for package 'RODBC' See below for full output I have been Googling the issue all weekend and have found similar errors, but not exactly the same. Several of the responders to these error help requests suggested that they install additional software, which I already have. The following relevant software is installed on the machine: cpp cpp41 cpp42 gcc gcc-c++ gcc-fortran gcc-fortran-32-bit gcc-gij gcc-info gcc-java gcc-locale gcc-objc gcc-obj-c++ gcc41 gcc41-c++ gcc41-fortran gcc41-gij gcc41-java gcc41-objc gcc41-obj-c++ gcc41-testresults gcc42 gcc42-ada gcc42-c++ gcc42-fortran gcc42-fortran-32bit gcc42-gij gcc42-info gcc42-java gcc42-locale gcc42-objc gcc42-obj-c++ gcc42-objc-32bit gcc42-testresults libgcc42 libgcc42-32bit libgcc41 libgcc41-32bit libgcj42 libgcj42-32bit glibc glibc-32-bit glibc-devel glibc-devel-32bit glibc-html glibc-i18ndata glibc-info glibc-locale glibc-locale-32bit glibc-obsolete glibc-profile glibc-profile-32bit I am running R version 2.6.1 (2007-11-26) on Suse Linux 10.3 64-bit x86_64 on a Boxx Technologies computer with a TYAN Thunder K8WE S2895 Motherboard with 4Gb Ram and 2 dual CPUs (total of 4 CPUs). The CPUs are AMD Opteron. Hard Disk Usage is 4 150 Gb SATA drives array with a Com3 9550SX Controller set at RAID 5. Initially I tried installation through Rkward, but also tried from the R command prompt as well. Rkward provides more verbose error reporting. Below is the full output when I attempt to install the package through Rkward [Settings][Configure Packages]. Thanks for your help, Joe Full Output R version 2.6.1 (2007-11-26 Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. options (repos=c (CRAN=http://lib.stat.cmu.edu/R/CRAN;)) install.packages (pkgs=c (RODBC), lib=/home/joe/R/x86_64-unknown-linux-gnu-library/2.6, destdir=/home/joe/.rkward/package_archive, dependencies=TRUE) trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/RODBC_1.2-2.tar.gz' Content type 'application/x-gzip length 90330 bytes (88 Kb) opened URL downloaded 88 Kb /home/joe/R/x86_64-unknown-linux-gnu-library/2.6 * Installing *source* package 'RODBC' ... checking for gcc... gcc -std=gnu99 checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc -std=gnu99 accepts -g... yes checking for gcc -std=gnu99 option to accept ANSI C... none needed checking how to run the C preprocessor... gcc -std=gnu99 -E configure: error: C preprocessor gcc -std=gnu99 -E fails sanity check See `config.log' for more details. ERROR: configuration failed for package 'RODBC' ** Removing '/home/joe/R/x86_64-unknown-linux-gnu-library/2.6/RODBC' Warning message: In install.packages(pkgs = c(RODBC), lib = /home/joe/R/x86_64-unknown-linux-gnu-library/2.6, : installation of package 'RODBC' had non-zero exit status q () The error message suggests that I check the config.log. When I look at the config.log, it appears to be reportinting debug information on a separate problem having to do with the installation of HP multifunction printer software, but not to do with the RODBC package. Here is a copy of that. Perhaps you can see something that I can't:
[R] Package Installation produces linux/limits.h: No such file or directory error when installing the lpSolve package
Dear Friends, I am trying to install a few packages in R and am receiving error messages. Since the error messages are different, I am posting them separately. The second error is with the installation of lpSolve. The core error message is: In file included from /usr/include/bits/posix1_lim.h:153, from /usr/include/limits.h:145, from /usr/lib64/gcc/x86_64-suse-linux/4.2.1/include/limits.h:122, from /usr/lib64/gcc/x86_64-suse-linux/4.2.1/include/syslimits.h:7, from /usr/lib64/gcc/x86_64-suse-linux/4.2.1/include/limits.h:11, from colamd.c:677: /usr/include/bits/local_lim.h:36:26 error: linux/limits.h: No such file or directory make: *** [colamd.o] Error 1 ERROR: compilation failed for package 'lpSolve' The first things that I tried was to figure out where linux/limits.h was. I discovered that there are seven versions of limits.h on the system and they are not identical. /usr/include/limits.h /usr/src/linux-2.6.22.13-0.3/Documentation/i2c/chips/limits.h /usr/include/c++/4.2.1/tr1/limits.h /usr/lib64/qt4/demos/qtdemo/xml/limits.h /usr/src/linux-2.6.22.13-0.3/include/linux/limits.h /usr/src/linux-2.6.22.13-0.3/include/asm-arm/limits.h /usr/src/linux-2.6.22.13-0.3/include/asm-arm26/limits.h Only one has linux immediately preceding it in the path: /usr/src/linux-2.6.22.13-0.3/include/linux/limits.h I assume that /usr/include/bits/local_lim.h is trying to use a relative path. The only line in local_lim.h with limits.h in it is: #include linux/limits.h So, I tried modifying the line to read: #include /usr/src/linux-2.6.22.13-0.3/include/linux/limits.h That did not work, so I changed it back again. I guess my theory about it looking for a relative path was wrong. Since then, I have been Googling the issue all weekend and have found similar errors, but not exactly the same. Some are suggesting changing kernel headers and other files. Since the context of these other posts are dissimilar, I figured it best not to mess with kernel headers or some of the other radical solutions offered. There was one suggestion in a post to install glibc-headers, however, I cannot seem to find that for Suse 10.3. Is it something included in another package? Is it something that is now obsolete? CAN ANYONE HELP ME DEBUG THIS? I am running R version 2.6.1 (2007-11-26) on Suse Linux 10.3 64-bit x86_64 on a Boxx Technologies computer with a TYAN Thunder K8WE S2895 Motherboard with 4Gb Ram and 2 dual CPUs (total of 4 CPUs). The CPUs are AMD Opteron. Hard Disk Usage is 4 150 Gb SATA drives array with a Com3 9550SX Controller set at RAID 5. The full error message received from Rkward upon the package installation attempt was: R version 2.6.1 (2007-11-26) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. options (repos=c (CRAN=http://lib.stat.cmu.edu/R/CRAN;)) install.packages (pkgs=c (lpSolve), lib=/home/joe/R/x86_64-unknown-linux-gnu-library/2.6, destdir=/home/joe/.rkward/package_archive, dependencies=TRUE) trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/lpSolve_5.5.8.tar.gz' Content type 'application/x-gzip' length 449804 bytes (439 Kb) opened URL downloaded 439 Kb /home/joe/R/x86_64-unknown-linux-gnu-library/2.6 * Installing *source* package 'lpSolve' ... ** libs gcc -std=gnu99 -I/usr/lib64/R/include -I/usr/lib64/R/include -I . -DINTEGERTIME -DPARSER_LP -DBUILDING_FOR_R -DYY_NEVER_INTERACTIVE -DUSRDLL -DCLOCKTIME -DRoleIsExternalInvEngine -DINVERSE_ACTIVE=INVERSE_LUSOL -DINLINE=static -DParanoia -I/usr/local/include-fpic -g -O2 -c colamd.c -o colamd.o In file included from /usr/include/bits/posix1_lim.h:153, from /usr/include/limits.h:145, from /usr/lib64/gcc/x86_64-suse-linux/4.2.1/include/limits.h:122, from /usr/lib64/gcc/x86_64-suse-linux/4.2.1/include/syslimits.h:7, from /usr/lib64/gcc/x86_64-suse-linux/4.2.1/include/limits.h:11, from colamd.c:677: /usr/include/bits/local_lim.h:36:26 error: linux/limits.h: No such file or directory make: *** [colamd.o] Error 1 ERROR: compilation failed for package 'lpSolve' ** Removing
[R] R command line usage
Hello, Usually if I want to run R code from another program, I generate an R script and run R BATCH. However, I have been wanting to access R's command line from another program. In other words, I want the std output from another program to feed into R (command line). Is there any way to do that? I would also like to collect R's response using std input. 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 read Directory
Hi, I have bunch of files to be parsed for my problem. I don't want to keep on executing R script for each file. Is there any way through which I can read whole directory. Like PERL has opendir() function for directory handling. One more doubt is commandArgs() function returns array or single variable. How exactly we should give command line argument. Regards, Prateek -- Prateek Singh Final year Bioinformatics(BTech) Vellore Institute Of Technology Vellore-632014 ph.no. 09952187800 [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.
Re: [R] How to read Directory
On Jan 28, 2008 2:32 AM, Prateek Singh [EMAIL PROTECTED] wrote: I have bunch of files to be parsed for my problem. I don't want to keep on executing R script for each file. Is there any way through which I can read whole directory. Like PERL has opendir() function for directory handling. Is ?dir or ?list.files what you need? pax, Scott Olsson [[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] How to read Directory
?dir __ 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] KM estimation for interval censoring?
Does anybody know if there is such a function to estimate the distribution for interval censored data? survfit doesn't work for this type of data as I tried various references. [[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.