Re: [R] 1501-511 Compilation failed for file ch2inv.f - R on AIX 5.2.
Look like you need to use a Fortran compiler set to accept Fortran 77 (which the R sources are). We don't know what 'f95' is, and this is not really an R issue so please ask your sysadmins for help. On Thu, 22 May 2008, Senthilkumaran wrote: Hi, While executing the make after successful configuration (./configure --with-readline=no --without-iconv), the following error occurs: mbf2n11s (Regatta) /saswork/R/R-2.7.0$ make Target R is up to date. Target R is up to date. Target R is up to date. Target R is up to date. Target Makedeps is up to date. Target libbz2.a is up to date. Target Makedeps is up to date. Target libpcre.a is up to date. Target Makedeps is up to date. Target libz.a is up to date. Target Makedeps is up to date. f95 -g -c ch2inv.f -o ch2inv.o ch2inv.f, line 1.2: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 2.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 3.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 4.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 5.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 6.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 7.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 7.39: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 8.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 9.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 9.41: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 10.8: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 11.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 12.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 13.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 13.38: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 14.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 15.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 16.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 17.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 18.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 18.32: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 19.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 20.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 21.2: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 22.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 23.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 24.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 25.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 26.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 27.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 28.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 29.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 30.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 30.30: 1515-018 (S) Incorrect character found in source at line 30 in column 30. Hexadecimal value of character is 7B. ch2inv.f, line 30.39: 1515-018 (S) Incorrect character found in source at line 30 in column 39. Hexadecimal value of character is 7D. ch2inv.f, line 31.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 32.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 33.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 34.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 35.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 36.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 37.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 38.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 39.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 40.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 41.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 42.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 43.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 44.0: 1515-010 (S) String is missing a closing delimiter. Closing delimiter assumed at end of line. ch2inv.f, line 44.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 45.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 46.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 47.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 48.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 49.0: 1515-010 (S) String is missing a closing delimiter. Closing delimiter assumed at end of line. ch2inv.f, line 49.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 50.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 51.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, 1515-002 (S) END card is missing. One is assumed. ** _main === End of Compilation 1 === ch2inv.f, line 53.7: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 54.6: 1514-050 (S) Specification statement is out of order. Statement is ignored. ch2inv.f, line 55.6: 1514-050 (S) Specification statement is out of order. Statement is ignored. ch2inv.f, line 56.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 57.6: 1514-050 (S) Specification statement is out of order. Statement is ignored. ch2inv.f, line 58.6: 1514-050 (S) Specification statement is out of order. Statement is ignored. ch2inv.f, line 59.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 66.11: 1515-025 (S) Only
Re: [R] Where to download BRugs
install.packages(BRugs) still works on Windows -- the binaries have been moved to the CRAN extras collections. If you want a direct URL http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.7/BRugs_0.4-1.zip On Thu, 22 May 2008, qqw wrote: Hi all, I tried to follow an online tutorial to run openBUgs but the package BRugs has been removed from R repository. Could someone provide a link for where to download BRugs? Thanks a lot! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Est. Component Size with AIC/BIC under Gamma Distribution
Dear all, I am trying to model number of samples from a given series. The series are modelled according Gamma function. In order to estimate the # samples, I use BIC/AIC with MLE (computed from dgamma function). Here is the code I have. __BEGIN__ mlogl - function( x_func, theta_func, samp) { # computing log_likelihood return( - sum(dgamma(samp, shape = x_func, scale=theta_func, log = TRUE))) } find_bic - function(mll,smpl,k) { bic - (-2 * mll) + (k * log(length(smpl))) bic } find_aic - function(mll,smpl,k) { aic - (-2 * mll) + (k * 2) aic } mlogl_process - function(smpl,error,start ) { # EM algorithm to estimate max loglikelihood thetalast - 0 thetacurrent - start theta - start difference - start thetaprocess - start best - 0 while (difference error) { mlogl_out - nlm(mlogl, mean(smpl), theta_func=thetacurrent, samp=smpl) theta - mlogl_out$estimate thetalast - thetacurrent thetacurrent - theta difference - abs(thetalast - thetacurrent) # E-STEP new_maxlogl - nlm(mlogl, mean(smpl), theta_func=theta, samp=smpl) # M-STEP if (new_maxlogl$minimum best) { best - new_maxlogl$minimum } } best } # main program # my samples vsamples- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) # initialize start_ - 300 error_ - 0.001 thetastart - 1 k - 5 # compute AIC/BIC for k component for (nofc in 1:k { cat(k = , nofc, \n) maxlogl - -(mlogl_process(vsamples,error_,thetastart)) bic_k - find_bic(maxlogl,vsamples,nofc) aic_k - find_aic(maxlogl,vsamples,nofc) cat(BIC = , bic_k, - AIC = , aic_k, - MLL= , maxlogl,\n) } __ END__ We finally expect to choose K with the smallest AIC/BIC value. However, the problem I have is that the AIC/BIC value is always on the increase. Can anybody advice what's wrong with my above approach? Regards, Edward __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Re : How to import package into R script
Read documentation carefully ! see ?library (e.g library(tseries)) Justin BEM BP 1917 Yaoundé Tél (237) 99597295 (237) 22040246 - Message d'origine De : Edward Wijaya [EMAIL PROTECTED] à : r-help@r-project.org Envoyé le : Vendredi, 23 Mai 2008, 4h23mn 06s Objet : [R] How to import package into R script Hi all, What's the construct to import a built-in package (e.g. ARIMA) into the R script. I can't seem to find them in the documentation. Regards, Edward __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ ble contre les messages non sollicités [[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] New version of ecological modeling software using R
Dear R users, Again with the hope that this application can also be useful for some R users, i like to announce a new Windows version of the ecological modeling software Bio7. In this release you can now easily transfer images from the well known image analysis tool ImageJ to R or create images in ImageJ from a R matrix. http://www.uni-bielefeld.de/biologie/Oekosystembiologie/bio7app/flashtut/imagetransfer.htm Furthermore the interpretation of R scripts inside the RScript editor of Bio7 is now much more stable and several methods have been added to the R menu of Bio7. In addition spatial data from R can now be visualized in a new available OpenGL (Jogl) panel dynamically. The software is available at: http://www.uni-bielefeld.de/biologie/Oekosystembiologie/bio7app/index.html With kind regards M.Austenfeld -- View this message in context: http://www.nabble.com/New-version-of-ecological-modeling-software-using-R-tp17419491p17419491.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] Some problems with Sweave
Dear R users, I'm working in a brief R-tutorial to a group of students. To make that I'm using Sweave but I've got two problems: First, I want show how R operates with the matrix type but, I write in the .rnw document the code echo=T,results=tex= matriz - matrix(vector,nrow=3,ncol=6) matriz @ and after compilating the LaTex document I obtain in the pdf the next text matriz - matrix(vector, nrow = 3, ncol = 6) matriz [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 4 1 4 1 4 [2,] 2 5 2 5 2 5 [3,] 3 6 3 6 3 6 My question is, How must I do To obtain in the pdf somethin near to matriz - matrix(vector, nrow = 3, ncol = 6) matriz [,1] [,2] [,3] [,4] [,5] [,6] [1,]141414 [2,]252525 [3,]363636 I`ve tought in xtable but the aspect is not as the R console. On the other hand I want show the list type R-treatment, the problem here is in the LaTex compilation I write in the .rnwd document echo=T,results=tex= lista - list(cadena='String',vector=c(1,1,1),logica=TRUE) lista$cadena @ the Sweave call is ok, but when I compile the .tex document, It produces errors caused by the $ simbols. Anybody knows how save this problem? Thanks in advance, Martín Gastó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.
Re: [R] Re : How to import package into R script
Before call library(package) it is needed install the package. To make that, select Packages/InstallPkages... choose your nearest mirror and select the package from the list and accept. After that you can call library(tseries) for example Regards El Vie, 23 de Mayo de 2008, 9:00, justin bem escribió: Read documentation carefully ! see ?library (e.g library(tseries)) Justin BEM BP 1917 Yaoundé Tél (237) 99597295 (237) 22040246 - Message d'origine De : Edward Wijaya [EMAIL PROTECTED] à : r-help@r-project.org Envoyé le : Vendredi, 23 Mai 2008, 4h23mn 06s Objet : [R] How to import package into R script Hi all, What's the construct to import a built-in package (e.g. ARIMA) into the R script. I can't seem to find them in the documentation. Regards, Edward __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ ble contre les messages non sollicités [[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.
[R] Strange julian and/or strptime
Hi r-helpers... Why do I get this strange huge jump of 36524 days when changing origin from 1969-01-01 to 1968-12-31. It should still be close to zero! This really messes up my calculations of follow-up times in my analyses. julian(strptime(010169, format = %d%m%y),origin = as.Date(1969-01-01)) Time difference of -0.0417 days julian(strptime(311268, format = %d%m%y),origin = as.Date(1968-12-31)) Time difference of 36524.96 days Cheers, Kare [[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 7 * 3 matrix on DIN A4 pdf
[EMAIL PROTECTED] wrote: Hello, I want to plot 21 scatter plots in a 7*3 matrix on a single A4 page (using mfcol). Below is an example, which -by and large- looks very close to the desired result. But I do not get it to fill out the whole page. If I specify the a different page size, the plots still do not fill out the whole page. Anybody an idea what to do? Maybe adjusting indvidiual plot size (if so, how?). Or is there a neater command to create a matrix of individual plots Just specify width and height appropriately. Uwe Ligges Best, Stefan pdf(file='c:/matrix1.pdf',paper='a4',pagecentre=F) x-c(rnorm(mean(100,mean=50,sd=10)),rnorm(mean(100,mean=50,sd=10))) par(mfcol=c(7,3)) par(pch=19) par(pty=m) #s makes a square plot par(cex=.1) par(cex.axis=7) par(omi=c(1,1,1,1)) axistick-c(0,10,20,30,40,50,60,70,80,90,100) par(mar=c(3, 5, 0, 0) + 0.1) plot(x,xlim=c(0,50),ylim=c(0,100),axes = FALSE) axis(2,ylab='',at=axistick) box(lty=1) plot(x,xlim=c(0,50), ylim=c(0,100),axes = FALSE) axis(2) box(lty=1) plot(x, xlim=c(0,50),ylim=c(0,100),axes = FALSE) axis(2) box(lty=1) plot(x,xlim=c(0,50), ylim=c(0,100),axes = FALSE) axis(2) box(lty=1) plot(x,xlim=c(0,50), ylim=c(0,100),axes = FALSE) axis(2) box(lty=1) plot(x,xlim=c(0,50), ylim=c(0,100),axes = FALSE) axis(2) box(lty=1) par(mar=c(3, 5 ,0, 0) + 0.1) plot(x,xlim=c(0,50), ylim=c(0,100),axes = FALSE) axis(2) axis(1,ylab='UAS_7') box(lty=1) par(mar=c(3, 0, 0, 0) + 0.1) plot(as.integer(Sex),GER_TOTAL,ylim=c(0,100),xlim=c(0,3),axes = FALSE,pch=12) box(lty=1) plot(x,ylim=c(0,100),xlim=c(0,3),axes = FALSE,pch=12) box(lty=1) plot(x,ylim=c(0,100),xlim=c(0,3),axes = FALSE,pch=12) box(lty=1) plot(x,ylim=c(0,100),xlim=c(0,3),axes = FALSE) box(lty=1) plot(x,ylim=c(0,100),xlim=c(0,3),axes = FALSE,pch=12) box(lty=1) plot(x,ylim=c(0,100),xlim=c(0,3),axes = FALSE,pch=12) box(lty=1) par(mar=c(3, 0, 0, 0) + 0.1) plot(as.integer(Sex),GER_F6,ylim=c(0,100),xlim=c(0,3),axes = FALSE) axis(1,at=c(1,2),ylab='Sex') box(lty=1) par(mar=c(3, 0, 0, 0) + 0.1) plot(x,xlim=c(0,100),ylim=c(0,100),axes = FALSE,pch=12) box(lty=1) plot(x,xlim=c(0,100), ylim=c(0,100),axes = FALSE) box(lty=1) plot(x, xlim=c(0,100),ylim=c(0,100),axes = FALSE) box(lty=1) plot(x, xlim=c(0,100),ylim=c(0,100),axes = FALSE) box(lty=1) plot(x, xlim=c(0,100),ylim=c(0,100),axes = FALSE,pch=12) box(lty=1) plot(x, xlim=c(0,100),ylim=c(0,100),axes = FALSE) box(lty=1) par(mar=c(3, 0, 0, 0) + 0.1) plot(x,xlim=c(0,100),ylim=c(0,100),axes = FALSE,pch=12) box(lty=1) axis(1,ylab='Sex') dev.off() __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] [slightly off topic] Sweave with markdown
DeaR list, Has anyone tried to mix the Sweave paradigm with the Markdown[*] (and co.) syntax? Would this be hard to implement? My tiny understanding of Sweave is that one can define new drivers for the text part, while some functions that deal with the R code would not require any modification. Here's the reason I'm interested in Mardown for a driver. I've been orbiting around Sweave for several weeks, and while I understand the great value of this literate programming, I'm a bit put off by the technical aspect. I'm a LateX user, and a R user (you'd have guessed, albeit fairly novice), so the problem is not to get it working (i got some writings done with Sweave), but more of getting an efficient workflow. I find the LaTeX commands overly intruding in the middle of my R source code, plus the relatively slow compilation of latex makes it quite impractical for quick studies ( I once spent 20 minutes trying to get the graph to be at a sensible scale on the page). As an alternative, I'm resorting to having a folder per study (I'm physicist, doing data analysis for optical spectroscopy), with one R file per analysis and a text file to keep track of the experimental conditions. When the data is really important / interesting, I've also tried to write a package: great for storing the data, functions and commands in a consistent manner (this works fine, but it cannot be a solution for quick trial experiments. Also, the figures cannot be included in the html doc as far as I know.) I was considering some alternatives to Sweave, namely R2HTML and odfWeave, but in the former the source syntax is no less disturbing than LaTeX (although the zero compilation time is a plus), while for the latter I do not have a decent compatible editor (on a Mac, I tried Openoffice and Abiword but the fonts look like my handwriting for some obscure reason). Maybe I'll give it another shot at some stage, I just usually prefer plain text files. Any input welcome, Baptiste [*]: http://en.wikipedia.org/wiki/Markdown _ Baptiste Auguié Physics Department University of Exeter Stocker Road, Exeter, Devon, EX4 4QL, UK Phone: +44 1392 264187 http://newton.ex.ac.uk/research/emag http://projects.ex.ac.uk/atto __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] 3D Area Diagram
AlGates wrote: Thank you all for your help. I will check the packages you suggested asap and maybe I find a good way to get a such a plot. The picture I posted was only an example taken from the microsoft-website, just to make clear what kind of diagram I am looking for. I know that one part is hidden by the other and that it would be better to show it somehow different. The one I rather need, is something like this (scan from a book): http://algates.de/Scan.jpg The only difference is the angle. Hi Al, You can get a 2D version of this with stackpoly in the plotrix package (v2.4-2) although if you really want 3D, I agree with Ben. 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] Strange julian and/or strptime
On my Linux box: strptime(010169, format = %d%m%y) [1] 1969-01-01 strptime(311268, format = %d%m%y) [1] 2068-12-31 From the help page: '%y' Year without century (00-99). If you use this on input, which century you get is system-specific. So don't! Often values up to 69 (or 68) are prefixed by 20 and 70 (or 69) to 99 by 19. If all else fails, read the documentation (but the posting guide asks you to do that before posting). Elsewhere on that help page it refers you to your OS documentation -- the posting guide asked for your OS 'at a minimum', but as you didn't follow it so we have no idea which you used. On Fri, 23 May 2008, Kåre Edvardsen wrote: Hi r-helpers... Why do I get this strange huge jump of 36524 days when changing origin from 1969-01-01 to 1968-12-31. It should still be close to zero! This really messes up my calculations of follow-up times in my analyses. julian(strptime(010169, format = %d%m%y),origin = as.Date(1969-01-01)) Time difference of -0.0417 days julian(strptime(311268, format = %d%m%y),origin = as.Date(1968-12-31)) Time difference of 36524.96 days Cheers, Kare [[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.
Re: [R] Where to download BRugs
Thanks, this works great! Thanks a lot! aldi-2 wrote: Hi, I just installed it from http://cran.wustl.edu/bin/windows/contrib/2.7/BRugs_0.4-1.zip Change 2.7 to 2.6 and you get the older version. HTH, Aldi Thanks Aldi, do you know anywhere we could download previous package of BRugs? Do you have a copy which you could send to me? (I only found one old version on Splus site which is not usable under R2.6 :() Thanks! -- View this message in context: http://www.nabble.com/Where-to-download-BRugs-tp17411410p17416516.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/Where-to-download-BRugs-tp17411410p17418324.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] Create a data subset
Hello, I want to select same data of a data frame that has information of fish catches: catch, vessel, trip, day, month, year where trip is the fishing operation number done in each day by each vessel, i.e. for each day, any vesel can have several register of catch corresponding to each operation. From this data frame I want to do: 1. Add the catches of all trip by vessel and day; then 2. Select rows corresponding to vessels that appear more than 120 days at the year; then 3. Select rows corresponding to vessels that appear mode than 15 years Does anyone know how to do that in R? Thank you in advanced Maria -- View this message in context: http://www.nabble.com/Create-a-data-subset-tp17420700p17420700.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] Some problems with Sweave
Try results=verbatim instead of results=tex. Haris Skiadas Department of Mathematics and Computer Science Hanover College On May 23, 2008, at 4:16 AM, [EMAIL PROTECTED] wrote: Dear R users, I'm working in a brief R-tutorial to a group of students. To make that I'm using Sweave but I've got two problems: First, I want show how R operates with the matrix type but, I write in the .rnw document the code echo=T,results=tex= matriz - matrix(vector,nrow=3,ncol=6) matriz @ and after compilating the LaTex document I obtain in the pdf the next text matriz - matrix(vector, nrow = 3, ncol = 6) matriz [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 4 1 4 1 4 [2,] 2 5 2 5 2 5 [3,] 3 6 3 6 3 6 My question is, How must I do To obtain in the pdf somethin near to matriz - matrix(vector, nrow = 3, ncol = 6) matriz [,1] [,2] [,3] [,4] [,5] [,6] [1,]141414 [2,]252525 [3,]363636 I`ve tought in xtable but the aspect is not as the R console. On the other hand I want show the list type R-treatment, the problem here is in the LaTex compilation I write in the .rnwd document echo=T,results=tex= lista - list(cadena='String',vector=c(1,1,1),logica=TRUE) lista$cadena @ the Sweave call is ok, but when I compile the .tex document, It produces errors caused by the $ simbols. Anybody knows how save this problem? Thanks in advance, Martín Gastó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.
Re: [R] 3D Area Diagram
On Thu, 22-May-2008 at 03:13PM -0700, AlGates wrote: | The one I rather need, is something like this (scan from a book): | http://algates.de/Scan.jpg | The only difference is the angle. That one is even stranger. There are two similar (but not parallel) lines for imports and another two similar (but again not parallel) lines for exports. I can't see if there is anything systematic about those small differences, and I suspect that there was meant to be none -- just drawn by someone who didn't have a 45 deg set-square. Years ago I inherited some SPlus code which did, in fact, draw a plot quite similar to that one (but without the inaccuracies). I remember it was quite lengthy and complicated, but I don't remember ever having an inclination to use it for anything since R has so many easier and better ways of visualizing data. During the process of changing computer systems several times in the intervening years, that code was something that went out with the old faded photos. Shame that. Excel might have an option to do one like the import-export example. If it does, it would be a lot easier than using R which has an altogether different set of values. If Excel doesn't do that type, and it's *really* important to have such a plot, I'd be using grid graphics which is almost infinitely flexible. Only trouble is, by the time you'd seen what you can do with grid, you'd likely find that you no longer felt any urge to make such a plot. best -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_Middle minds discuss events (:_~*~_:)Small minds discuss people (_)-(_) . Anon ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] an unknown error message when using gamm function
Could you try upgrading to the current version of mgcv, please? looking in the `changeLog' there were a couple of fixed problems that could be causing this. On Wednesday 21 May 2008 16:14, Lung-Chang Chien wrote: The version is mgcv 1.3-27. Last night, I dropped out many arguments from my program to test which part might be the source of causing this error message, and found that the program works when just using corAR1(). This program has no this kind of problem in the beginning, but doesn't work after I impute some missing data in PM10 and tmean by multiple imputation approach. Hope this information can also help identify the element of this problem. LC From: Simon Wood [EMAIL PROTECTED] To: r-help@r-project.org Date: Wed, 21 May 2008 08:55:02 +0100 Subject: Re: [R] an unknown error message when using gamm function What version of mgcv are you using, please? On Wednesday 21 May 2008 06:16, Lung-Chang Chien wrote: Dear everyone, I'm encountering an unknown error message when using gamm function: fitoutput - gamm(cvd~as.factor(dow)+pm10+s (time,bs=cr,k=15,fx=TRUE)+s(tmean,bs=cr,k =7,fx=TRUE) + ,correlation=corAR1(form=~1|city),family=poisson,random=list(city=~pm10),da ta=mimp) Maximum number of PQL iterations: 20 iteration 1 iteration 2 iteration 3 iteration 4 iteration 5 iteration 6 Error in `*tmp*`[[k]] : attempt to select less than one element I never saw this error message before, and there is also no related information about this error from the Internet. Hope some people who once encountered this problem can tell me what's wrong. Many thanks, LC -- Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK +44 1225 386603 www.maths.bath.ac.uk/~sw283 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Cleaning a time series
Dear R Users, Was wondering if anyone can give me pointers to functionality in R that can help clean a time series ? For example, some kind of package/functionality which identifies potential errors and takes some action, such as replacement by some suitable value (carry-forward, average of nearest, what have you) and reporting of errors identified. I did search Google for R cran time series clean outlier and various permutations but did not come across anything. Thanks, Tolga Generally, this communication is for informational purposes only and it is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. In the event you are receiving the offering materials attached below related to your interest in hedge funds or private equity, this communication may be intended as an offer or solicitation for the purchase or sale of such fund(s). All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase Co., its subsidiaries and affiliates. This transmission may contain information that is privileged, confidential, legally privileged, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by JPMorgan Chase Co., its subsidiaries and affiliates, as applicable, for any loss or damage arising in any way from its use. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. Please refer to http://www.jpmorgan.com/pages/disclosures for disclosures relating to UK legal entities. [[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] colorspace package does not compile on ubuntu 7.04 32 bit
Hi again, I have managed to solve this problem myself - indeed, the trouble was with the package being incompatible with gcc v4. Here what I've done - perhaps it's going to be useful for someone else: 1) installed gcc v3.4: sudo apt-get install gcc-3.4 2) opened .../R/etc/Makeconf (changing its access rights so it's no longer read-only first) 3) changed all instances of gcc to gcc-3.4 I realise that this was perhaps quite a drastic measure and I could have created a Makefile for the colorspace package specifically instead. But the v4/v3 incompatibility is such a common problem that I decided to change this once and for all - until new packages utilising some v4 - specific C code appear out there.. Cheers Mikhail Mikhail Spivakov wrote: Hi everyone, I am trying to install colorspace (needed as part of my favourite ggplot2) on R v 2.7.0 running under ubuntu 7.04. The package is provided as source files and the compilation fails as below. I suspect this might be a problem with gcc v3/v4 incompatibility (or anything else), but I don't really know how to resolve it. Any advice will be appreciated - or perhaps somebody has got this package compiled and could share the binaries? Many thanks! Mikhail Mikhail Spivakov, PhD European Bioinformatics Institute European Molecular Biology Laboratory Germany/UK * Installing *source* package 'colorspace' ... ** libs gcc -std=gnu99 -I/usr/share/R/include -fpic -g -O2 -c colorspace.c -o colorspace.o In file included from colorspace.c:1: /usr/share/R/include/R.h:28:20: error: stdlib.h: No such file or directory /usr/share/R/include/R.h:29:19: error: stdio.h: No such file or directory In file included from /usr/lib/gcc/i486-linux-gnu/4.1.2/include/syslimits.h:7, from /usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h:11, from /usr/share/R/include/R.h:30, from colorspace.c:1: /usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h:122:61: error: limits.h: No such file or directory In file included from colorspace.c:1: /usr/share/R/include/R.h:32:18: error: math.h: No such file or directory /usr/share/R/include/R.h:33:19: error: errno.h: No such file or directory In file included from /usr/share/R/include/R.h:50, from colorspace.c:1: /usr/share/R/include/R_ext/RS.h:24:39: error: string.h: No such file or directory In file included from colorspace.c:2: /usr/share/R/include/Rinternals.h:770: error: expected declaration specifiers or ‘...’ before ‘FILE’ /usr/share/R/include/Rinternals.h:773: error: expected declaration specifiers or ‘...’ before ‘FILE’ colorspace.c: In function ‘gtrans’: colorspace.c:28: warning: implicit declaration of function ‘pow’ colorspace.c:28: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c: In function ‘ftrans’: colorspace.c:36: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c: In function ‘g’: colorspace.c:92: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c: In function ‘LAB_to_XYZ’: colorspace.c:106: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c:114: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c:117: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c:123: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c: In function ‘f’: colorspace.c:132: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c: In function ‘XYZ_to_LAB’: colorspace.c:144: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c: In function ‘XYZ_to_HLAB’: colorspace.c:170: warning: implicit declaration of function ‘sqrt’ colorspace.c:170: warning: incompatible implicit declaration of built-in function ‘sqrt’ colorspace.c: In function ‘LAB_to_polarLAB’: colorspace.c:203: warning: implicit declaration of function ‘atan2’ colorspace.c:203: warning: incompatible implicit declaration of built-in function ‘atan2’ colorspace.c:207: warning: incompatible implicit declaration of built-in function ‘sqrt’ colorspace.c: In function ‘polarLAB_to_LAB’: colorspace.c:216: warning: implicit declaration of function ‘cos’ colorspace.c:216: warning: incompatible implicit declaration of built-in function ‘cos’ colorspace.c:217: warning: implicit declaration of function ‘sin’ colorspace.c:217: warning: incompatible implicit declaration of built-in function ‘sin’ colorspace.c: In function ‘HSV_to_RGB’: colorspace.c:272: warning: implicit declaration of function ‘floor’ colorspace.c:272: warning: incompatible implicit declaration of built-in function ‘floor’ colorspace.c: In function ‘XYZ_to_LUV’: colorspace.c:311: warning: incompatible implicit declaration of built-in function ‘pow’ colorspace.c: In function ‘LUV_to_XYZ’:
Re: [R] Some problems with Sweave
Martin, try omitting the results=tex argument. Andrew On Fri, May 23, 2008 at 10:16:33AM +0200, [EMAIL PROTECTED] wrote: Dear R users, I'm working in a brief R-tutorial to a group of students. To make that I'm using Sweave but I've got two problems: First, I want show how R operates with the matrix type but, I write in the .rnw document the code echo=T,results=tex= matriz - matrix(vector,nrow=3,ncol=6) matriz @ and after compilating the LaTex document I obtain in the pdf the next text matriz - matrix(vector, nrow = 3, ncol = 6) matriz [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 4 1 4 1 4 [2,] 2 5 2 5 2 5 [3,] 3 6 3 6 3 6 My question is, How must I do To obtain in the pdf somethin near to matriz - matrix(vector, nrow = 3, ncol = 6) matriz [,1] [,2] [,3] [,4] [,5] [,6] [1,]141414 [2,]252525 [3,]363636 I`ve tought in xtable but the aspect is not as the R console. On the other hand I want show the list type R-treatment, the problem here is in the LaTex compilation I write in the .rnwd document echo=T,results=tex= lista - list(cadena='String',vector=c(1,1,1),logica=TRUE) lista$cadena @ the Sweave call is ok, but when I compile the .tex document, It produces errors caused by the $ simbols. Anybody knows how save this problem? Thanks in advance, Mart?n Gast?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. -- Andrew Robinson Department of Mathematics and StatisticsTel: +61-3-8344-6410 University of Melbourne, VIC 3010 Australia Fax: +61-3-8344-4599 http://www.ms.unimelb.edu.au/~andrewpr http://blogs.mbs.edu/fishing-in-the-bay/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Pros and Cons of R
Installation under Gentoo is straightforward too (emerge dev-lang/R). Updating has never really been a problem. CRAN packages are rebuilt if needed when updating R, and periodically all you need to do is fire up R and use update.packages() to update any packages you've installed. Another pro to consider is the cost, you can obtain R for free, SAS/S-Plus/Stata all have licenses of some sort that require purchasing. Neil -- View this message in context: http://www.nabble.com/Pros-and-Cons-of-R-tp17407521p17423145.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] Strange julian and/or strptime
I'm on an Ubuntu Linux PC, and get the same wrong result as you. I could not work out what the description of '%y' really ment, so I did not realize this was operating system specific in this sense. Anyway, I'll find a way to work around this bug. Have a nice weekend, Kare On Fri, 2008-05-23 at 10:41 +0100, Prof Brian Ripley wrote: On my Linux box: strptime(010169, format = %d%m%y) [1] 1969-01-01 strptime(311268, format = %d%m%y) [1] 2068-12-31 From the help page: '%y' Year without century (00-99). If you use this on input, which century you get is system-specific. So don't! Often values up to 69 (or 68) are prefixed by 20 and 70 (or 69) to 99 by 19. If all else fails, read the documentation (but the posting guide asks you to do that before posting). Elsewhere on that help page it refers you to your OS documentation -- the posting guide asked for your OS 'at a minimum', but as you didn't follow it so we have no idea which you used. On Fri, 23 May 2008, Kåre Edvardsen wrote: Hi r-helpers... Why do I get this strange huge jump of 36524 days when changing origin from 1969-01-01 to 1968-12-31. It should still be close to zero! This really messes up my calculations of follow-up times in my analyses. julian(strptime(010169, format = %d%m%y),origin = as.Date(1969-01-01)) Time difference of -0.0417 days julian(strptime(311268, format = %d%m%y),origin = as.Date(1968-12-31)) Time difference of 36524.96 days Cheers, Kare [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Create a data subset
PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. You should at least provide a sample of the data that you are working with and what you might think the desired output should be. It is difficult to create sample data since you don't know what the user is really working with. It helps to get responses to questions. On Fri, May 23, 2008 at 4:53 AM, MarySR [EMAIL PROTECTED] wrote: Hello, I want to select same data of a data frame that has information of fish catches: catch, vessel, trip, day, month, year where trip is the fishing operation number done in each day by each vessel, i.e. for each day, any vesel can have several register of catch corresponding to each operation. From this data frame I want to do: 1. Add the catches of all trip by vessel and day; then 2. Select rows corresponding to vessels that appear more than 120 days at the year; then 3. Select rows corresponding to vessels that appear mode than 15 years Does anyone know how to do that in R? Thank you in advanced Maria -- View this message in context: http://www.nabble.com/Create-a-data-subset-tp17420700p17420700.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.htmlhttp://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 you are trying to solve? [[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] Strange julian and/or strptime
It is not a bug. Y2K strikes again, a couple of years late. On Fri, May 23, 2008 at 7:17 AM, Kåre Edvardsen [EMAIL PROTECTED] wrote: I'm on an Ubuntu Linux PC, and get the same wrong result as you. I could not work out what the description of '%y' really ment, so I did not realize this was operating system specific in this sense. Anyway, I'll find a way to work around this bug. Have a nice weekend, Kare On Fri, 2008-05-23 at 10:41 +0100, Prof Brian Ripley wrote: On my Linux box: strptime(010169, format = %d%m%y) [1] 1969-01-01 strptime(311268, format = %d%m%y) [1] 2068-12-31 From the help page: '%y' Year without century (00-99). If you use this on input, which century you get is system-specific. So don't! Often values up to 69 (or 68) are prefixed by 20 and 70 (or 69) to 99 by 19. If all else fails, read the documentation (but the posting guide asks you to do that before posting). Elsewhere on that help page it refers you to your OS documentation -- the posting guide asked for your OS 'at a minimum', but as you didn't follow it so we have no idea which you used. On Fri, 23 May 2008, Kåre Edvardsen wrote: Hi r-helpers... Why do I get this strange huge jump of 36524 days when changing origin from 1969-01-01 to 1968-12-31. It should still be close to zero! This really messes up my calculations of follow-up times in my analyses. julian(strptime(010169, format = %d%m%y),origin = as.Date(1969-01-01)) Time difference of -0.0417 days julian(strptime(311268, format = %d%m%y),origin = as.Date(1968-12-31)) Time difference of 36524.96 days Cheers, Kare [[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.htmlhttp://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.htmlhttp://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 you are trying to solve? [[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] Evaluation conflict in combination of replicate() and rexp()as variable inside a function
Dear userRs, playing around with combinations of replicate() and random number generating functions inside a self-defined wrapper function I encounterd a puzzling behaviour. The following are intentionally simple (and rather nonsense-) examples to isolate the relevant aspects. Please, note the seemingly inconsistent behaviour for the second call of rdistr() (with distr = rexp) for which I have not found any explanation (yet): rdistr - function( distr, ...) replicate( 1, distr( n = 1, ...)) rdistr( distr = rnorm) [1] -0.8889223 rdistr( distr = rexp) [1] NaN Warning message: In distr(n = 1, ...) : NAs produced rdistr( distr = runif) [1] 0.8444856 Trying to discover the reason for this observation, I looked into the code of replicate() and realized that this seems to be an issue of evaluation schemes (and maybe also of variable scoping), but I didn't delve deeper into it, yet. Can anybody more competent enlight me or give me a hint where to search, please? Thank you! Best regards -- Gerrit PS: sessionInfo() R version 2.6.2 (2008-02-08) x86_64-unknown-linux-gnu locale: LC_CTYPE=de_DE.UTF-8;LC_NUMERIC=C;LC_TIME=de_DE.UTF-8;LC_COLLATE=de_DE.UTF-8;LC_MONETARY=de_DE.UTF-8;LC_MESSAGES=de_DE.UTF-8;LC_PAPER=de_DE.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=de_DE.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] rcompgen_0.1-17 - AR Dr. Gerrit Eichner Mathematical Institute [EMAIL PROTECTED] Justus-Liebig-University Giessen Tel: +49-(0)641-99-32104 Arndtstr. 2, 35392 Giessen, Germany Fax: +49-(0)641-99-32029 http://www.math.uni-giessen.de __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Pros and Cons of R
Neil Shephard wrote: Another pro to consider is the cost, you can obtain R for free, SAS/S-Plus/Stata all have licenses of some sort that require purchasing. Neil Which has the side effect of *not* restricting how many machines are available for use or where; e.g. I was running big process a couple of different times with different scenarios, so I just fired up a few un-used machines and had them all running in parallel for the afternoon - no installation issues as I was able to run it off the network drive (windows as it happens). If I was licence restricted this would not have been possible. Similarly I can do analyses at home on any machine or even if I'm visiting somewhere else! Regards Sean -- View this message in context: http://www.nabble.com/Pros-and-Cons-of-R-tp17407521p17424335.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] Cleaning a time series
The zoo package has six na.* routines for carrying values forward, etc. library(zoo) ?zoo describes them. Also see the vignettes. On Fri, May 23, 2008 at 6:55 AM, [EMAIL PROTECTED] wrote: Dear R Users, Was wondering if anyone can give me pointers to functionality in R that can help clean a time series ? For example, some kind of package/functionality which identifies potential errors and takes some action, such as replacement by some suitable value (carry-forward, average of nearest, what have you) and reporting of errors identified. I did search Google for R cran time series clean outlier and various permutations but did not come across anything. Thanks, Tolga Generally, this communication is for informational purposes only and it is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. In the event you are receiving the offering materials attached below related to your interest in hedge funds or private equity, this communication may be intended as an offer or solicitation for the purchase or sale of such fund(s). All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase Co., its subsidiaries and affiliates. This transmission may contain information that is privileged, confidential, legally privileged, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by JPMorgan Chase Co., its subsidiaries and affiliates, as applicable, for any loss or damage arising in any way from its use. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. Please refer to http://www.jpmorgan.com/pages/disclosures for disclosures relating to UK legal entities. [[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] [slightly off topic] Sweave with markdown
You could check out the brew package: https://stat.ethz.ch/pipermail/r-packages/2007/000327.html On Fri, May 23, 2008 at 4:37 AM, baptiste Auguié [EMAIL PROTECTED] wrote: DeaR list, Has anyone tried to mix the Sweave paradigm with the Markdown[*] (and co.) syntax? Would this be hard to implement? My tiny understanding of Sweave is that one can define new drivers for the text part, while some functions that deal with the R code would not require any modification. Here's the reason I'm interested in Mardown for a driver. I've been orbiting around Sweave for several weeks, and while I understand the great value of this literate programming, I'm a bit put off by the technical aspect. I'm a LateX user, and a R user (you'd have guessed, albeit fairly novice), so the problem is not to get it working (i got some writings done with Sweave), but more of getting an efficient workflow. I find the LaTeX commands overly intruding in the middle of my R source code, plus the relatively slow compilation of latex makes it quite impractical for quick studies ( I once spent 20 minutes trying to get the graph to be at a sensible scale on the page). As an alternative, I'm resorting to having a folder per study (I'm physicist, doing data analysis for optical spectroscopy), with one R file per analysis and a text file to keep track of the experimental conditions. When the data is really important / interesting, I've also tried to write a package: great for storing the data, functions and commands in a consistent manner (this works fine, but it cannot be a solution for quick trial experiments. Also, the figures cannot be included in the html doc as far as I know.) I was considering some alternatives to Sweave, namely R2HTML and odfWeave, but in the former the source syntax is no less disturbing than LaTeX (although the zero compilation time is a plus), while for the latter I do not have a decent compatible editor (on a Mac, I tried Openoffice and Abiword but the fonts look like my handwriting for some obscure reason). Maybe I'll give it another shot at some stage, I just usually prefer plain text files. Any input welcome, Baptiste [*]: http://en.wikipedia.org/wiki/Markdown _ Baptiste Auguié Physics Department University of Exeter Stocker Road, Exeter, Devon, EX4 4QL, UK Phone: +44 1392 264187 http://newton.ex.ac.uk/research/emag http://projects.ex.ac.uk/atto __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Advise in R- plotting graphs
Hi I have a data table matrix,data which looks like below:- V1V2 V3 1 -6382.719 -1096.554 6998994 2 -some values- 3 -some values- 4 -some values- 5 -some values- Querying dim of data gives me 3 columns and 5 rows. And currently I want to plot V1 against V2 with the condition that I want to mark(color) the point(row 5) on the graph. This is so i could see some triangle shape thing on the graph for row 5. I couldnt recall how I could use repo() to change the line 5 to some value to differentiate with others. And then using PCH for the color. Please advise. Thanks. -jason [[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] Advise in R- plotting graphs
try this: x - matrix(runif(15, 100, 300), ncol=3) plot(x[,1], x[,2], type='l') points(x[5,1], x[5,2], pch=17, cex=3, col='red') # plot point #5 On Fri, May 23, 2008 at 8:50 AM, Jason Lee [EMAIL PROTECTED] wrote: Hi I have a data table matrix,data which looks like below:- V1V2 V3 1 -6382.719 -1096.554 6998994 2 -some values- 3 -some values- 4 -some values- 5 -some values- Querying dim of data gives me 3 columns and 5 rows. And currently I want to plot V1 against V2 with the condition that I want to mark(color) the point(row 5) on the graph. This is so i could see some triangle shape thing on the graph for row 5. I couldnt recall how I could use repo() to change the line 5 to some value to differentiate with others. And then using PCH for the color. Please advise. Thanks. -jason [[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.htmlhttp://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 you are trying to solve? [[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] [slightly off topic] Sweave with markdown
On Fri, May 23, 2008 at 4:37 AM, baptiste Auguié [EMAIL PROTECTED] wrote: (although the zero compilation time is a plus), while for the latter I do not have a decent compatible editor (on a Mac, I tried Openoffice and Abiword but the fonts look like my handwriting for some obscure reason). Maybe I'll give it another shot at some stage, I just usually prefer plain text files. Try using NeoOffice or the development version of OpenOffice. The new version (3.0) of OpenOffice is better integrated into OS X and should probably do the trick http://download.openoffice.org/3.0beta/ It is beta, but it has been pretty stable for me. Max __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] van der Corput sequences
In package fOptions, there are functions that generate Halton sequences. The van der Corput sequence for base 2 is a particular case of the Halton sequence generated by: n - 8 # anything here... x - runif.halton(n, 1) In fact, x - runif.halton(n, dim) will generate the van der Corput sequences for the base b as the i-th prime number in x[,i]. (in other words, if I want the van der Corput sequence for base b = 5, I do x - runif.halton(n, 3) and take x[,3]). However, it's possible to have van der Corput sequences for non-prime basis, like (for b = 10): 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.01, 0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81, 0.91, 0.02, 0.12, 0.22, 0.32, Is there any R function that generates those sequences? Alberto Monteiro __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] extracting columns from a list
Hi Mohamed Try: lapply (NameOfYourList, function (dat, NumCol) dat[,NumCol], c(12,13)) But there must be a shorter way to write this. Nael On Fri, May 23, 2008 at 3:37 PM, mohamed nur anisah [EMAIL PROTECTED] wrote: Dear all, i have 2 lists of data with each of the list contain 14 columns. How am i going to extract column 12 and 13 from each of the list ?? and can i combine my extracted columns to form a single list. Attach with are my data. Your coorperation is highly appreciated. Many thanks Regards, Anisah [[1]] CS(O) id no.anchor ref loc.start loc.end CS(O).size CS(O)ref.density tested loc.start loc.end breakp.start breakp.end den of anchor 1 CS 2.0 3 mmu19 6465196 6978022 512826 6 cfa18 55567952 55782336 6978022699273428 2 CS 3.057 mmu19 6992734 102499663257232 17 cfa18 55792632 57688808 10249966 1027743025 3 CS 4.021 mmu19 10277430 10955201 61 31 cfa18 57721864 58419812 10955201 1100852636 4 CS 5.0 2 mmu19 11008526 11045352 36826 54 cfa18 58462088 58518608 11045352 1131686532 5 CS 6.0 7 mmu19 11316865 11814604 497739 14 cfa21 53902028 53514536 11814604 1193722837 6 CS 7.014 mmu19 11937228 138476331910405 7 cfa18 40111560 41204940 13847633 1451509117 7 CS 8.0 3 mmu19 14515091 160227701507679 2 cfa1 82195232 83511824 16022770 16199850 5 8 CS 9.025 mmu19 16199850 236258567426006 3 cfa1 83903856 90638880 23625856 2375455414 9 CS 10.033 mmu19 23754554 296761925921638 6 cfa1 90773872 96913624 29676192 2976391816 10CS 11.0 6 mmu19 29763918 30164446 400528 15 cfa11 29919668 30510776 30164446 30611872 8 11CS 12.019 mmu19 30611872 345583123946440 5 cfa26 38767664 41958808 34558312 3473440415 12 CSO 13.173 mmu19 34734404 440096169275212 8 cfa28 7343952 15872122 44009616 4408825621 13 CSO 13.271 mmu19 44088256 535826329494376 7 cfa28 15923283 24830712 53582632 5365479614 [[2]] CS(O) id no.anchor ref loc.start loc.end CS(O).size CS(O)ref.density tested loc.start loc.end breakp.start breakp.end den of anchor 1CSO 2.1 4 mmuX 7311438 7428353 116915 34 cfaX 41732964 41660008 7428353835693216 2CSO 2.241 mmuX 8356932 20225456 11868524 3 cfaX 32299338 41540632 20225456 2064158413 3CSO 2.3 8 mmuX 20641584 33046200 12404616 1 cfaX 91770240 94412912 33046200 3317518815 4CSO 3.173 mmuX 33175188 57970280 24795092 3 cfaX 94538728 114133200 57970280 64939220 3 5CSO 3.229 mmuX 64939220 700112805072060 6 cfaX 119319152 124625688 70011280 7003978432 6 CS 4.021 mmuX 70039784 70677328 637544 33 cfaX 124652504 125280776 70677328 7124127229 7CSO 5.1 2 mmuX 71241272 71362456 121184 17 cfaX 125764816 125872960 71362456 7142557614 8CSO 6.1 4 mmuX 71425576 71824776 399200 10 cfaX 125917392 126261784 71824776 73894168 6 9CSO 6.2 2 mmuX 73894168 74014744 120576 17 cfaX 6363930 1898656 74014744 7470540811 10 CSO 6.317 mmuX 74705408 90487648 15782240 1 cfaX 32034930 19573208 90487648 9122816010 11 CSO 6.449 mmuX 91228160 1010581929830032 5 cfaX 51733740 61930260101058192 101967264 9 12CS 7.0 3 mmuX 101967264 102176888 209624 14 cfaX 62797768 63194052102176888 10223004011 13 CSO 8.1 2 mmuX 102230040 102409592 179552 11 cfaX 63307688 63460248102409592 103123352 9 14 CSO 8.216 mmuX 103123352 1105914647468112 2 cfaX 63896752 71000280110591464 116044144 2 15CS 9.0 2 mmuX 116044144 116407200 363056 6 cfaX 71543016 71752808116407200 118512328 1 16CS 10.024 mmuX 118512328 131185424 12673096 2 cfaX 72291072 79468544131185424 13161668820 17CS 11.0 8 mmuX 131616688 132395992 779304 10 cfaX 79821128 80586408132395992 13246176017 18CS 12.021 mmuX 132461760 1375643685102608 4 cfaX 80674704 85936464137564368 13792777612 19 CSO 13.114 mmuX 137927776 1427167524788976 3 cfaX 86288848 90933784142716752 145888160 5 20 CSO 13.2
Re: [R] extracting columns from a list
I forgot to answer to the last part of your question. I think what you call a list is actually an element of a list, right? If so, the command you want depends on the way you want to combine these elements. For example, the following lines will extract columns 12 and 13 of any array-like element of your list and bind them into columns of a same array (if all your elements have the same number of rows). List2 - lapply (NameOfYourList, function (dat, NumCol) dat[,NumCol], c(12,13)) Array2 - do.call (cbind, List2) If you meant something else by 'combine, please be more explicit. Nael On Fri, May 23, 2008 at 3:54 PM, N. Lapidus [EMAIL PROTECTED] wrote: Hi Mohamed Try: lapply (NameOfYourList, function (dat, NumCol) dat[,NumCol], c(12,13)) But there must be a shorter way to write this. Nael On Fri, May 23, 2008 at 3:37 PM, mohamed nur anisah [EMAIL PROTECTED] wrote: Dear all, i have 2 lists of data with each of the list contain 14 columns. How am i going to extract column 12 and 13 from each of the list ?? and can i combine my extracted columns to form a single list. Attach with are my data. Your coorperation is highly appreciated. Many thanks Regards, Anisah [[1]] CS(O) id no.anchor ref loc.start loc.end CS(O).size CS(O)ref.density tested loc.start loc.end breakp.start breakp.end den of anchor 1 CS 2.0 3 mmu19 6465196 6978022 512826 6 cfa18 55567952 55782336 6978022699273428 2 CS 3.057 mmu19 6992734 102499663257232 17 cfa18 55792632 57688808 10249966 1027743025 3 CS 4.021 mmu19 10277430 10955201 61 31 cfa18 57721864 58419812 10955201 1100852636 4 CS 5.0 2 mmu19 11008526 11045352 36826 54 cfa18 58462088 58518608 11045352 1131686532 5 CS 6.0 7 mmu19 11316865 11814604 497739 14 cfa21 53902028 53514536 11814604 1193722837 6 CS 7.014 mmu19 11937228 138476331910405 7 cfa18 40111560 41204940 13847633 1451509117 7 CS 8.0 3 mmu19 14515091 160227701507679 2 cfa1 82195232 83511824 16022770 16199850 5 8 CS 9.025 mmu19 16199850 236258567426006 3 cfa1 83903856 90638880 23625856 2375455414 9 CS 10.033 mmu19 23754554 296761925921638 6 cfa1 90773872 96913624 29676192 2976391816 10CS 11.0 6 mmu19 29763918 30164446 400528 15 cfa11 29919668 30510776 30164446 30611872 8 11CS 12.019 mmu19 30611872 345583123946440 5 cfa26 38767664 41958808 34558312 3473440415 12 CSO 13.173 mmu19 34734404 440096169275212 8 cfa28 7343952 15872122 44009616 4408825621 13 CSO 13.271 mmu19 44088256 535826329494376 7 cfa28 15923283 24830712 53582632 5365479614 [[2]] CS(O) id no.anchor ref loc.start loc.end CS(O).size CS(O)ref.density tested loc.start loc.end breakp.start breakp.end den of anchor 1CSO 2.1 4 mmuX 7311438 7428353 116915 34 cfaX 41732964 41660008 7428353835693216 2CSO 2.241 mmuX 8356932 20225456 11868524 3 cfaX 32299338 41540632 20225456 2064158413 3CSO 2.3 8 mmuX 20641584 33046200 12404616 1 cfaX 91770240 94412912 33046200 3317518815 4CSO 3.173 mmuX 33175188 57970280 24795092 3 cfaX 94538728 114133200 57970280 64939220 3 5CSO 3.229 mmuX 64939220 700112805072060 6 cfaX 119319152 124625688 70011280 7003978432 6 CS 4.021 mmuX 70039784 70677328 637544 33 cfaX 124652504 125280776 70677328 7124127229 7CSO 5.1 2 mmuX 71241272 71362456 121184 17 cfaX 125764816 125872960 71362456 7142557614 8CSO 6.1 4 mmuX 71425576 71824776 399200 10 cfaX 125917392 126261784 71824776 73894168 6 9CSO 6.2 2 mmuX 73894168 74014744 120576 17 cfaX 6363930 1898656 74014744 7470540811 10 CSO 6.317 mmuX 74705408 90487648 15782240 1 cfaX 32034930 19573208 90487648 9122816010 11 CSO 6.449 mmuX 91228160 1010581929830032 5 cfaX 51733740 61930260101058192 101967264 9 12CS 7.0 3 mmuX 101967264 102176888 209624 14 cfaX 62797768 63194052102176888 10223004011 13 CSO 8.1 2 mmuX 102230040 102409592 179552 11 cfaX 63307688 63460248102409592 103123352 9 14 CSO 8.216 mmuX 103123352 1105914647468112 2 cfaX 63896752 71000280110591464 116044144
Re: [R] Fit a sine to data
i guess nls or gnls should work JM El Viernes, 23 de Mayo de 2008 10:47, Zroutik Zroutik escribió: Dear R-users, I'd like to fit a sine function to my data. The result should have a format (and thus the formula, too) y ~ a + sin(x+b) where y and x are vectors, and a and b are (yet) unknown values. The data sets (vectors x and y) are OK, and I can do a simple lm fitting lm(y~x), or lm(y~I(sin(2*pi*x/360))), succesfully My issue is that I'm not able to do the optional linear shift in x (e.g. x+b). What other possibilities should I use instead of lm? I looked searched the R-seek for terms: fit, sine, lm, and combinations, but I could not find anything useful. Anybody would be so kind and point me to the right direction where I can find other fitting possibilities? Thank you for listening and kind answers upfront. Regards, Milan [[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] Pros and Cons of R
Monica Pisica wrote: - You can save scripts, but not *.exe. If you want to contrast R with statistical packages like SPSS or Stata (and if your audience has rather a background in those than in general purpose languages), I think this is not really a problem unless I missed something recently about the capabilities of SPSS or Stata. Best, Roland __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] extracting columns from a list
Le ven. 23 mai à 09:37, mohamed nur anisah a écrit : Dear all, i have 2 lists of data with each of the list contain 14 columns. No, you have one list with two elements; each is a 14-column data frame. How am i going to extract column 12 and 13 from each of the list ?? Let's call your list 'x'. Then lapply(x, [, c(12, 13)) or, better yet, lapply(x, [, c(breakp.start, breakp.end)) if I counted your columns correctly. and can i combine my extracted columns to form a single list. You mean a single data frame? Given that the number of rows is not the same in both elements, no. If they were, using sapply() instead of lapply() would do the trick. HTH Vincent Attach with are my data. Your coorperation is highly appreciated. Many thanks Regards, Anisah [[1]] CS(O) id no.anchor ref loc.start loc.end CS(O).size CS(O)ref.density tested loc.start loc.end breakp.start breakp.end den of anchor 1 CS 2.0 3 mmu19 6465196 6978022 5128266 cfa18 55567952 55782336 6978022 699273428 2 CS 3.057 mmu19 6992734 10249966 3257232 17 cfa18 55792632 57688808 10249966 1027743025 3 CS 4.021 mmu19 10277430 10955201 61 31 cfa18 57721864 58419812 10955201 1100852636 4 CS 5.0 2 mmu19 11008526 11045352 36826 54 cfa18 58462088 58518608 11045352 1131686532 5 CS 6.0 7 mmu19 11316865 11814604 497739 14 cfa21 53902028 53514536 11814604 1193722837 6 CS 7.014 mmu19 11937228 13847633 19104057 cfa18 40111560 41204940 13847633 1451509117 7 CS 8.0 3 mmu19 14515091 16022770 15076792 cfa1 82195232 83511824 16022770 16199850 5 8 CS 9.025 mmu19 16199850 23625856 74260063 cfa1 83903856 90638880 23625856 2375455414 9 CS 10.033 mmu19 23754554 29676192 59216386 cfa1 90773872 96913624 29676192 2976391816 10CS 11.0 6 mmu19 29763918 30164446 400528 15 cfa11 29919668 30510776 30164446 30611872 8 11CS 12.019 mmu19 30611872 34558312 39464405 cfa26 38767664 41958808 34558312 3473440415 12 CSO 13.173 mmu19 34734404 44009616 92752128 cfa28 7343952 15872122 44009616 4408825621 13 CSO 13.271 mmu19 44088256 53582632 94943767 cfa28 15923283 24830712 53582632 5365479614 [[2]] CS(O) id no.anchor ref loc.start loc.end CS(O).size CS(O)ref.density tested loc.start loc.end breakp.start breakp.end den of anchor 1CSO 2.1 4 mmuX 7311438 7428353 116915 34 cfaX 41732964 41660008 7428353 835693216 2CSO 2.241 mmuX 8356932 20225456 118685243 cfaX 32299338 41540632 20225456 2064158413 3CSO 2.3 8 mmuX 20641584 33046200 124046161 cfaX 91770240 94412912 33046200 3317518815 4CSO 3.173 mmuX 33175188 57970280 247950923 cfaX 94538728 114133200 57970280 64939220 3 5CSO 3.229 mmuX 64939220 70011280 50720606 cfaX 119319152 124625688 70011280 7003978432 6 CS 4.021 mmuX 70039784 70677328 637544 33 cfaX 124652504 125280776 70677328 7124127229 7CSO 5.1 2 mmuX 71241272 71362456 121184 17 cfaX 125764816 125872960 71362456 7142557614 8CSO 6.1 4 mmuX 71425576 71824776 399200 10 cfaX 125917392 126261784 71824776 73894168 6 9CSO 6.2 2 mmuX 73894168 74014744 120576 17 cfaX 6363930 1898656 74014744 7470540811 10 CSO 6.317 mmuX 74705408 90487648 157822401 cfaX 32034930 19573208 90487648 9122816010 11 CSO 6.449 mmuX 91228160 101058192 98300325 cfaX 51733740 61930260101058192 101967264 9 12CS 7.0 3 mmuX 101967264 102176888 209624 14 cfaX 62797768 63194052102176888 10223004011 13 CSO 8.1 2 mmuX 102230040 102409592 179552 11 cfaX 63307688 63460248102409592 103123352 9 14 CSO 8.216 mmuX 103123352 110591464 74681122 cfaX 63896752 71000280110591464
[R] Preparing high quality figures with tiff as end result
Hi all, I'm currently preparing some figures that will be submitted to PloS One. In their guidelines they state that they will only accept figures in tiff or eps format, with the warning that eps figures will be converted to tiff format ( see http://www.plosone.org/static/figureGuidelines.action ). Because of this conversion, I figured I'd generate tiff-format figures from the beginning. However, a number of issues cropped up: 1) using library(Cairo) CairoTIFF(test.tif) I get Sorry, this Cairo was compiled without tiff support.. I tried finding out how to recompile Cairo, but got lost in a lot of confusing talk about GTK+, downloaded dll files that I didn't know how to use etc. so I turned to plain tiff(), and 2) R started crashing on me.The following code tiff(test.tif) plot(rnorm(100)) dev.off() ,crashes R (i.e R GUI has encountered a problem and needs to close...) every third time or so. When it does work, the resulting output is not too pretty. So I turned to using postscript files. However, Plos One requires that fonts be embedded into the figure. embedFonts() works for this, but the result is that text becomes low-res bitmaps, and I don't know how to solve this. So basically my question is: How should I go about generating graphics that will look as nice as possible given the above constraints? Many thanks in advance, Gustaf -- Gustaf Rydevik, M.Sci. tel: +46(0)703 051 451 address:Essingetorget 40,112 66 Stockholm, SE skype:gustaf_rydevik __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Preparing high quality figures with tiff as end result
On Fri, May 23, 2008 at 4:40 PM, Gustaf Rydevik [EMAIL PROTECTED] wrote: Hi all, I'm currently preparing some figures that will be submitted to PloS One. In their guidelines they state that they will only accept figures in tiff or eps format, with the warning that eps figures will be converted to tiff format ( see http://www.plosone.org/static/figureGuidelines.action ). Because of this conversion, I figured I'd generate tiff-format figures from the beginning. However, a number of issues cropped up: 1) using library(Cairo) CairoTIFF(test.tif) I get Sorry, this Cairo was compiled without tiff support.. I tried finding out how to recompile Cairo, but got lost in a lot of confusing talk about GTK+, downloaded dll files that I didn't know how to use etc. so I turned to plain tiff(), and 2) R started crashing on me.The following code tiff(test.tif) plot(rnorm(100)) dev.off() ,crashes R (i.e R GUI has encountered a problem and needs to close...) every third time or so. When it does work, the resulting output is not too pretty. So I turned to using postscript files. However, Plos One requires that fonts be embedded into the figure. embedFonts() works for this, but the result is that text becomes low-res bitmaps, and I don't know how to solve this. So basically my question is: How should I go about generating graphics that will look as nice as possible given the above constraints? Many thanks in advance, Gustaf Oh, and before anyone bites my head of, I forgot the following: sessionInfo() R version 2.7.0 (2008-04-22) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] RWinEdt_1.8-0 Cairo_1.4-2 , and I'm using windows XP professional again, many thanks in advance /Gustaf -- Gustaf Rydevik, M.Sci. tel: +46(0)703 051 451 address:Essingetorget 40,112 66 Stockholm, SE skype:gustaf_rydevik __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Percentages for categorical data by group
I can think of several ways to blunt force hard code what I want but I imagine there is a command or two that can be easily combined to do this: I have a data frame with about 23000 observations. There first variable is the group to which the observation belongs (about 500 different groups). The second variable is a response for each observation that is a 1,2,3,4 or 5. I want to be able to calculate the percentage of each group that choose each response. For example I want to know what percentage of group 1 (which may have a value of 34456) choose response 1 and so on. Here is some code I wrote that generates a data frame like the one I have. pop - matrix(1:10) groupIDs - sample(pop,500) groupVar - sample(groupIDs,23000,replace=TRUE) responseVar - sample(1:5,23000,replace=TRUE) example.data - data.frame(groupVar,responseVar) Is there a fast way to calculate these percentages beyond writing loops to manually count the responses for each of the groups? Thanks, EG [[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] Line Breaks and Axis breaks..
Hello all, I have two questions. One probably has a very simple answer but I have checked the FAQ, other websites and still have not found an answer. I am new to using R. My very simple question is how to do line breaks when creating an axis title (xlab) ? I have a few that are too long and they get cut off... I found on the internet the /n function but I think I must be using it incorrectly because it is not working. My second question is: after inserting an axis break using the following code, how to I adjust the scales on either side of that axis break? This is for a boxplot graph. See attachment... there is an outlier under CLI 5 that can't be seen as a result. install.packages(plotrix) axis.break(axis=1, breakpos=NULL, bgcol=white, breakcol=black, style=gap, brw=0.02) Thank you very much in advance! Megan Bellamy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Fit a sine to data
Juan Manuel Barreneche wrote: i guess nls or gnls should work Yes. Notice though that this is really a linear problem because of the trigonometric identity sin(x+b) = cos(b) * sin(x) + sin(b) * cos(x) which means that you can reparametrize c*sin(x+b) (you forgot the multiplier, did you not?) as A*sin(x)+B*cos(x) It is easy to invert the reparametrization if you notice that A^2 + B^2 = c^2, but it may be expedient to use the nonlinear functions to get confidence itervals for a,b,c. JM El Viernes, 23 de Mayo de 2008 10:47, Zroutik Zroutik escribió: Dear R-users, I'd like to fit a sine function to my data. The result should have a format (and thus the formula, too) y ~ a + sin(x+b) where y and x are vectors, and a and b are (yet) unknown values. The data sets (vectors x and y) are OK, and I can do a simple lm fitting lm(y~x), or lm(y~I(sin(2*pi*x/360))), succesfully My issue is that I'm not able to do the optional linear shift in x (e.g. x+b). What other possibilities should I use instead of lm? I looked searched the R-seek for terms: fit, sine, lm, and combinations, but I could not find anything useful. Anybody would be so kind and point me to the right direction where I can find other fitting possibilities? Thank you for listening and kind answers upfront. Regards, Milan [[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. -- 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] Line Breaks and Axis breaks..
plot(1:10, xlab='Hi Megan, \n Is this what you want?') -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Megan J Bellamy Sent: Friday, May 23, 2008 10:56 AM To: r-help@r-project.org Subject: [R] Line Breaks and Axis breaks.. Hello all, I have two questions. One probably has a very simple answer but I have checked the FAQ, other websites and still have not found an answer. I am new to using R. My very simple question is how to do line breaks when creating an axis title (xlab) ? I have a few that are too long and they get cut off... I found on the internet the /n function but I think I must be using it incorrectly because it is not working. My second question is: after inserting an axis break using the following code, how to I adjust the scales on either side of that axis break? This is for a boxplot graph. See attachment... there is an outlier under CLI 5 that can't be seen as a result. install.packages(plotrix) axis.break(axis=1, breakpos=NULL, bgcol=white, breakcol=black, style=gap, brw=0.02) Thank you very much in advance! Megan Bellamy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Question about Runuran (Triangular Distribution)
The Runuran package includes a simulation for the Triangular Distribution, urtriang. But I didn't find an analogue of the q* functions (rnorm - qnorm, runif - qunif), that would invert the CDF (?uqtriang). Are there any such functions? Alberto Monteiro __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Percentages for categorical data by group
on 05/23/2008 09:51 AM Economics Guy wrote: I can think of several ways to blunt force hard code what I want but I imagine there is a command or two that can be easily combined to do this: I have a data frame with about 23000 observations. There first variable is the group to which the observation belongs (about 500 different groups). The second variable is a response for each observation that is a 1,2,3,4 or 5. I want to be able to calculate the percentage of each group that choose each response. For example I want to know what percentage of group 1 (which may have a value of 34456) choose response 1 and so on. Here is some code I wrote that generates a data frame like the one I have. pop - matrix(1:10) groupIDs - sample(pop,500) groupVar - sample(groupIDs,23000,replace=TRUE) responseVar - sample(1:5,23000,replace=TRUE) example.data - data.frame(groupVar,responseVar) Is there a fast way to calculate these percentages beyond writing loops to manually count the responses for each of the groups? Thanks, EG Using: table(example.data) will give you a cross tabulation of the counts of your ResponseVar by each groupVar. prop.table(table(example.data), 1) will give you a row-wise proportion (0 - 1) of the counts of ResponseVar for each groupVar. If you want percentages (0 - 100): prop.table(table(example.data), 1) * 100 See ?table and ?prop.table for more information. HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Question about Runuran (Triangular Distribution)
Please refer to: qtriangle function in VGAM library thanks y Alberto Monteiro wrote: The Runuran package includes a simulation for the Triangular Distribution, urtriang. But I didn't find an analogue of the q* functions (rnorm - qnorm, runif - qunif), that would invert the CDF (?uqtriang). Are there any such functions? Alberto Monteiro __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. - Yasir H. Kaheil Catchment Research Facility The University of Western Ontario -- View this message in context: http://www.nabble.com/Question-about-Runuran-%28Triangular-Distribution%29-tp17427688p17428151.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] problem using embedded R
I have a peculiar problem with an application that uses embedded R. The application comes with its own copy of R installation and it sets up correct environment path for the process during the startup. However, when I execute R code that loads an additional package (e.g. library(XYZ)), the environment path gets reset to the system's default value, which renders R unusable. I wonder if anyone had experienced a similar problem and knows how to fix it? Victor [[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] Fit a sine to data
Milan, This is a fairly standard trick. Let us generalize your equation slightly: y ~ a + c*sin(x+b) so the amplitude of the sine wave is adjustable (otherwise, you assume (or know) that the amplitude is 1). Then y ~ a + c*sin(b)*cos(x) + c*cos(b)*sin(x) or y ~ b0 + b1*x1 + b2*x2 which is a linear regression form that you can do using the lm function. After you get b0, b1 and b2 you do a = b0 b1^2 + b2^2 = c^2*(sin^2(b) + cos^2(b)) = c^2 c = sqrt(b1^2 + b2^2) b1/b2 = tan(b) b = arctan(b1/b2) Hope this helps, Andy __ Andy Jaworski 518-1-01 Process Laboratory 3M Corporate Research Laboratory - E-mail: [EMAIL PROTECTED] Tel: (651) 733-6092 Fax: (651) 736-3122 Zroutik Zroutik [EMAIL PROTECTED] m To Sent by: r-help@r-project.org [EMAIL PROTECTED] cc project.org Subject [R] Fit a sine to data 05/23/2008 08:49 AM Dear R-users, I'd like to fit a sine function to my data. The result should have a format (and thus the formula, too) y ~ a + sin(x+b) where y and x are vectors, and a and b are (yet) unknown values. The data sets (vectors x and y) are OK, and I can do a simple lm fitting lm(y~x), or lm(y~I(sin(2*pi*x/360))), succesfully My issue is that I'm not able to do the optional linear shift in x (e.g. x+b). What other possibilities should I use instead of lm? I looked searched the R-seek for terms: fit, sine, lm, and combinations, but I could not find anything useful. Anybody would be so kind and point me to the right direction where I can find other fitting possibilities? Thank you for listening and kind answers upfront. Regards, Milan [[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] automation of R? running an R script at a certain time each night?
Hi: Edward, were you able to automate the process? if so, do you mind giving me a hint on how you did it? I am facing the same problem. I created a batch file which it runs fine using the task scheduler but only opens Tinn-R and R but it doesn't execute my script. My task scheduler executes everyday at 8:00 am This is my batch file: @echo off Start C:\Program Files\R\R-2.7.0\bin\Rgui.exe start C:\Documents and settings\Desktop\Software\MyScript.r What am I missing? --- Edward Wijaya [EMAIL PROTECTED] wrote: You might try cron job under Windows. http://drupal.org/node/31506 HTH. - Edward On Thu, May 22, 2008 at 8:51 AM, Thomas Pujol [EMAIL PROTECTED] wrote: I am using R in a Windows environment. I store my data in a Microsoft SQL database that gets updated automatically nightly. Once my SQL db is updated, I wish to automatically run an R script Any tips on good ways to approach this task? Is there an easy way to launch an R script using the Windows or other scheduler? Can I have an R-script run every hour, and within the script check to determine if my database is updated, and proceed only if it is updated? [[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. Felipe D. Carrillo Fishery Biologist Department of the Interior US Fish Wildlife Service California, USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Percentages for categorical data by group
tapply(example.data$responseVar,example.data$groupVar,function(x){prop.t able(table(x))}) Michael Conklin Chief Methodologist - Advanced Analytics MarketTools, Inc. 6465 Wayzata Blvd. Suite 170 Minneapolis, MN 55426 Tel: 952.417.4719 | Mobile:612.201.8978 [EMAIL PROTECTED] MarketTools(r)http://www.markettools.com This e-mail and any attachments may contain privileged, confidential or proprietary information. If you are not the intended recipient, be aware that any review, copying, or distribution of this e-mail or any attachment is strictly prohibited. If you have received this e-mail in error, please return it to the sender immediately, and permanently delete the original and any copies from your system. Thank you for your cooperation. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Economics Guy Sent: Friday, May 23, 2008 9:52 AM To: [EMAIL PROTECTED] Subject: [R] Percentages for categorical data by group I can think of several ways to blunt force hard code what I want but I imagine there is a command or two that can be easily combined to do this: I have a data frame with about 23000 observations. There first variable is the group to which the observation belongs (about 500 different groups). The second variable is a response for each observation that is a 1,2,3,4 or 5. I want to be able to calculate the percentage of each group that choose each response. For example I want to know what percentage of group 1 (which may have a value of 34456) choose response 1 and so on. Here is some code I wrote that generates a data frame like the one I have. pop - matrix(1:10) groupIDs - sample(pop,500) groupVar - sample(groupIDs,23000,replace=TRUE) responseVar - sample(1:5,23000,replace=TRUE) example.data - data.frame(groupVar,responseVar) Is there a fast way to calculate these percentages beyond writing loops to manually count the responses for each of the groups? Thanks, EG [[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] Preparing high quality figures with tiff as end result
Try bitmap(): this produces PostScript and converts with ghostscript. BTW, everything (including text) in TIFF files *is* 'low-res bitmaps' by definition, so you cannot avoid this. Anti-aliasing *may* help, and the bitmap() device in R-devel supports it. On Fri, 23 May 2008, Gustaf Rydevik wrote: Hi all, I'm currently preparing some figures that will be submitted to PloS One. In their guidelines they state that they will only accept figures in tiff or eps format, with the warning that eps figures will be converted to tiff format ( see http://www.plosone.org/static/figureGuidelines.action ). Because of this conversion, I figured I'd generate tiff-format figures from the beginning. However, a number of issues cropped up: 1) using library(Cairo) CairoTIFF(test.tif) I get Sorry, this Cairo was compiled without tiff support.. I tried finding out how to recompile Cairo, but got lost in a lot of confusing talk about GTK+, downloaded dll files that I didn't know how to use etc. so I turned to plain tiff(), and 2) R started crashing on me.The following code tiff(test.tif) plot(rnorm(100)) dev.off() ,crashes R (i.e R GUI has encountered a problem and needs to close...) every third time or so. When it does work, the resulting output is not too pretty. Which means what? So I turned to using postscript files. However, Plos One requires that fonts be embedded into the figure. embedFonts() works for this, but the result is that text becomes low-res bitmaps, and I don't know how to solve this. So basically my question is: How should I go about generating graphics that will look as nice as possible given the above constraints? Many thanks in advance, Gustaf -- Gustaf Rydevik, M.Sci. tel: +46(0)703 051 451 address:Essingetorget 40,112 66 Stockholm, SE skype:gustaf_rydevik __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Boxplot width
Hi there, assume that you have data with different sampling like d1 - rnorm(100) d2 - rnorm(150) now, I'd like to create two boxplots in one graph but each plot located at the sampling number at the x-axis. This, I can do with at l - list(d1,d2) boxplot(l, at=c(length(d1), length(d2)), xlim=c(0,200) ) but both plots are very thin and I'd like to increase the width of the plot. I tried width but probably I do it wrong. Can anybody help me? Antje __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] automation of R? running an R script at a certain time each night?
Thank you Prof Ripley --- Prof Brian Ripley [EMAIL PROTECTED] wrote: On Fri, 23 May 2008, Felipe Carrillo wrote: Hi: Edward, were you able to automate the process? if so, do you mind giving me a hint on how you did it? I am facing the same problem. I created a batch file which it runs fine using the task scheduler but only opens Tinn-R and R but it doesn't execute my script. My task scheduler executes everyday at 8:00 am This is my batch file: @echo off Start C:\Program Files\R\R-2.7.0\bin\Rgui.exe start C:\Documents and settings\Desktop\Software\MyScript.r What am I missing? Rscript[.exe] You don't want (I presume) to run a GUI to execute a script. Felipe D. Carrillo Fishery Biologist Department of the Interior US Fish Wildlife Service California, USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Preparing high quality figures with tiff as end result
One bit you didn't tell us was that the journal asks for 600dpi TIFF files, but you also forgot to tell R that. Try bitmap(type=tifflzw, res=600) -- you probably will not need anti-aliasing. On Fri, 23 May 2008, Prof Brian Ripley wrote: Try bitmap(): this produces PostScript and converts with ghostscript. BTW, everything (including text) in TIFF files *is* 'low-res bitmaps' by definition, so you cannot avoid this. Anti-aliasing *may* help, and the bitmap() device in R-devel supports it. On Fri, 23 May 2008, Gustaf Rydevik wrote: Hi all, I'm currently preparing some figures that will be submitted to PloS One. In their guidelines they state that they will only accept figures in tiff or eps format, with the warning that eps figures will be converted to tiff format ( see http://www.plosone.org/static/figureGuidelines.action ). Because of this conversion, I figured I'd generate tiff-format figures from the beginning. However, a number of issues cropped up: 1) using library(Cairo) CairoTIFF(test.tif) I get Sorry, this Cairo was compiled without tiff support.. I tried finding out how to recompile Cairo, but got lost in a lot of confusing talk about GTK+, downloaded dll files that I didn't know how to use etc. so I turned to plain tiff(), and 2) R started crashing on me.The following code tiff(test.tif) plot(rnorm(100)) dev.off() ,crashes R (i.e R GUI has encountered a problem and needs to close...) every third time or so. When it does work, the resulting output is not too pretty. Which means what? So I turned to using postscript files. However, Plos One requires that fonts be embedded into the figure. embedFonts() works for this, but the result is that text becomes low-res bitmaps, and I don't know how to solve this. So basically my question is: How should I go about generating graphics that will look as nice as possible given the above constraints? Many thanks in advance, Gustaf -- Gustaf Rydevik, M.Sci. tel: +46(0)703 051 451 address:Essingetorget 40,112 66 Stockholm, SE skype:gustaf_rydevik __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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 -- 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.
Re: [R] problem using embedded R
All the usual questions: What OS? What version of R? What is meant by 'environment path'? (The environment of a process is not a path.) I have a hunch that if this is Windows = XP it was solved in R 2.7.0. Otherwise the footer of this message applies. On Fri, 23 May 2008, Lobanov, Victor S. [PRDUS] wrote: I have a peculiar problem with an application that uses embedded R. The application comes with its own copy of R installation and it sets up correct environment path for the process during the startup. However, when I execute R code that loads an additional package (e.g. library(XYZ)), the environment path gets reset to the system's default value, which renders R unusable. I wonder if anyone had experienced a similar problem and knows how to fix it? Victor [[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.
Re: [R] automation of R? running an R script at a certain time each night?
Felipe Carrillo wrote: Hi: Edward, were you able to automate the process? if so, do you mind giving me a hint on how you did it? I am facing the same problem. I created a batch file which it runs fine using the task scheduler but only opens Tinn-R and R but it doesn't execute my script. My task scheduler executes everyday at 8:00 am This is my batch file: @echo off Start C:\Program Files\R\R-2.7.0\bin\Rgui.exe start C:\Documents and settings\Desktop\Software\MyScript.r What am I missing? Looks to me that the batch file above starts up the R GUI, and opens an editor, so it sounds like it is doing exactly what you're asking it to. Here's how I can get R to run as a scheduled task in Windows XP: Create a new Scheduled Task with the following in the Run: box: C:\Rbuild\R-2.6.2\bin\Rcmd.exe BATCH c:/Temp/Rtest.R Then schedule it how I want it to run. Here's the contents of my .R file and the output: $ cat c:/Temp/Rtest.R cat(file=c:/Temp/Rtest.txt, date(), \n, append=TRUE) $ cat c:/Temp/Rtest.txt Fri May 23 10:34:22 2008 Fri May 23 10:34:50 2008 Fri May 23 10:40:01 2008 (I'm sure there are dozens of other ways of doing this, but the above worked for me.) -- Tony Plate --- Edward Wijaya [EMAIL PROTECTED] wrote: You might try cron job under Windows. http://drupal.org/node/31506 HTH. - Edward On Thu, May 22, 2008 at 8:51 AM, Thomas Pujol [EMAIL PROTECTED] wrote: I am using R in a Windows environment. I store my data in a Microsoft SQL database that gets updated automatically nightly. Once my SQL db is updated, I wish to automatically run an R script Any tips on good ways to approach this task? Is there an easy way to launch an R script using the Windows or other scheduler? Can I have an R-script run every hour, and within the script check to determine if my database is updated, and proceed only if it is updated? [[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. Felipe D. Carrillo Fishery Biologist Department of the Interior US Fish Wildlife Service California, USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Alternatives to rJava and JRI
Roy Mendelssohn wrote: I do not know if this is better as we are just starting to look into it (and better is in the eye of the beholder) but look at: http://tolstoy.newcastle.edu.au/R/e3/help/07/11/4253.html in the archives. The link to the software is http://www.ebi.ac.uk/microarray-srv/frontendapp/ The new website (with all current information) is at http://www.biocep.net It is still very actively developed and there will be a tutorial at useR!2008 as well as a presentation. Cf. http://www.statistik.uni-dortmund.de/useR-2008//tutorials/chine.html HTH, Tobias HTH, -Roy M. On May 22, 2008, at 12:50 PM, Munir, Danish wrote: Has anyone come across any alternatives to rJava and JRI? Are they any good? Better perhaps? Please give your reasons. Thanks, Danish - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ** The contents of this message do not reflect any position of the U.S. Government or NOAA. ** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center 1352 Lighthouse Avenue Pacific Grove, CA 93950-2097 e-mail: [EMAIL PROTECTED] (Note new e-mail address) voice: (831)-648-9029 fax: (831)-648-8440 www: http://www.pfeg.noaa.gov/ Old age and treachery will overcome youth and skill. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] problem using embedded R
It is Windows 2000 still... I use latest version of R 2.7.0. There is a system environment variable PATH that lists directories where system looks for dlls when needed. Each running process can modify this environment variable, but changes apply to this process only. Instead of modifying system settings, my application simply sets correct R_HOME and PATH (e.g. c:\MyApp\R\bin) when it starts so that R can load supporting dlls such as lapack.dll. However, after I load a package and check process PATH, it is reset to the original system setting and all my modifications are lost. -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Friday, May 23, 2008 12:46 PM To: Lobanov, Victor S. [PRDUS] Cc: r-help@r-project.org Subject: Re: [R] problem using embedded R All the usual questions: What OS? What version of R? What is meant by 'environment path'? (The environment of a process is not a path.) I have a hunch that if this is Windows = XP it was solved in R 2.7.0. Otherwise the footer of this message applies. On Fri, 23 May 2008, Lobanov, Victor S. [PRDUS] wrote: I have a peculiar problem with an application that uses embedded R. The application comes with its own copy of R installation and it sets up correct environment path for the process during the startup. However, when I execute R code that loads an additional package (e.g. library(XYZ)), the environment path gets reset to the system's default value, which renders R unusable. I wonder if anyone had experienced a similar problem and knows how to fix it? Victor [[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.
Re: [R] 1501-511 Compilation failed for file ch2inv.f - R on AIX 5.2.
Hi, Thanks for the response. We do have a IBM XL Fortran Enterprise Edition for AIX, V11.1 coupled with IBM XL C/C++ Enterprise Edition for AIX, V9.0 specifically on our IBM-AIX 5.2 system for the 'R' software. The 'f95' represents Fortran 95 compiler and I presume the 'R' sources can be compiled with 'f95' compiler too. Any thoughts? Thanks, Senthil - Original Message From: Prof Brian Ripley [EMAIL PROTECTED] To: Senthilkumaran [EMAIL PROTECTED] Cc: r-help@r-project.org Sent: Friday, May 23, 2008 1:39:16 AM Subject: Re: [R] 1501-511 Compilation failed for file ch2inv.f - R on AIX 5.2. Look like you need to use a Fortran compiler set to accept Fortran 77 (which the R sources are). We don't know what 'f95' is, and this is not really an R issue so please ask your sysadmins for help. On Thu, 22 May 2008, Senthilkumaran wrote: Hi, While executing the make after successful configuration (./configure --with-readline=no --without-iconv), the following error occurs: mbf2n11s (Regatta) /saswork/R/R-2.7.0$ make Target R is up to date. Target R is up to date. Target R is up to date. Target R is up to date. Target Makedeps is up to date. Target libbz2.a is up to date. Target Makedeps is up to date. Target libpcre.a is up to date. Target Makedeps is up to date. Target libz.a is up to date. Target Makedeps is up to date. f95 -g -c ch2inv.f -o ch2inv.o ch2inv.f, line 1.2: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 2.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 3.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 4.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 5.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 6.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 7.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 7.39: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 8.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 9.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 9.41: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 10.8: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 11.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 12.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 13.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 13.38: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 14.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 15.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 16.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 17.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 18.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 18.32: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 19.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 20.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 21.2: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 22.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 23.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 24.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 25.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 26.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 27.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 28.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 29.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 30.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 30.30: 1515-018 (S) Incorrect character found in source at line 30 in column 30. Hexadecimal value of character is 7B. ch2inv.f, line 30.39: 1515-018 (S) Incorrect character found in source at line 30 in column 39. Hexadecimal value of character is 7D. ch2inv.f, line 31.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 32.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 33.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 34.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 35.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 36.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 37.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 38.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 39.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 40.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 41.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 42.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 43.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 44.0: 1515-010 (S) String is missing a closing delimiter. Closing delimiter assumed at end of line. ch2inv.f, line 44.4: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 45.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 46.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 47.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 48.1: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 49.0: 1515-010 (S) String is missing a closing delimiter. Closing delimiter assumed at end of line. ch2inv.f, line 49.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 50.3: 1515-019 (S) Syntax is incorrect. ch2inv.f, line 51.1: 1515-019 (S) Syntax is incorrect.
Re: [R] Alternatives to rJava and JRI
Thanks a lot everyone. These seem like very useful resources. I will check all of these out, and hopefully provide feedback so others can benefit too. -Original Message- From: Tobias Verbeke [mailto:[EMAIL PROTECTED] Sent: Friday, May 23, 2008 1:03 PM To: Roy Mendelssohn Cc: Munir, Danish; r-help@r-project.org Subject: Re: [R] Alternatives to rJava and JRI Roy Mendelssohn wrote: I do not know if this is better as we are just starting to look into it (and better is in the eye of the beholder) but look at: http://tolstoy.newcastle.edu.au/R/e3/help/07/11/4253.html in the archives. The link to the software is http://www.ebi.ac.uk/microarray-srv/frontendapp/ The new website (with all current information) is at http://www.biocep.net It is still very actively developed and there will be a tutorial at useR!2008 as well as a presentation. Cf. http://www.statistik.uni-dortmund.de/useR-2008//tutorials/chine.html HTH, Tobias HTH, -Roy M. On May 22, 2008, at 12:50 PM, Munir, Danish wrote: Has anyone come across any alternatives to rJava and JRI? Are they any good? Better perhaps? Please give your reasons. Thanks, Danish - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ** The contents of this message do not reflect any position of the U.S. Government or NOAA. ** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center 1352 Lighthouse Avenue Pacific Grove, CA 93950-2097 e-mail: [EMAIL PROTECTED] (Note new e-mail address) voice: (831)-648-9029 fax: (831)-648-8440 www: http://www.pfeg.noaa.gov/ Old age and treachery will overcome youth and skill. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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 intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
[R] IDE
People, I'm a ubunto user and I used to write my scipts in Java Gui for R, but it is a very slow tool to run my scripts... Do you know some efficient IDE for R? Thank!!! Alexandra Almeida -- Alexandra R M de Almeida [[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] Colspan rowspan
Hi, What's the best way to build tables with multiple sets of column/row headings, each spanning 1 or more cols/rows, similar to the colspan/ rowspan options in HTML. I am using Sweave but couldn't find an option to do this in xtable. I can obviously build it by hand, just wanted to make sure there wasn't an easier way. 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] GARCH-like
I need to change the code of Garch to the FCGARCH (a non-linear multi-regime GARCH). I don't know nothing about R. I'd like to know how can I get the code of the garch in order to change it and make the fit for the FC-GARCH. Any non-linear code will be helpfull because if doesn't help in the programming it helps in getting familiar with R. Thank you Renato -- PhD Student Renato Alencar Adelino da Costa ([EMAIL PROTECTED]) Department of Electrical Engineering (Mathematical Finance) Pontifical Catholic University (PUC-Rio) Rua Marques de Sao Vicente, 225, Sala 604L Gavea CEP: 22453-900 Rio de Janeiro BRASIL tel.:55-21-3527-1205 [[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] Percentages for categorical data by group
Thanks Michael that works! Now I am having a problem getting the results into a format I can use. prop.table generates a contingency table that I tried to turn into a data frame I could graph from with as.data.frame() however the results are not a true data.frame. The rows have commas between some of the elements and trying to look at a column results in the original contingency table being displayed. This is what I have: pop - matrix(1:10) groupIDs - sample(pop,500) groupVar - sample(groupIDs,23000,replace=TRUE) responseVar - sample(1:5,23000,replace=TRUE) example.data - data.frame(groupVar,responseVar) data.table - tapply(example.data$responseVar,example.data$groupVar,function(x){prop.table(table(x))}) example.data.frame - as.data.frame(data.table) But the example.data.frame object is not a true data frame, and I am not sure how to get it into a format I can graph. On Fri, May 23, 2008 at 11:33 AM, Michael Conklin [EMAIL PROTECTED] wrote: tapply(example.data$responseVar,example.data$groupVar,function(x){prop.t able(table(x))}) Michael Conklin Chief Methodologist - Advanced Analytics [[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] Boxplot width
Hi Antje, Try this: d1 - rnorm(100) d2 - rnorm(150) boxplot(c(d1,d2) ~ rep(c(1,2),c(100,150)),col=c(4:5)) HTH, Jorge On Fri, May 23, 2008 at 11:52 AM, Antje [EMAIL PROTECTED] wrote: Hi there, assume that you have data with different sampling like d1 - rnorm(100) d2 - rnorm(150) now, I'd like to create two boxplots in one graph but each plot located at the sampling number at the x-axis. This, I can do with at l - list(d1,d2) boxplot(l, at=c(length(d1), length(d2)), xlim=c(0,200) ) but both plots are very thin and I'd like to increase the width of the plot. I tried width but probably I do it wrong. Can anybody help me? Antje __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Percentages for categorical data by group
Hi there, Try this: do.call(rbind,data.table) HTH, Jorge On Fri, May 23, 2008 at 1:31 PM, Economics Guy [EMAIL PROTECTED] wrote: Thanks Michael that works! Now I am having a problem getting the results into a format I can use. prop.table generates a contingency table that I tried to turn into a data frame I could graph from with as.data.frame() however the results are not a true data.frame. The rows have commas between some of the elements and trying to look at a column results in the original contingency table being displayed. This is what I have: pop - matrix(1:10) groupIDs - sample(pop,500) groupVar - sample(groupIDs,23000,replace=TRUE) responseVar - sample(1:5,23000,replace=TRUE) example.data - data.frame(groupVar,responseVar) data.table - tapply(example.data$responseVar,example.data$groupVar,function(x){prop.table(table(x))}) example.data.frame - as.data.frame(data.table) But the example.data.frame object is not a true data frame, and I am not sure how to get it into a format I can graph. On Fri, May 23, 2008 at 11:33 AM, Michael Conklin [EMAIL PROTECTED] wrote: tapply(example.data$responseVar,example.data$groupVar,function(x){prop.t able(table(x))}) Michael Conklin Chief Methodologist - Advanced Analytics [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Pros and Cons of R
Monica, here are some other Pros to consider about R: 1) IMHO, the most important reason for using R is that expressed by John Chambers as the aim of the S language: to turn ideas into software, quickly and faithfully. The broad capabilities of R facilitate the integration of data maintenance and cleaning, exploratory data analysis, model estimation, model implementation, model calibration, model application, and the reporting and display of model outputs. This has tremendous productivity advantages. For example, I was able to meet a tight timeline for developing a regional land use model because R allowed me to easily move through the steps of model development from data analysis to implementation. I even found that I could do some geographical operations that could not be done using our GIS software. In addition, all of the model outputs (including a very many maps) were produced with R. Once you learn how to use R in this way, you will find it takes less time to program the outputs in R than to produce them in GIS. R yields productivity advantages in smaller ways too. We've developed a number of small applications to solve GIS or other problems that could not be solved as easily using other tools. Moreover, once they have been solved using R, the solutions are easily automated or recycled in other contexts. 2) R facilitates documentation and replication. Previous to using R, we did our data analysis and implemented our models in a variety of platforms. For example, Access, Excel, SPSS and Stata were all previously used in household survey data processing and analysis. This was a documentation nightmare. All the steps can be done using R instead and documentation can be easily included in the scripts. If care is taken to use good naming conventions that emphasize readability, the scripts can be largely self documenting. This also facilitates group work. Since we started using R in our work, we have been able to greatly increase our modeling capabilities and output with no increase in staffing. Brian Gregor, P.E. Senior Transportation Analyst Oregon Department of Transportation Transportation Planning Analysis Unit 555 13th Street NE Salem, OR 97301 503-986-4120 Message: 22 Date: Thu, 22 May 2008 16:00:10 + From: Monica Pisica [EMAIL PROTECTED] Subject: [R] Pros and Cons of R To: r-help@r-project.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=Windows-1252 Hi, I am doing a very informal presentation for my office about R capabilities to deal with and analyze spatial data, display data and maps, and connections with GIS. I've used in my presentation info from the CRAN, the spatial Task view, and the more striking graphics examples from http://addictedtor.free.fr/graphiques/thumbs.php and NCEAS http://www.nceas.ucsb.edu/scicomp/GISSeminar/UseCases/MapProdWithRGraphi cs/OneMapProdWithRGraphics.html together with examples of my own work. I am finishing with pros and cons about R and I am wondering if you can come up with other examples, or comments. Here they are: Pros: - R is a programming environment well suited for statistical analysis. - R is open source and cross platforms (Windows, Mac, Linux). - Fortran, C (C++), and Python wrappers are in place. - Deals well with spatial data, has a robust graphical interface and has an active user group list / forum. - External packages for R are almost daily increasing, most of them based on published up-to-date books and peer-reviewed articles. - R related books ? quite a few ?. Cons: - R has a very steep learning curve. - There is no perfect ?beginner? book. - Experience with other programming languages is a plus / minus. - You can save scripts, but not *.exe. - It is updated several times a year (good) but there are no up-grades. - It seems that it is hard to install correctly under Linux. - Everything you want to do is a command line, minimal GUI. - Memory management problems (depends on your OS), especially when displaying big images at high resolution or working with huge matrices (hundreds of Mb). Also i am wondering if R works under 64 bit computers and if it takes advantage of it. Thanks, Monica __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Percentages for categorical data by group
I appreciate all the help. The trouble is that in my real data set each group does not always have an observation that choose each response. This results in some of the rows returned from prop.table() to be shorter than others so I get: Warning message: In function (..., deparse.level = 1) : number of columns of result is not a multiple of vector length (arg 8) Is there a way to tell rbind() or do.call() to treat missing values as zero or make prop.table() include the zero proportions? On Fri, May 23, 2008 at 1:59 PM, Phil Spector [EMAIL PROTECTED] wrote: EG - Thanks for the reproducible example! When I run your code, and check the class of the result from tapply(), I see that it is an array, and using dim(), I see it's an array of length 500. How big is each element? table(sapply(res,length)) 5 500 So each piece is the same length. That means we could make a 500x5 matrix as follows: do.call(rbind,res) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley [EMAIL PROTECTED] [[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] Pros and Cons of R
Yes, but R is not a spectator sport and that is the beauty of it. GREGOR Brian J [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 05/23/2008 01:00 PM To r-help@r-project.org cc Subject Re: [R] Pros and Cons of R Monica, here are some other Pros to consider about R: 1) IMHO, the most important reason for using R is that expressed by John Chambers as the aim of the S language: to turn ideas into software, quickly and faithfully. The broad capabilities of R facilitate the integration of data maintenance and cleaning, exploratory data analysis, model estimation, model implementation, model calibration, model application, and the reporting and display of model outputs. This has tremendous productivity advantages. For example, I was able to meet a tight timeline for developing a regional land use model because R allowed me to easily move through the steps of model development from data analysis to implementation. I even found that I could do some geographical operations that could not be done using our GIS software. In addition, all of the model outputs (including a very many maps) were produced with R. Once you learn how to use R in this way, you will find it takes less time to program the outputs in R than to produce them in GIS. R yields productivity advantages in smaller ways too. We've developed a number of small applications to solve GIS or other problems that could not be solved as easily using other tools. Moreover, once they have been solved using R, the solutions are easily automated or recycled in other contexts. 2) R facilitates documentation and replication. Previous to using R, we did our data analysis and implemented our models in a variety of platforms. For example, Access, Excel, SPSS and Stata were all previously used in household survey data processing and analysis. This was a documentation nightmare. All the steps can be done using R instead and documentation can be easily included in the scripts. If care is taken to use good naming conventions that emphasize readability, the scripts can be largely self documenting. This also facilitates group work. Since we started using R in our work, we have been able to greatly increase our modeling capabilities and output with no increase in staffing. Brian Gregor, P.E. Senior Transportation Analyst Oregon Department of Transportation Transportation Planning Analysis Unit 555 13th Street NE Salem, OR 97301 503-986-4120 Message: 22 Date: Thu, 22 May 2008 16:00:10 + From: Monica Pisica [EMAIL PROTECTED] Subject: [R] Pros and Cons of R To: r-help@r-project.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=Windows-1252 Hi, I am doing a very informal presentation for my office about R capabilities to deal with and analyze spatial data, display data and maps, and connections with GIS. I've used in my presentation info from the CRAN, the spatial Task view, and the more striking graphics examples from http://addictedtor.free.fr/graphiques/thumbs.php and NCEAS http://www.nceas.ucsb.edu/scicomp/GISSeminar/UseCases/MapProdWithRGraphi cs/OneMapProdWithRGraphics.html together with examples of my own work. I am finishing with pros and cons about R and I am wondering if you can come up with other examples, or comments. Here they are: Pros: - R is a programming environment well suited for statistical analysis. - R is open source and cross platforms (Windows, Mac, Linux). - Fortran, C (C++), and Python wrappers are in place. - Deals well with spatial data, has a robust graphical interface and has an active user group list / forum. - External packages for R are almost daily increasing, most of them based on published up-to-date books and peer-reviewed articles. - R related books ? quite a few ?. Cons: - R has a very steep learning curve. - There is no perfect ?beginner? book. - Experience with other programming languages is a plus / minus. - You can save scripts, but not *.exe. - It is updated several times a year (good) but there are no up-grades. - It seems that it is hard to install correctly under Linux. - Everything you want to do is a command line, minimal GUI. - Memory management problems (depends on your OS), especially when displaying big images at high resolution or working with huge matrices (hundreds of Mb). Also i am wondering if R works under 64 bit computers and if it takes advantage of it. Thanks, Monica __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] 3D Area Diagram
--- Patrick Connolly [EMAIL PROTECTED] wrote: On Thu, 22-May-2008 at 03:13PM -0700, AlGates wrote: | The one I rather need, is something like this (scan from a book): | http://algates.de/Scan.jpg | The only difference is the angle. That one is even stranger. There are two similar (but not parallel) lines for imports and another two similar (but again not parallel) lines for exports. I think the question here is Does the graph show two lines or four lines of data? I think it probably onlyl shows two. The apparent two lines for imports and for exports is almost certainly chart junk. I can't see if there is anything systematic about those small differences, and I suspect that there was meant to be none -- just drawn by someone who didn't have a 45 deg set-square. Years ago I inherited some SPlus code which did, in fact, draw a plot quite similar to that one (but without the inaccuracies). I remember it was quite lengthy and complicated, but I don't remember ever having an inclination to use it for anything since R has so many easier and better ways of visualizing data. During the process of changing computer systems several times in the intervening years, that code was something that went out with the old faded photos. Shame that. Excel might have an option to do one like the import-export example. If it does, it would be a lot easier than using R which has an altogether different set of values. If Excel doesn't do that type, and it's *really* important to have such a plot, I'd be using grid graphics which is almost infinitely flexible. Only trouble is, by the time you'd seen what you can do with grid, you'd likely find that you no longer felt any urge to make such a plot. best -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Middle minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) . Anon ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Pros and Cons of R
I even carry a copy of R on a USB so that I can do a bit of work on a machine that does not have it installed. It's a bit slow and one would not want to do anything major with it but it's handy to show someone a quick graph or check something when far from the office. --- seanpor [EMAIL PROTECTED] wrote: Neil Shephard wrote: Another pro to consider is the cost, you can obtain R for free, SAS/S-Plus/Stata all have licenses of some sort that require purchasing. Neil Which has the side effect of *not* restricting how many machines are available for use or where; e.g. I was running big process a couple of different times with different scenarios, so I just fired up a few un-used machines and had them all running in parallel for the afternoon - no installation issues as I was able to run it off the network drive (windows as it happens). If I was licence restricted this would not have been possible. Similarly I can do analyses at home on any machine or even if I'm visiting somewhere else! Regards Sean __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Pros and Cons of R
GREGOR Brian J wrote: Monica, here are some other Pros to consider about R: snip 2) R facilitates documentation and replication. snip When I finally made the effort to learn how to make R packages, I experienced a substantial increase in my productivity. Before I start coding a new functions, I now write a help page including test cases in the examples. Each function is part of a package. After the code is complete, I check (and build and install) the package. If a change to function A breaks something in functionB, this usually exposes it fairly quickly. On average, I get working code much faster than I did previously. Moreover, when I'm done, I have (almost for free) a package that is reasonably well documented that I can easily share with others. This may not belong in a discussion to a group of people who may not develop new statistical procedures, but I believe it can help almost anyone who develops a procedure that will likely be used more than once or twice. Spencer R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Seeking help with trellis: log scales on xyplot
Good afternoon. The basic plot function can automatically generate log scales as follows: plot(calcium ~ soil_ph, log=y) Here is my basic model in xyplot... xyplot(calcium+magnesium ~ soil_ph|depth*region) I would like the calcium and magnesium values to be reported on a log scale. I have tried manipulating scales and yscale.components to no effect. Many thanks for your kind assistance, Hobie Perry US Forest Service St. Paul, MN -- View this message in context: http://www.nabble.com/Seeking-help-with-trellis%3A-log-scales-on-xyplot-tp17440074p17440074.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] Percentages for categorical data by group
prop.table(table(factor(x,levels=1:5))) Michael Conklin Chief Methodologist - Advanced Analytics MarketTools, Inc. 6465 Wayzata Blvd. Suite 170 Minneapolis, MN 55426 Tel: 952.417.4719 | Mobile:612.201.8978 [EMAIL PROTECTED] MarketTools(r)http://www.markettools.com This e-mail and any attachments may contain privileged, confidential or proprietary information. If you are not the intended recipient, be aware that any review, copying, or distribution of this e-mail or any attachment is strictly prohibited. If you have received this e-mail in error, please return it to the sender immediately, and permanently delete the original and any copies from your system. Thank you for your cooperation. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Economics Guy Sent: Friday, May 23, 2008 1:36 PM To: [EMAIL PROTECTED] Subject: Re: [R] Percentages for categorical data by group I appreciate all the help. The trouble is that in my real data set each group does not always have an observation that choose each response. This results in some of the rows returned from prop.table() to be shorter than others so I get: Warning message: In function (..., deparse.level = 1) : number of columns of result is not a multiple of vector length (arg 8) Is there a way to tell rbind() or do.call() to treat missing values as zero or make prop.table() include the zero proportions? On Fri, May 23, 2008 at 1:59 PM, Phil Spector [EMAIL PROTECTED] wrote: EG - Thanks for the reproducible example! When I run your code, and check the class of the result from tapply(), I see that it is an array, and using dim(), I see it's an array of length 500. How big is each element? table(sapply(res,length)) 5 500 So each piece is the same length. That means we could make a 500x5 matrix as follows: do.call(rbind,res) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley [EMAIL PROTECTED] [[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.
[R] Installing R on Linux is easy. (was Re: Pros and Cons of R)
On Thu, 22-May-2008 at 09:28PM +0200, Hans Ekbrand wrote: | On Thu, May 22, 2008 at 02:07:01PM -0400, R P Herrold wrote: | On Thu, 22 May 2008, Monica Pisica wrote: | | [...] | | When a new R version is in place you | cannot up-grade your old R version, you have to do a new | installation and re-load all the packages you used to have | and delete / un-install the old version | | ummm -- this is of course a function of the package manager | and operating system being used, and not of R intrinsicly; | under an RPM package manager, this issue is not present | | Neither under .deb based OS:es such as Ubuntu and Debian. I don't see in this discussion a mention of how easy it is to install R on Linux from source. The instructions are very clear and simple. With three simple steps, it's easy to install one version in the background while you're still using the previous one. With judicious arrangement of libraries, it's unnecessary to reinstall the packages every time you install a new version, and it's simple to have multiple versions of R on the same computer. I don't know how one would keep two or more versions of Genstat (say) on the same computer. If it is desired to update the packages, that's ridiculously simple also. -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_Middle minds discuss events (:_~*~_:)Small minds discuss people (_)-(_) . Anon ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] maximizing the gamma likelihood
for learning purposes and also to help someone, i used roger peng's document to get the mle's of the gamma where the gamma is defined as f(y_i) = (1/gammafunction(shape)) * (scale^shape) * (y_i^(shape-1)) * exp(-scale*y_i) ( i'm defining the scale as lambda rather than 1/lambda. various books define it differently ). i found the likelihood to be n*shape*log(scale) + (shape-1)*sum(log(y_i) - scale*sum(y_i) then i wrote below which is just roger peng's likelihood example but using the gamma instead of the normal. I get estimates back but i separately found that the analytical mle of the scale is equal to 1/ analytical mle(shape). and my estimates aren't consistent with that fact ? this leads me to assume that my estimates are not correct. can anyone tell me what i'm doing wrong. maybe my starting values are too far off ? thanks. make.negloglik - function(data, fixed=c(FALSE,FALSE)) { op - fixed function(p) { op[!fixed] - p shape - exp(op[1]) scale - exp(op[2]) a - length(data)*shape*log(scale) b - (shape-1)*sum(log(data)) c - -1.0*scale*sum(data) -(a + b + c) } } vsamples- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) nLL - make.negloglik(vsamples) temp - optim(c(scale=1,shape=1), nLL, method=BFGS)[[par]] estimates - log(temp) print(estimates) check - estimates[1]/mean(vsamples) print(check) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] exrpression(), double subscript
All, The first use of expression produces a double subscript while the second does not. I searched in ?plotmath and the archives and didn't find anything. I'm sure I'm missing something obvious but can't seem to find. any suggestions much appreciated. Cheers, David plot(1:10, 1:10) text(par(usr)[1] - .5, 5, adj = 1, labels = expression(hat(b)[11]), xpd = TRUE) text(par(usr)[1] - .5, 5, adj = 1, labels = expression(hat(b)[0i]), xpd = TRUE) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] van der Corput sequences
Alberto, I think the functions below do what you want: vanDerCorput(12,6) [1] 0.1667 0. 0.5000 0.6667 0.8333 0.0278 [7] 0.1944 0.3611 0.5278 0.6944 0.8611 0.0556 Regards, Carlos number2digits=function(n,base){ #first digit in output is the least significant digit=n%%base if (nbase) digit else c(digit,number2digits((n-digit)/base,base)) } digits2number=function(digits,base){ #first digit in input should be the most significant result=0 for (digit in digits) result=(base*result)+digit result } vanDerCorput=function(n,base=2){ #generate n first digits of the van der Corput sequence output=NA*1:n for(i in 1:n){ digits=number2digits(i,base) output[i]=digits2number(digits,base)/base^length(digits) } output } - In package fOptions, there are functions that generate Halton sequences. The van der Corput sequence for base 2 is a particular case of the Halton sequence generated by: n - 8 # anything here... x - runif.halton(n, 1) In fact, x - runif.halton(n, dim) will generate the van der Corput sequences for the base b as the i-th prime number in x[,i]. (in other words, if I want the van der Corput sequence for base b = 5, I do x - runif.halton(n, 3) and take x[,3]). However, it's possible to have van der Corput sequences for non-prime basis, like (for b = 10): 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.01, 0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81, 0.91, 0.02, 0.12, 0.22, 0.32, Is there any R function that generates those sequences? Alberto Monteiro __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] dividing the data
hello, I have data of individuals; with their age and other infromation. Each row corresponds to a single individual. I would like to divide the data and store them into two files. one file with people less than 50 years of age and the other with people more than 50 years of age. I am new into R and I appreciate if someone can help. thanks -- View this message in context: http://www.nabble.com/dividing-the-data-tp17441398p17441398.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] SVD on a matix
Hi All, I performed an svd on a matrix X and saved the first three column of the left singular matrix U. ( I assume that they correspond to the projection of the matrix on the first three eigen vectors that corresponds to the first three largest eigenvalues). I would like to know how much variance is explained by the first eigenvectors? how can I find that. Thanks for your help -- View this message in context: http://www.nabble.com/SVD-on-a-matix-tp17441337p17441337.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] dividing the data
On 05/23/08 14:34, kayj wrote: hello, I have data of individuals; with their age and other infromation. Each row corresponds to a single individual. I would like to divide the data and store them into two files. one file with people less than 50 years of age and the other with people more than 50 years of age. Assuming you have your data in a dataframe x with one column called age (get the data into R e.g. with read.csv) young - x[x$age 50,] write.table(young,file=young.txt) etc. m. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Shared Library Error
Can anyone help me resolve this? A part of the R function looks like this: print(is.loaded('merge_xtabs_patterns_file')) print(is.loaded('merge_xtabs_patterns_file_')) .Fortran('merge_xtabs_patterns_file_',ydim[1],ydim[2],x=as.integer(as.matrix(y)),na=as.integer(c), maxD=as.integer(maxD),lrowmem=length(rowmem),rowmem=as.integer(rowmem), sequential=as.integer(Sequential),nclust=as.integer(nclust)) The corresponding output: [1] FALSE [1] TRUE Error in .Fortran(merge_xtabs_patterns_file_, ydim[1], ydim[2], x = as.integer(as.matrix(y)), : Fortran symbol name merge_xtabs_patterns_file_ not in load table Why is it that I get a TRUE for is.loaded with the same symbol, but when using that under .Fortran I get the above error? I also tried replacing the third line with the following (removing the last underscore from the symbol name): .Fortran('merge_xtabs_patterns_file',ydim[1],ydim[2],x=as.integer(as.matrix(y)),na=as.integer(c), maxD=as.integer(maxD),lrowmem=length(rowmem),rowmem=as.integer(rowmem), sequential=as.integer(Sequential),nclust=as.integer(nclust)) The corresponding error: Error in .Fortran(merge_xtabs_patterns_file, ydim[1], ydim[2], x = as.integer(as.matrix(y)), : Fortran symbol name merge_xtabs_patterns_file not in load table Can anyone help? Thanks, A [[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] Seeking help with trellis: log scales on xyplot
On 5/23/08, hobie perry [EMAIL PROTECTED] wrote: Good afternoon. The basic plot function can automatically generate log scales as follows: plot(calcium ~ soil_ph, log=y) Here is my basic model in xyplot... xyplot(calcium+magnesium ~ soil_ph|depth*region) I would like the calcium and magnesium values to be reported on a log scale. I have tried manipulating scales and yscale.components to no effect. Try something like xyplot(calcium+magnesium ~ soil_ph|depth*region, scales = list(y = list(log = 2))) -Deepayan __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] exrpression(), double subscript
Not sure what you mean by double subscript. 11 is the number eleven and that is what is shown, as expected. 0i is the complex number 0+0i (type it at your console), and that is what is shown. Does that solve the mystery? Maybe try it with 11i as the subscript to help you see it. -- Bert Gunter Genentech -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Afshartous, David Sent: Friday, May 23, 2008 2:43 PM To: r-help@r-project.org Subject: [R] exrpression(), double subscript All, The first use of expression produces a double subscript while the second does not. I searched in ?plotmath and the archives and didn't find anything. I'm sure I'm missing something obvious but can't seem to find. any suggestions much appreciated. Cheers, David plot(1:10, 1:10) text(par(usr)[1] - .5, 5, adj = 1, labels = expression(hat(b)[11]), xpd = TRUE) text(par(usr)[1] - .5, 5, adj = 1, labels = expression(hat(b)[0i]), xpd = TRUE) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Spatial Overlay - SQL - Geoprocessing
Can we by any change perform in R something similar geoprocessing or, more advanced, Spatial SQL over vectorial data? Paulo [[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 pass variable of for loop on read table text
?paste paste('text',y,'.txt', sep=) and you likely need data[[y]] instead of data$y. On May 23, 2008, at 9:05 PM, Jason Lee wrote: Hi, I have a couple of text and would like to automate of reading these multiple files using (namely; text1.txt, text2.txt) for(y in 3:10){ data$y-read.table('text$y.txt')} But it seems not allow. Any idea? Thanks. [[alternative HTML version deleted]] Haris Skiadas Department of Mathematics and Computer Science Hanover College __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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 pass variable of for loop on read table text
maybe this should also be a FAQ because i've seen it a lot since I've been on this list ? assign each data.frame to a component of a list, rather than to a component of a dataframe. you also need paste to get the number. listDFs-list() for ( y in 3:10 ) { listDFs[[y]]-read.table(paste(text1,y,sep=),header=TRUE if there are headings, whateverelse) } listDFs[[1]] will then contain the first data frame, listDFs[[2]] the second etc. On Fri, May 23, 2008 at 9:05 PM, Jason Lee wrote: Hi, I have a couple of text and would like to automate of reading these multiple files using (namely; text1.txt, text2.txt) for(y in 3:10){ data$y-read.table('text$y.txt')} But it seems not allow. Any idea? Thanks. [[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] Colspan rowspan
latex in Hmisc can do that with the n.cgroup= and n.rgroup= args although if your tables are getting very complicated you might be best off just generating the latex yourself since then you get all the flexibility of latex. On Fri, May 23, 2008 at 1:26 PM, Arshavir [EMAIL PROTECTED] wrote: Hi, What's the best way to build tables with multiple sets of column/row headings, each spanning 1 or more cols/rows, similar to the colspan/rowspan options in HTML. I am using Sweave but couldn't find an option to do this in xtable. I can obviously build it by hand, just wanted to make sure there wasn't an easier way. Thanks. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Importing data in text file into R
Dear all, I am quite new to R; facing certain problems: Say, I have a text file( named as try): YearC1 C2 C3 C4 C5 C6 Y1 3.5 13.89.5 6.8 0.4 24.2 Y2 3.8 13.99.9 7.6 0.7 12.8 Y3 4.5 14.514.29.2 0.6 14.5 Y4 5.9 16.224.612.70.2 24.3 Y5 7.2 20.440.618.20.8 28.2 Y6 5.9 18.637.414.50.3 36.9 Y7 8.0 16.188.624.10.1 34.6 Y8 13.621.156.319.00.7 33.3 I wish to import the file into R and make certain computations, like intercorrelation matrix. I tried the following syntax: # Inputting the data file (saved in text format) df=trial.txt idt=read.table(df,header=T, sep=\t) idt # To generate intercorrelatio matrix r = cor(idt) r=round(r, 4) r The seems to have been read, but further computations not made, with the following output: # Inputting the data file (saved in text format) df=trial.txt idt=read.table(df,header=T, sep=\t) idt Year C1 C2 C3 C4 C5 C6 1 Y1 3.5 13.8 9.5 6.8 0.4 24.2 2 Y2 3.8 13.9 9.9 7.6 0.7 12.8 3 Y3 4.5 14.5 14.2 9.2 0.6 14.5 4 Y4 5.9 16.2 24.6 12.7 0.2 24.3 5 Y5 7.2 20.4 40.6 18.2 0.8 28.2 6 Y6 5.9 18.6 37.4 14.5 0.3 36.9 7 Y7 8.0 16.1 88.6 24.1 0.1 34.6 8 Y8 13.6 21.1 56.3 19.0 0.7 33.3 # To generate intercorrelatio matrix r = cor(idt) Error in cor(idt) : missing observations in cov/cor In addition: Warning message: In cor(idt) : NAs introduced by coercion r=round(r, 4) Error: object r not found r Error: object r not found Kindly advise me as to how to get rid of the error message. AJSS __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Importing data in text file into R
Dear AJSS, The problem is that the way you've read the data, the first column of the data frame is a factor, not a numerical variable, and thus is not suitable for computing correlations. You could use the command cor(idt[,-1]) to compute correlations on all but the first column, but your intention was probably to use the first column of the input file for row names, not as a variable. One way to do this is simply to omit the variable name Year in the first row of the input data file. I hope this helps, John On 23-May-08, at 11:40 PM, amarjit singh sethi wrote: Dear all, I am quite new to R; facing certain problems: Say, I have a text file( named as try): YearC1 C2 C3 C4 C5 C6 Y1 3.5 13.89.5 6.8 0.4 24.2 Y2 3.8 13.99.9 7.6 0.7 12.8 Y3 4.5 14.514.29.2 0.6 14.5 Y4 5.9 16.224.612.70.2 24.3 Y5 7.2 20.440.618.20.8 28.2 Y6 5.9 18.637.414.50.3 36.9 Y7 8.0 16.188.624.10.1 34.6 Y8 13.621.156.319.00.7 33.3 I wish to import the file into R and make certain computations, like intercorrelation matrix. I tried the following syntax: # Inputting the data file (saved in text format) df=trial.txt idt=read.table(df,header=T, sep=\t) idt # To generate intercorrelatio matrix r = cor(idt) r=round(r, 4) r The seems to have been read, but further computations not made, with the following output: # Inputting the data file (saved in text format) df=trial.txt idt=read.table(df,header=T, sep=\t) idt Year C1 C2 C3 C4 C5 C6 1 Y1 3.5 13.8 9.5 6.8 0.4 24.2 2 Y2 3.8 13.9 9.9 7.6 0.7 12.8 3 Y3 4.5 14.5 14.2 9.2 0.6 14.5 4 Y4 5.9 16.2 24.6 12.7 0.2 24.3 5 Y5 7.2 20.4 40.6 18.2 0.8 28.2 6 Y6 5.9 18.6 37.4 14.5 0.3 36.9 7 Y7 8.0 16.1 88.6 24.1 0.1 34.6 8 Y8 13.6 21.1 56.3 19.0 0.7 33.3 # To generate intercorrelatio matrix r = cor(idt) Error in cor(idt) : missing observations in cov/cor In addition: Warning message: In cor(idt) : NAs introduced by coercion r=round(r, 4) Error: object r not found r Error: object r not found Kindly advise me as to how to get rid of the error message. AJSS __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Importing data in text file into R
On Fri, 23-May-2008 at 08:40PM -0700, amarjit singh sethi wrote: | Dear all, | I am quite new to R; facing certain problems: | Say, I have a text file( named as try): | idt=read.table(df,header=T, sep=\t) | idt | Year C1 C2 C3 C4 C5 C6 | 1 Y1 3.5 13.8 9.5 6.8 0.4 24.2 | 2 Y2 3.8 13.9 9.9 7.6 0.7 12.8 | 3 Y3 4.5 14.5 14.2 9.2 0.6 14.5 | 4 Y4 5.9 16.2 24.6 12.7 0.2 24.3 | 5 Y5 7.2 20.4 40.6 18.2 0.8 28.2 | 6 Y6 5.9 18.6 37.4 14.5 0.3 36.9 | 7 Y7 8.0 16.1 88.6 24.1 0.1 34.6 | 8 Y8 13.6 21.1 56.3 19.0 0.7 33.3 | # To generate intercorrelatio matrix | r = cor(idt) | Error in cor(idt) : missing observations in cov/cor | In addition: Warning message: | In cor(idt) : NAs introduced by coercion The help file for cor says this about x and y: x: a numeric vector, matrix or data frame. y: 'NULL' (default) or a vector, matrix or data frame with compatible dimensions to 'x'. The default is equivalent to 'y = x' (but more efficient). Your x isn't a numeric vector, matrix or data frame. x[,-1] is, and that might give what you want, but read the rest of the help file to determine if that's what you want it to do. Having rownames on your dataframe might help seeing what is happening. The easiest way I can see to get row names is in your read.table line. Add row.names = 1. HTH -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_Middle minds discuss events (:_~*~_:)Small minds discuss people (_)-(_) . Anon ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.