Re: [R] R in Industry
Matthew Keller wrote: Far from flaming you, I think you made a good point - one that I imagine most people who use R have come across. The name R is a big impediment to effective online searches. As a check, I entered R software, SAS software, SPSS software, and S+ software into google. The R 'hit rate' was only ten out of the first 20 results (I didn't look any further). For the other three software packages, the hit rates were all 100% (20/20). I do wonder if anything can/should be done about this. I generally search using the term CRAN but of course, that omits lots of stuff relevant to R. Any ideas about how to do effective online searches for R related materials? Try r stats. I get 18/20 on Google with that. Jim __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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 construct a cov list to use a covariance matrix in factanal?
We still do not have reproducible code, but a 'dataframe' is not a matrix. And I would expect a covariance matrix to have the same row and column names: the examples do. On Wed, 7 Feb 2007, Alistair Campbell wrote: Thanks for that Brian, I have worked through the examples. They work because the covmat were produced by the cov.wt which provides output as a list object. I am trying to construct my own list object to use as the covmat. There are no obvious instructions on how to do this. Well, the instructions to follow cov.wt seem obvious to me, and as I have said before, covariance matrices also work. So, here is what I have done so far. I reconstructed the covariance matrix in the example and created a dataframe: testmatrix general picture blocks maze reading vocab 1 24.641 5.991 33.520 6.023 20.755 29.701 2 5.991 6.700 18.137 1.782 4.936 7.204 3 33.520 18.137 149.831 19.424 31.430 50.753 4 6.023 1.782 19.424 12.711 4.757 9.075 5 20.755 4.936 31.430 4.757 52.604 66.762 6 29.701 7.204 50.753 9.075 66.762 135.292 and then used this to construct a list object like the output from the example; tstcov- list(cov=testmatrix, center=c(0,0,0,0,0), n.obs=112) I tested to see whether my list object looked like the examples tstcov $cov general picture blocks maze reading vocab 1 24.641 5.991 33.520 6.023 20.755 29.701 2 5.991 6.700 18.137 1.782 4.936 7.204 3 33.520 18.137 149.831 19.424 31.430 50.753 4 6.023 1.782 19.424 12.711 4.757 9.075 5 20.755 4.936 31.430 4.757 52.604 66.762 6 29.701 7.204 50.753 9.075 66.762 135.292 $centers [1] 0 0 0 0 0 $n.obs [1] 112 It looks the same. So I then used this list as the argument in factanal and get the error message. factanal(factors=2, covmat=tstcov, rotation=varimax) Error in sqrt(diag(cv)) : Non-numeric argument to mathematical function I know that what you see of a list is not necessarily all that is there. So, I figure I am missing some part of the object that makes this list suitable for use by factanal. So, I hope this is enough detail. Any thoughts would be appreciated. -- 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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] problems installing R on Linux
Hi everyone, I am having installation problems, but this is how it all started: I had some errors running the bioconductor package affyPLM that uses LAPACK/Blas Pset - fitPLM(Data) Background correcting PM Normalizing PM Fitting models /usr/local/lib/R/bin/exec/R: relocation error: /usr/local/lib/R/lib/libRlapack.so: undefined symbol: s_copy # thrown out of R I was using R version 2.4.0, so I decided to upgrade to 2.4.1 (on i686-pc-linux-gnu) and to try various configuration options : default, '--with -lapack' and '--with-blas=lacml', as described in appendix A of the Installation and Admin manual. Everytime I configure and make, the message streams seem clean. But the 'make check' is always a disaster (see below), and if I make install regardless of the make check errors, I get the same relocation error from fitPLM as above (of course the appropriate BioC packages were installed too). I believe my problems are dealt with in Appendix A of the Installation and Administration Guide, but I can't seem to resolve them. Indeed, I have never been able to use png() for graphics because of some unresolved issues concerning access to the X11 graphics device, which I suspected had to do with the libpng and zlib programs (also mentioned in Appendix A). Some of the postings that I have read on this forum seem to imply that installation problems are sometimes due to old versions of zlib. I don't understand this since the recent zlib (1.2.3) is in /usr/local/lib/R-2.4.1/src/extra/zlib. Appendix A says, referring to zlib, that the versions in the R sources will be compiled in. But just to be sure, I verified that my system's version is old : rpm -q zlib zlib-1.1.3-25.7 I downloaded and tried to install zlib-1.2.3 using tar, configure, make, make test, and make install. But when I type rpm -q zlib, I am still informed that my version is zlib-1.1.3-25.7. So, still hopeful, I thought that I instead would use rpm to install zlib; I found an intermediate rpm zlib version 1.2.1.2-1.2 and tried rpm -Uhv zlib-1.2.1.2-1.2.src.rpm. No diagnostics appear, but when I type rpm -q zlib, my version is still zlib-1.1.3-25.7. I tried to uninstall the old zlib using rpm -e zlib, but rpm refuses, saying that there are too many dependencies... Does anyone have any suggestions? Thanks! The 'make check' disaster : make[1]: Entering directory `/usr/local/lib/R-2.4.1/tests' make[2]: Entering directory `/usr/local/lib/R-2.4.1/tests' make[3]: Entering directory `/usr/local/lib/R-2.4.1/tests/Examples' make[4]: Entering directory `/usr/local/lib/R-2.4.1/tests/Examples' make[4]: Leaving directory `/usr/local/lib/R-2.4.1/tests/Examples' make[4]: Entering directory `/usr/local/lib/R-2.4.1/tests/Examples' collecting examples for package 'base' ... make[5]: Entering directory `/usr/local/lib/R-2.4.1/src/library' Building/Updating help pages for package 'base' Formats: text html latex example make[5]: Leaving directory `/usr/local/lib/R-2.4.1/src/library' running code in 'base-Ex.R' ...make[4]: *** [base-Ex.Rout] Error 1 make[4]: Leaving directory `/usr/local/lib/R-2.4.1/tests/Examples' make[3]: *** [test-Examples-Base] Error 2 make[3]: Leaving directory `/usr/local/lib/R-2.4.1/tests/Examples' make[2]: *** [test-Examples] Error 2 make[2]: Leaving directory `/usr/local/lib/R-2.4.1/tests' make[1]: *** [test-all-basics] Error 1 make[1]: Leaving directory `/usr/local/lib/R-2.4.1/tests' make: *** [check] Error 2 I don't really *know* if the configure results are clean. Here is a subset of the configure results (that may be suspect) : checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu . . . checking for cblas_cdotu_sub in vecLib framework... no checking iconv.h usability... yes checking iconv.h presence... yes checking for iconv.h... yes checking for iconv... yes checking whether iconv() accepts UTF-8, latin1 and UCS-*... yes checking for iconvlist... no . . . checking for g77... g77 checking whether we are using the GNU Fortran 77 compiler... yes checking whether g77 accepts -g... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C++ preprocessor... g++ -E checking whether __attribute__((visibility())) is supported... no checking whether gcc accepts -fvisibility... no checking whether g77 accepts -fvisibility... no . . . checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no . . .
[R] Any Limitations for the dataframes?
Hi R, Are there any limitations on the capacity of the data to hold for R data frames or zoo objects? I mean to ask are there any restrictions on the number of rows or column in the R data frames or the zoo objects? Thank you, Shubha [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Convert Class numeric to class lm
Dear R-Users, Background: I have five multiple imputed datasets. For each datasets I have run a regression analysis and combined the regression coefficients according to Rubin (1987) rule. Problem: Now I want to use these combined regression coefficients on a different dataset (with the same variable names but different values) and check how good they can predict my dependent variable. Normally, it would use the predict.lm function which requires an object of class lm. But my combined regression coefficients are an object of class numeric. Therefore, I need to know how to convert an object of class numeric to a class lm. For any suggestion thanks in advance, Simon [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] problems installing R on Linux
We don't know what 'Linux' is here. What Linux distribution, what are your C and Fortran compilers (in detail, e.g. from gcc --version and g77 --version)? We need to see the tail of tests/Examples/base-Ex.Rout.fail to know what went wrong. If you can supply those pieces of information we can begin to help. (But zlib is a red herring: at most it affects the png() device.) On Wed, 7 Feb 2007, Rebecca wrote: Hi everyone, I am having installation problems, but this is how it all started: I had some errors running the bioconductor package affyPLM that uses LAPACK/Blas Pset - fitPLM(Data) Background correcting PM Normalizing PM Fitting models /usr/local/lib/R/bin/exec/R: relocation error: /usr/local/lib/R/lib/libRlapack.so: undefined symbol: s_copy # thrown out of R I was using R version 2.4.0, so I decided to upgrade to 2.4.1 (on i686-pc-linux-gnu) and to try various configuration options : default, '--with -lapack' and '--with-blas=lacml', as described in appendix A of the Installation and Admin manual. Everytime I configure and make, the message streams seem clean. But the 'make check' is always a disaster (see below), and if I make install regardless of the make check errors, I get the same relocation error from fitPLM as above (of course the appropriate BioC packages were installed too). I believe my problems are dealt with in Appendix A of the Installation and Administration Guide, but I can't seem to resolve them. Indeed, I have never been able to use png() for graphics because of some unresolved issues concerning access to the X11 graphics device, which I suspected had to do with the libpng and zlib programs (also mentioned in Appendix A). Some of the postings that I have read on this forum seem to imply that installation problems are sometimes due to old versions of zlib. I don't understand this since the recent zlib (1.2.3) is in /usr/local/lib/R-2.4.1/src/extra/zlib. Appendix A says, referring to zlib, that the versions in the R sources will be compiled in. But just to be sure, I verified that my system's version is old : rpm -q zlib zlib-1.1.3-25.7 I downloaded and tried to install zlib-1.2.3 using tar, configure, make, make test, and make install. But when I type rpm -q zlib, I am still informed that my version is zlib-1.1.3-25.7. So, still hopeful, I thought that I instead would use rpm to install zlib; I found an intermediate rpm zlib version 1.2.1.2-1.2 and tried rpm -Uhv zlib-1.2.1.2-1.2.src.rpm. No diagnostics appear, but when I type rpm -q zlib, my version is still zlib-1.1.3-25.7. I tried to uninstall the old zlib using rpm -e zlib, but rpm refuses, saying that there are too many dependencies... Does anyone have any suggestions? Thanks! The 'make check' disaster : make[1]: Entering directory `/usr/local/lib/R-2.4.1/tests' make[2]: Entering directory `/usr/local/lib/R-2.4.1/tests' make[3]: Entering directory `/usr/local/lib/R-2.4.1/tests/Examples' make[4]: Entering directory `/usr/local/lib/R-2.4.1/tests/Examples' make[4]: Leaving directory `/usr/local/lib/R-2.4.1/tests/Examples' make[4]: Entering directory `/usr/local/lib/R-2.4.1/tests/Examples' collecting examples for package 'base' ... make[5]: Entering directory `/usr/local/lib/R-2.4.1/src/library' Building/Updating help pages for package 'base' Formats: text html latex example make[5]: Leaving directory `/usr/local/lib/R-2.4.1/src/library' running code in 'base-Ex.R' ...make[4]: *** [base-Ex.Rout] Error 1 make[4]: Leaving directory `/usr/local/lib/R-2.4.1/tests/Examples' make[3]: *** [test-Examples-Base] Error 2 make[3]: Leaving directory `/usr/local/lib/R-2.4.1/tests/Examples' make[2]: *** [test-Examples] Error 2 make[2]: Leaving directory `/usr/local/lib/R-2.4.1/tests' make[1]: *** [test-all-basics] Error 1 make[1]: Leaving directory `/usr/local/lib/R-2.4.1/tests' make: *** [check] Error 2 I don't really *know* if the configure results are clean. Here is a subset of the configure results (that may be suspect) : checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu . . . checking for cblas_cdotu_sub in vecLib framework... no checking iconv.h usability... yes checking iconv.h presence... yes checking for iconv.h... yes checking for iconv... yes checking whether iconv() accepts UTF-8, latin1 and UCS-*... yes checking for iconvlist... no . . . checking for g77... g77 checking whether we are using the GNU Fortran 77 compiler... yes checking whether g77 accepts -g... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C++
[R] about compile the R 2.4.1 sources
When I run ./configure ,I got the message: configure: WARNING: you cannot build info or html versions of the R manuals. What's the matter? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R in Industry
Kuhn, Max wrote: As someone who has (reluctantly) sent job postings to R Help, I think that a SIG would be a good idea. Max Hi all, My personnal experience also shows that it is difficult to find a job where R is a key component, find R related material, or find companies that would do commercial support for R or R consulting. (BTW, we [1] do). A R-sig-job list has been proposed on the past, and I still think it is a good idea. An other point is that if it is too hard finding material using the regular tools (google, ...), let's just not use them, last week a new R-focused search engine [2] was created, let's just make sure it searches on the right places. Alternatively, the R wiki [3] can be (and is already) use to advertise for jobs [4]. [1] http://www.mango-solutions.com [2] http://www.rseek.org [3] http://wiki.r-project.org [4] http://wiki.r-project.org?id=links:jobs Cheers, Romain -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold Sent: Tuesday, February 06, 2007 2:08 PM To: R-help@stat.math.ethz.ch Subject: [R] R in Industry The other day, CNN had a story on working at Google. Out of curiosity, I went to the Google employment web site (I'm not looking, but just curious). In perusing their job posts for statisticians, preference is given to those who use R and python. Other languages, S-Plus and something called SAS were listed as lower priorities. When I started using Python, I noted they have a portion of the web site with job postings. CRAN does not have something similar, but think it might be useful. I think R is becoming more widely used in industry and I wonder if helping it move along a bit, the maintainer of CRAN could create a section of the web site devoted to jobs where R is a requirement. Hence, we could have our own little monster.com kind of thing going on. Of the multitude of ways the gospel can be spread, this is small. But, I think every small step forward is good. Anyone think this is useful? Harold -- Mango Solutions Tel +44 1249 467 467 Fax +44 1249 467 468 Mob +44 7813 526 123 data analysis that delivers R Site Search extension for firefox http://addictedtor.free.fr/rsitesearch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] about compile the R 2.4.1 sources
On Wed, 7 Feb 2007, xiaopeng hu wrote: When I run ./configure ,I got the message: configure: WARNING: you cannot build info or html versions of the R manuals. What's the matter? Search for info in the R Installation and Administration manual: http://cran.r-project.org/doc/manuals/R-admin.html You will not be able to build the info files unless you have makeinfo version 4.7 or later installed. Reading the manual usually helps - saying what platform you are trying to build on also helps, here the platform will guide you to the appropriate sections of the manual. I expect that you will usually want access to these formats of the help pages. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Convert Class numeric to class lm
Simon P. Kempf wrote: Background: I have five multiple imputed datasets. For each datasets I have run a regression analysis and combined the regression coefficients according to Rubin (1987) rule. So, now you have two numeric values: slope and offset. Right? Simon P. Kempf wrote: Now I want to use these combined regression coefficients on a different dataset (with the same variable names but different values) and check how good they can predict my dependent variable. Normally, it would use the predict.lm function which requires an object of class lm. But my combined regression coefficients are an object of class numeric. Therefore, I need to know how to convert an object of class numeric to a class lm. Given numeric values above, I would use multiplication and addition operations on them and new data. Try to explore the structure of instances of these classes with str(). You will see that an object of class lm is a list with several components (12 afair). One of them is coefficients. You can also construct this object manually from scratch and use predict.lm(), however, you must correctly create all list elements used by this function. Typing predict.lm in R console will show you the body of this function. Don't forget to assign the attribute class. RSiteSearch(construct lm) will take you here: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/32782.html -- View this message in context: http://www.nabble.com/-R--Convert-Class-%22numeric%22-to-class-%22lm-tf3185677.html#a8842534 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R Search
The official R Search place has been http://search.R-project.org/ for quite a while now. It does mention others including 'rseek' below. BTW: It's main fault for me is that it does not include the R-devel mailing list archives (hint hint :-) Martin Maechler, ETH Zurich IM == İbrahim Mutlay [EMAIL PROTECTED] on Wed, 7 Feb 2007 02:44:24 -0500 writes: IM I know that two of the search engine for R is available: IM http://www.rseek.org/ IM http://www.dangoldstein.com/search_r.html IM -- �brahim Mutlay __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] when i run ./configure,i meet a problem
i get a message: configure: WARNING: you cannot build info or html versions of the R manuals what should i do ? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R in Industry
Conversely, unqualified(*) candidates are nearly guaranteed to find support scarce here. More seriously, free job boards, highly targeted like the one proposed do seem to get enough traffic to make it worth the effort to post there. One example serving the US market for market research is here: http://quirks.com/jobmart/search.asp Heck, it could even become a revenue resource for the R Project foundation if members and supporting institutions got little gold stars with their postings or some such. Eric * Defined as Unable to follow posting guidelines. Bert Gunter wrote: ... two main drawbacks of R at our firm (as viewed by our IT dept) are lack of guaranteed support as well as the difficulty in finding candidates. -- Just an aside: lack of guaranteed support -- absolutely true in theory, absolutely false in practice. I doubt that the voluntary support found on r-help and other R lists can be matched by the guaranteed support of any commercial software product. Not that this makes a difference to the IT group's requirements, of course... Cheers, Bert __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Data management problem (reorder rows in dataframe by text flag)
Given two columns of type character in a dataframe of the form: col1col2 31* 66 0 0* 102*66 71* 80 31 2* 66 31* 47 38* How do I generate the following dataframe? Ie. col1 contains row item with * and col2 contains row member without * col1col2 31 66 0 0 102 66 71 80 2 31 31 66 38 47 Partial ideas thus far grep(*,col1,fixed=T) as.numeric(gsub(*,,col1)) Thanks. --Dale __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R in Industry
Matthew Keller wrote: Bob, Far from flaming you, I think you made a good point - one that I imagine most people who use R have come across. The name R is a big impediment to effective online searches. As a check, I entered R software, SAS software, SPSS software, and S+ software into google. The R 'hit rate' was only ten out of the first 20 results (I didn't look any further). For the other three software packages, the hit rates were all 100% (20/20). I do wonder if anything can/should be done about this. I generally search using the term CRAN but of course, that omits lots of stuff relevant to R. Any ideas about how to do effective online searches for R related materials? Matt I just googled for R and www.r-project.org was the first hit. Don't see a problem at present. Frank On 2/6/07, Wensui Liu [EMAIL PROTECTED] wrote: I've been looking for job that allows me to use R/S+ since I got out of graduate school 2 years ago but with no success. I am wondering if there is something that can be done to promote the use of R in industry. It's been very frustrating to see people doing statistics using excel/spss and even more frustrating to see people paying $$$ for something much inferior to R. On 2/6/07, Doran, Harold [EMAIL PROTECTED] wrote: The other day, CNN had a story on working at Google. Out of curiosity, I went to the Google employment web site (I'm not looking, but just curious). In perusing their job posts for statisticians, preference is given to those who use R and python. Other languages, S-Plus and something called SAS were listed as lower priorities. When I started using Python, I noted they have a portion of the web site with job postings. CRAN does not have something similar, but think it might be useful. I think R is becoming more widely used in industry and I wonder if helping it move along a bit, the maintainer of CRAN could create a section of the web site devoted to jobs where R is a requirement. Hence, we could have our own little monster.com kind of thing going on. Of the multitude of ways the gospel can be spread, this is small. But, I think every small step forward is good. Anyone think this is useful? Harold [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- WenSui Liu A lousy statistician who happens to know a little programming (http://spaces.msn.com/statcompute/blog) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R Search
Thank you Martin On 2/7/07, Martin Maechler [EMAIL PROTECTED] wrote: The official R Search place has been http://search.R-project.org/ for quite a while now. It does mention others including 'rseek' below. BTW: It's main fault for me is that it does not include the R-devel mailing list archives (hint hint :-) Martin Maechler, ETH Zurich IM == ðbrahim Mutlay [EMAIL PROTECTED] on Wed, 7 Feb 2007 02:44:24 -0500 writes: IM I know that two of the search engine for R is available: IM http://www.rseek.org/ IM http://www.dangoldstein.com/search_r.html IM -- Ãbrahim Mutlay -- Ä°brahim Mutlay [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] problems installing R on Linux
Hi, in general Prof. Ripley is right that more information is needed, but here's a hint that you might try first. /usr/local/lib/R/bin/exec/R: relocation error: /usr/local/lib/R/lib/libRlapack.so: undefined symbol: s_copy # thrown out of R Could simply mean that the /usr/local/lib/R/lib/libRlapack.so is not found, and considering that you say make was alright, then maybe it was make install that did not copy it. But what you can try, try running R from the directory where you compiled it in: get a fresh R tarball, untar it. configure it with ./configure --prefix=`pwd` and do make. Do not do make install, simply run it from the bin dir here. You might need to install the packages though if they are not in R_LIBS. This will ensure that all files are there, nothing was left behind by make install. rpm -q zlib zlib-1.1.3-25.7 After you installed zlib with ./configure make make install, your rpm request will not give you the just installed zlib version because it refers to a different source. If by doing make install you overwrite the files from zlib*.rpm, it will still report the version written in the rpm database. And you cannot uninstall this rpm without braking half of your system dependencies. Best, Oleg -- Dr Oleg Sklyar | EBI-EMBL, Cambridge CB10 1SD, UK | +44-1223-494466 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Data management problem (reorder rows in dataframe by text flag)
how about: t.d - data.frame(col1=c(31*,0,102*,71*,31,66,47), col2=c(66,0*,66,80,2*,31*,38*), stringsAsFactors = FALSE) t.x - apply(t.d,1,function(x) x[order(unlist(x)==grep(\\*$, unlist(x),value=TRUE))]) t.d2 - data.frame(col1=t.x[1,],col2=sub(\\*$,,t.x[2,])) greets christian -- Christian Bieli, project assistant Institute of Social and Preventive Medicine University of Basel, Switzerland Steinengraben 49 CH-4051 Basel Tel.: +41 61 270 22 12 Fax: +41 61 270 22 25 [EMAIL PROTECTED] www.ispm-unibasel.ch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] when i run ./configure,i meet a problem
xiaopeng hu [EMAIL PROTECTED] writes: i get a message: configure: WARNING: you cannot build info or html versions of the R manuals what should i do ? In principle: * Use R-devel not R-help * Read the Installation and Administration manual (sec.2.2) However, the gist is that you are missing the makeinfo program, so either install it (usually, it is part of the texinfo package) or live without manuals in those formats... -- 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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] when i run ./configure,i meet a problem
xiaopeng hu [EMAIL PROTECTED] writes: i get a message: configure: WARNING: you cannot build info or html versions of the R manuals what should i do ? In principle: * Use R-devel not R-help * Read the Installation and Administration manual (sec.2.2) However, the gist is that you are missing the makeinfo program, so either install it (usually, it is part of the texinfo package) or live without manuals in those formats... -- 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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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 statistics in ggplot
Hi Vikas, Exactly what do you want to label them with? Generally the purpose of the plot is to avoid having explicit labels - you can just read the numbers of the axes. If you want the exact numbers, presenting them in a table might be more appropriate. I'm not at my development computer at the moment, so I can't give you the exact details, but you will have to calculate the statistics yourself (using the weighted boxplot function in ggplot) and add them to the plot in some way. This should be a bit easier in the next version of ggplot, where the calculation and display are a little more distinct. Hadley On 2/7/07, Vikas Rawal [EMAIL PROTECTED] wrote: I need to make weighted boxplots. I found that ggplot makes them. I would however like to label them with the boxplot statistics (the median, q1 and q3). In the boxplot function in r-base, I could output boxplot statistics and then write a text on the plot to place the labels. How would one do it with ggplot? Vikas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] generate Binomial (not Binary) data
Dear All, I am looking for an R function or any other reference to generate a series of correlated Binomial (not a Bernoulli) data. The bindata library can do this for the binary not the binomial case. Thank you, Bernard - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Finding not-matching rows in tables
I have these two dataframes in which 'id' is the key field tabella id nome 1 1 PIEMONTE 2 2 VALLED'AOSTA 3 3 LOMBARDIA 4 4 TRENTINO 5 5VENETO 6 6FRIULI AND tab id nome 1 1 PIEMONTE 2 2 VALLED'AOSTA 3 3 LOMBARDIA 4 4 TRENTINO 5 25 CAMPANIA 6 28 LAZIO Is there any R-one-command able to select the only rows of tab that are not present in tabella, matching the two tables on 'id'? The result should be 5 25 CAMPANIA 6 28 LAZIO I was able to obtain this results by means of the merge command merging the two tables and selecting according to the NA fields, therefore in two steps Ciao Vittorio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] sorting a matrix by a different colnames order
Hi R users, I would like to know how to sort a matrix according a different order of colnames (or rownames) ,e.g., mx = matrix(rnorm(1:20),5,4) colnames(mx) = letters[1:4] rownames(mx) = letters[1:5] mx a b c d a 0.02362598 -0.7033460 0.8106089 -1.03456219 b -0.45021522 -1.5769522 0.1770634 0.27997249 c 1.34732392 0.2956623 2.0027231 -0.85321627 d 0.82314457 1.2698347 -0.5468151 0.05806375 e -0.18668401 -0.4210383 0.6263465 -0.18889031 (new.col.names = sample(letters[1:4])) [1] a b d c so the new matrix has to be ordered according the new.col.names,i.e., a b d c a 0.02362598 -0.7033460-1.03456219 0.8106089 b -0.45021522 -1.5769522 0.27997249 0.1770634 c 1.34732392 0.2956623-0.85321627 2.0027231 d 0.82314457 1.2698347 0.05806375 -0.5468151 e -0.18668401 -0.4210383-0.18889031 0.6263465 Hope this is not a basic question Thank you for your help. Paolo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R in Industry
Frank == Frank E Harrell [EMAIL PROTECTED] on Tue, 06 Feb 2007 21:59:45 -0600 writes: Frank Matthew Keller wrote: Bob, Far from flaming you, I think you made a good point - one that I imagine most people who use R have come across. The name R is a big impediment to effective online searches. As a check, I entered R software, SAS software, SPSS software, and S+ software into google. The R 'hit rate' was only ten out of the first 20 results (I didn't look any further). For the other three software packages, the hit rates were all 100% (20/20). I do wonder if anything can/should be done about this. I generally search using the term CRAN but of course, that omits lots of stuff relevant to R. Any ideas about how to do effective online searches for R related materials? I don't think we (the R foundation) will ever change away from R.. Matt Frank I just googled for R and www.r-project.org was the Frank first hit. Don't see a problem at present. We are getting really off-topic, but that's interesting: We all know that Google is helping the Chinese government to censor their own people, so searches there can lead to completely different results. But even here in Zurich Switzerland, I get quite a different hitlist : 1) stat.ethz.ch/~statsoft/stat.programme/R.html [in German] 2) Our local CRAN mirror: stat.ethz.ch/CRAN/ 3) R - (German-language) Wikipedia about letter R: de.wikipedia.org/wiki/R 4) DVD-R - (German-language) Wikipedia de.wikipedia.org/wiki/DVD-R 5) The R Project for Statistical Computing http://www.r-project.org/ So 3/5 are related to R which sounds good, but actually these 3 are all from the first twenty: 3/20. Martin On 2/6/07, Wensui Liu [EMAIL PROTECTED] wrote: I've been looking for job that allows me to use R/S+ since I got out of graduate school 2 years ago but with no success. I am wondering if there is something that can be done to promote the use of R in industry. It's been very frustrating to see people doing statistics using excel/spss and even more frustrating to see people paying $$$ for something much inferior to R. On 2/6/07, Doran, Harold [EMAIL PROTECTED] wrote: The other day, CNN had a story on working at Google. Out of curiosity, I went to the Google employment web site (I'm not looking, but just curious). In perusing their job posts for statisticians, preference is given to those who use R and python. Other languages, S-Plus and something called SAS were listed as lower priorities. When I started using Python, I noted they have a portion of the web site with job postings. CRAN does not have something similar, but think it might be useful. I think R is becoming more widely used in industry and I wonder if helping it move along a bit, the maintainer of CRAN could create a section of the web site devoted to jobs where R is a requirement. Hence, we could have our own little monster.com kind of thing going on. Of the multitude of ways the gospel can be spread, this is small. But, I think every small step forward is good. Anyone think this is useful? Harold [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- WenSui Liu A lousy statistician who happens to know a little programming (http://spaces.msn.com/statcompute/blog) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Frank -- Frank E Harrell Jr Professor and Chair School of Frank Medicine Department of Biostatistics Vanderbilt Frank University Frank __ Frank R-help@stat.math.ethz.ch mailing list Frank https://stat.ethz.ch/mailman/listinfo/r-help PLEASE Frank do read the posting guide Frank http://www.R-project.org/posting-guide.html and Frank provide commented, minimal, self-contained, Frank reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] abbreviate dataframe for Sweave output
Chris, You might be able to get it using format. You would have to convert the data frame to a matrix if you want the row names to be dots too. foo - function(x, top = 3, ...) { if(dim(x)[1] top + 3) stop(not enough rows) charX - format(x, ...) charX - charX[c(1:(top+2), dim(charX)[1]), ] charX[(top + 1):(top + 2),] - . charX - as.matrix(charX) rownames(charX)[(top + 1):(top + 2)] - . charX } library(MASS) foo(crabs) sp sex index FL RW CL CW BD 1 B M 1 8.1 6.7 16.1 19.0 7.0 2 B M 2 8.8 7.7 18.1 20.8 7.4 3 B M 3 9.2 7.8 19.0 22.4 7.7 . . . . ..... . . . . ..... 200 O F 50 23.1 20.2 46.2 52.5 21.1 Max -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of stubben Sent: Tuesday, February 06, 2007 6:39 PM To: r-help@stat.math.ethz.ch Subject: [R] abbreviate dataframe for Sweave output I wanted to print the first and last rows of some dataframes in Sweave using dots in columns to separate the two parts. Head and tail almost work, but I have problems with factors and row names. z-data.frame(id=letters[1:26], x=sample(1:26,26)) rbind(head(z,3), ., tail(z,1)) id x 1 a 18 2 b 8 3 c 14 4 NA . 26z 10 Warning message: invalid factor level, NAs generated in... I would like something like this if possible. Any ideas? id x 1 a 18 2 b 8 3 c 14 . . . . . . 26z 10 Thanks, Chris Stubben -- - Los Alamos National Lab BioScience Division MS M888 Los Alamos, NM 87545 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Finding not-matching rows in tables
That's something for the %in% command. Try this (untested!) tab[(tab$id %in% tabella$id) == FALSE, ] Cheers, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Reseach Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 [EMAIL PROTECTED] www.inbo.be Do not put your faith in what statistics say until you have carefully considered what they do not say. ~William W. Watt A statistical analysis, properly conducted, is a delicate dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Vittorio Verzonden: woensdag 7 februari 2007 14:24 Aan: r-help@stat.math.ethz.ch Onderwerp: [R] Finding not-matching rows in tables I have these two dataframes in which 'id' is the key field tabella id nome 1 1 PIEMONTE 2 2 VALLED'AOSTA 3 3 LOMBARDIA 4 4 TRENTINO 5 5VENETO 6 6FRIULI AND tab id nome 1 1 PIEMONTE 2 2 VALLED'AOSTA 3 3 LOMBARDIA 4 4 TRENTINO 5 25 CAMPANIA 6 28 LAZIO Is there any R-one-command able to select the only rows of tab that are not present in tabella, matching the two tables on 'id'? The result should be 5 25 CAMPANIA 6 28 LAZIO I was able to obtain this results by means of the merge command merging the two tables and selecting according to the NA fields, therefore in two steps Ciao Vittorio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Finding not-matching rows in tables
Hi you can use %in% tabella[tabella$x %in% tab$x,] to select rows which are in both and tabella[!(tabella$x %in% tab$x),] to select only non matching ones HTH Petr On 7 Feb 2007 at 0:00, Vittorio wrote: Date sent: Wed, 7 Feb 2007 14:23:45 +0100 (GMT+01:00) From: Vittorio [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject:[R] Finding not-matching rows in tables Send reply to: Vittorio [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] I have these two dataframes in which 'id' is the key field tabella id nome 1 1 PIEMONTE 2 2 VALLED'AOSTA 3 3 LOMBARDIA 4 4 TRENTINO 5 5VENETO 6 6FRIULI AND tab id nome 1 1 PIEMONTE 2 2 VALLED'AOSTA 3 3 LOMBARDIA 4 4 TRENTINO 5 25 CAMPANIA 6 28 LAZIO Is there any R-one-command able to select the only rows of tab that are not present in tabella, matching the two tables on 'id'? The result should be 5 25 CAMPANIA 6 28 LAZIO I was able to obtain this results by means of the merge command merging the two tables and selecting according to the NA fields, therefore in two steps Ciao Vittorio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] enhanced question / standardized coefficients
Hello, I would like to repost the question of Joerg: Hello everybody, a question that connect to the question of Frederik Karlsons about 'how to stand. betas' With the stand. betas i can compare the influence of the different explaning variables. What do i with the betas of factors? I can't use the solution of JohnFox, because there is no sd of an factor. How can i compare the influence of the factor with the influence of the numeric variables? I got the same problem. In my regression equation there are several categorical variables and I would like to compute the standard coefficients. How can I do this? Simon [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] sorting a matrix by a different colnames order
try: mx[,new.col.names] HTH. On 2/7/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi R users, I would like to know how to sort a matrix according a different order of colnames (or rownames) ,e.g., mx = matrix(rnorm(1:20),5,4) colnames(mx) = letters[1:4] rownames(mx) = letters[1:5] mx a b c d a 0.02362598 -0.7033460 0.8106089 -1.03456219 b -0.45021522 -1.5769522 0.1770634 0.27997249 c 1.34732392 0.2956623 2.0027231 -0.85321627 d 0.82314457 1.2698347 -0.5468151 0.05806375 e -0.18668401 -0.4210383 0.6263465 -0.18889031 (new.col.names = sample(letters[1:4])) [1] a b d c so the new matrix has to be ordered according the new.col.names,i.e., a b d c a 0.02362598 -0.7033460 -1.03456219 0.8106089 b -0.45021522 -1.5769522 0.27997249 0.1770634 c 1.34732392 0.2956623 -0.85321627 2.0027231 d 0.82314457 1.2698347 0.05806375 -0.5468151 e -0.18668401 -0.4210383 -0.18889031 0.6263465 Hope this is not a basic question Thank you for your help. Paolo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] sorting a matrix by a different colnames order
mx = matrix(rnorm(1:20),5,4) colnames(mx) = letters[1:4] rownames(mx) = letters[1:5] mx a b c d a -0.6264538 -0.8204684 1.5117812 -0.04493361 b 0.1836433 0.4874291 0.3898432 -0.01619026 c -0.8356286 0.7383247 -0.6212406 0.94383621 d 1.5952808 0.5757814 -2.2146999 0.82122120 e 0.3295078 -0.3053884 1.1249309 0.59390132 (new.col.names = sample(letters[1:4])) [1] d b c a mx[, new.col.names] d b c a a -0.04493361 -0.8204684 1.5117812 -0.6264538 b -0.01619026 0.4874291 0.3898432 0.1836433 c 0.94383621 0.7383247 -0.6212406 -0.8356286 d 0.82122120 0.5757814 -2.2146999 1.5952808 e 0.59390132 -0.3053884 1.1249309 0.3295078 On 2/7/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi R users, I would like to know how to sort a matrix according a different order of colnames (or rownames) ,e.g., mx = matrix(rnorm(1:20),5,4) colnames(mx) = letters[1:4] rownames(mx) = letters[1:5] mx a b c d a 0.02362598 -0.7033460 0.8106089 -1.03456219 b -0.45021522 -1.5769522 0.1770634 0.27997249 c 1.34732392 0.2956623 2.0027231 -0.85321627 d 0.82314457 1.2698347 -0.5468151 0.05806375 e -0.18668401 -0.4210383 0.6263465 -0.18889031 (new.col.names = sample(letters[1:4])) [1] a b d c so the new matrix has to be ordered according the new.col.names,i.e., a b d c a 0.02362598 -0.7033460-1.03456219 0.8106089 b -0.45021522 -1.5769522 0.27997249 0.1770634 c 1.34732392 0.2956623-0.85321627 2.0027231 d 0.82314457 1.2698347 0.05806375 -0.5468151 e -0.18668401 -0.4210383-0.18889031 0.6263465 Hope this is not a basic question Thank you for your help. Paolo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] generate Binomial (not Binary) data
On 07-Feb-07 Marc Bernard wrote: Dear All, I am looking for an R function or any other reference to generate a series of correlated Binomial (not a Bernoulli) data. The bindata library can do this for the binary not the binomial case. Thank you, Bernard How do you want your series of binomial datato be correlated? Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 07-Feb-07 Time: 14:17:15 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] enhanced question / standardized coefficients
Dear Simon, In my opinion, standardized coefficients only offer the illusion of comparison for quantitative explanatory variables, since there's no deep reason that the standard deviation of one variable has the same meaning as the standard deviation of another. Indeed, if the variables are in the same units of measurement in the first place, permitting direct comparison of unstandardized coefficients, then separate standardization of each X is like using a rubber ruler. That said, as you point out, it makes no sense to standardize the dummy regressors for a factor, so you can just standardize the quantitative variables (Y and X's) in the regression equation. I hope that this helps, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Simon P. Kempf Sent: Wednesday, February 07, 2007 9:27 AM To: r-help@stat.math.ethz.ch Subject: [R] enhanced question / standardized coefficients Hello, I would like to repost the question of Joerg: Hello everybody, a question that connect to the question of Frederik Karlsons about 'how to stand. betas' With the stand. betas i can compare the influence of the different explaning variables. What do i with the betas of factors? I can't use the solution of JohnFox, because there is no sd of an factor. How can i compare the influence of the factor with the influence of the numeric variables? I got the same problem. In my regression equation there are several categorical variables and I would like to compute the standard coefficients. How can I do this? Simon [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] installing packages and windows vista
Opening R by right clicking and choosing run as administrator' worked. Was able to run install packages without a problem. I have not tested the other methods suggested. thank you. Dan O'Shea -- Original message -- From: Duncan Murdoch [EMAIL PROTECTED] On 2/6/2007 10:33 AM, Daniel O'Shea wrote: I installed R (R-2.4.1-win32.exe) on a new computer with Windows Vista and a 64 bit operating system (hp dv9000 with intel core t7200). The base R runs fine, but I can not get any of the packages to load. From within R I choose install packages choose a site then a package. I tried installing 2 packages and get similar errors (see below), I just copied and pasted lines from R. Can anyone offer any suggestions? Thank you. I believe that on Vista you need to do like other OS's, and run package installs at a higher security level than the default. I don't have Vista so I've never done this, but I've been told you do it by right clicking on the R icon and choosing Run as administrator. I'd be interested in hearing if this is true of all package installs, or only installs to C:/Program files. Can you have a local library for your user, with only user permissions needed to modify packages there? You'd test this by creating a library directory in your own file space, then using .libPaths() to add it to the library location list. By default new installs would go there. Duncan Murdoch Dan O'Shea utils:::menuInstallPkgs() --- Please select a CRAN mirror for use in this session --- also installing the dependencies 'scatterplot3d', 'rgl', 'ellipse' trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/scatterplot3d_0.3-24.zip' Content type 'application/zip' length 540328 bytes opened URL downloaded 527Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/rgl_0.70.zip' Content type 'application/zip' length 838137 bytes opened URL downloaded 818Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/ellipse_0.3-4.zip' Content type 'application/zip' length 91877 bytes opened URL downloaded 89Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/vegan_1.8-5.zip' Content type 'application/zip' length 1176434 bytes opened URL downloaded 1148Kb Error in zip.unpack(pkg, tmpDir) : cannot open file 'C:/Program Files (x86)/R/R-2.4.1/library/file60bf5753/scatterplot3d/chtml/scatterplot3d.chm' utils:::menuInstallPkgs() also installing the dependencies 'akima', 'gam', 'RColorBrewer', 'sm', 'deldir', 'sp', 'maps', 'spatstat', 'PBSmapping', 'gpclib', 'RArcInfo', 'tkrplot', 'maptools', 'mapproj', 'rgl', 'qcc', 'sgeostat', 'acepack', 'TeachingDemos', 'chron', 'Hmisc' trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/akima_0.5-1.zip' Content type 'application/zip' length 128809 bytes opened URL downloaded 125Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/gam_0.98.zip' Content type 'application/zip' length 238008 bytes opened URL downloaded 232Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/RColorBrewer_0.2-3.zip' Content type 'application/zip' length 39787 bytes opened URL downloaded 38Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/sm_2.1-0.zip' Content type 'application/zip' length 400621 bytes opened URL downloaded 391Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/deldir_0.0-5.zip' Content type 'application/zip' length 108656 bytes opened URL downloaded 106Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/sp_0.9-4.zip' Content type 'application/zip' length 747542 bytes opened URL downloaded 730Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/maps_2.0-33.zip' Content type 'application/zip' length 2219136 bytes opened URL downloaded 2167Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/spatstat_1.11-0.zip' Content type 'application/zip' length 4558460 bytes opened URL downloaded 4451Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/PBSmapping_2.09.zip' Content type 'application/zip' length 6725596 bytes opened URL downloaded 6567Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/gpclib_1.3-3.zip' Content type 'application/zip' length 95120 bytes opened URL downloaded 92Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/RArcInfo_0.4-7.zip' Content type 'application/zip' length 374375 bytes opened URL downloaded 365Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/tkrplot_0.0-16.zip' Content type 'application/zip' length 24119 bytes opened URL downloaded 23Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/maptools_0.6-6.zip' Content type 'application/zip' length 679963 bytes opened URL downloaded 664Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/mapproj_1.1-7.1.zip'
[R] Detrended Fluctuation Analysis
Good afternoon, my name is Gorka Merino and i am a scientist working in the Marine Science Institune in Barcelone. I'm interested in the application of Detrended Fluctuation Analysis (DFA) with the R packages. I've tried to obtain some information related to DFA from the 'Help' options but failed. Could somebody inform me about the use of these techniques in R language? Thank you very much. Gorka Merino Gorka Merino Institut de Ciències del Mar, CMIMA-CSIC Psg. Marítim de la Barceloneta 37-49 08003-BARCELONA (Spain) Tel.: (34) 932 30 95 48 e-mail: [EMAIL PROTECTED] CMIMA: Tel.: (34) 932 30 95 00 Fax: (34) 932 30 95 55 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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 statistics in ggplot
How can I superimpose some text labels on ggplot? I could get weighted quantiles using wtd.quantiles function in Hmisc package. But I can't plot these as labels on the boxplot. My code is as follows. list(c(1:3),c(1:3),c(1:3))-t library(Hmisc) for (i in 1:3) { wtd.quantile(crop.2.list[[i]]$aggincome,weights=crop.2.list[[i]]$Multiplier,probs=c(0.25,0.5,0.75))-t[[i]] } data.frame(y=round(unlist(t)),x=c(1,1,1,2,2,2,3,3,3))-levels library(ggplot) ggplot(crop.2.cast,aesthetics=list(x=Tenurial.status,y=aggincome, weight=Multiplier),labels=c(ts,in))-p ggtext(ggboxplot(p),aesthetics=list(x=x,y=y,labels=y),data=levels) I am unable to combine ggtext with ggboxplot. Will be grateful if someone could help. Finally, a relatively minor issue at the moment, is it possible to change the x-axis and y-axis labels? Vikas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R in Industry
Matthew Keller wrote: I do wonder if anything can/should be done about this. I generally search using the term CRAN but of course, that omits lots of stuff relevant to R. Change the name in the next major version to 'Rplus'? Barry __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] step in a model with strata
Dear experts, when I call the step function for a coxph model with n covariates and a dicotomous variable included as strata, the first term removed by step is always the strata variable. This is not what I want and then I do a manual step updating the model minus the least significant covariate and testing with anova, until I have minimized the model. Is there a package were this can be done? or am I doing something wrong ? (I'm not a statistician). Thanks for hints Pietro Bulian Clinical and Experimental Hematology Research Unit Centro di Riferimento Oncologico, I.R.C.C.S. Via Pedemontana, 12 I-33081 Aviano (PN) - Italy phone: +39 0434 659 412 fax: +39 0434 659 409 e-mail: [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] fill-in a table of pairs
Hallo, I have a table of names and values: joe 0.45 mike 0.34 jim 0.25 I would like to fill-in a table of all pairs of names (which I aleady have) joe.mike NA NA joe.jim NA NA mike.jim NA NA with the values from the first table in the order of the pairs. The outcome looks like joe.mike 0.45 0.34 joe.jim 0.45 0.25 mike.jim 0.34 0.25 Thanks a lot, Serguei [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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 statistics in ggplot
Hi, Let me first congratulate you for having written the reshape package. It is very nice and I use it all the time. I wish the documentation was a bit easier. It took me quite some time to find my way through it!! But once I got the hang of how it worked, I just loved it. With ggplot, this is my first encounter!! I actually find the labels on the plots quite useful. For example, to put identifiers for the outlier observations so that my co-researchers can dig deeper into data to see if something is wrong. Similarly, it is useful to be able to put the exact values on the plots. It is much nicer to be able to see the spread of groups of your data while you compare the medians/means!! I will see if I can manage the boxplot.weighted myself. But how does one add the values!! Is the next version round the corner? Is there a way one could do it with the present version? Again, congratulations for all the good stuff you have written!! Vikas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R in Industry
On Tue, 6 Feb 2007, Muenchen, Robert A (Bob) wrote: That sounds like a good idea. The name R makes it especially hard to find job postings, resumes or do any other type of search. Googling resume+sas or job opening+sas is quick and fairly effective (less a few airline jobs). Doing that with R is of course futile. At the risk of getting flamed, it's too bad it's not called something more unique such as Rpackage, Rlanguage, etc. For all sorts of reasons I don't think Googling for jobs using R was high on Ross Robert's list of use cases when they chose the name ... It might be better to have an archived list rather than a CRAN page -- I've just noticed that cran.us last updated on Jan 12, which would be a long delay for job ads. -thomas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] enhanced question / standardized coefficients
There was a nice paper in The American Statistician by Johan Bring (1994. How to standardize regression coefficients. The American Statistician 48(3):209-213) pointing out that comparing ratios of t-test statistic values (for null hypothesis that parameter = 0) is equivalent to comparing ratios of standardized coefficients where standardization is based on the partial (conditional) standard deviations of the parameter estimates. And this is equivalent to thinking about the incremental improvement in R-squared that is obtained by including a variable in the regression model after all others are already in the model. It would seem possible to extend this idea to categorical factor variables with more than 2 levels (1 indicator variable), given the relation between an F and t-test statistic. Any way something to think about, though there are no doubt still limitations in trying to equate effects of variables measured on disparate scales. Brian Brian S. Cade U. S. Geological Survey Fort Collins Science Center 2150 Centre Ave., Bldg. C Fort Collins, CO 80526-8818 email: [EMAIL PROTECTED] tel: 970 226-9326 John Fox [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 02/07/2007 07:49 AM To 'Simon P. Kempf' [EMAIL PROTECTED] cc r-help@stat.math.ethz.ch Subject Re: [R] enhanced question / standardized coefficients Dear Simon, In my opinion, standardized coefficients only offer the illusion of comparison for quantitative explanatory variables, since there's no deep reason that the standard deviation of one variable has the same meaning as the standard deviation of another. Indeed, if the variables are in the same units of measurement in the first place, permitting direct comparison of unstandardized coefficients, then separate standardization of each X is like using a rubber ruler. That said, as you point out, it makes no sense to standardize the dummy regressors for a factor, so you can just standardize the quantitative variables (Y and X's) in the regression equation. I hope that this helps, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Simon P. Kempf Sent: Wednesday, February 07, 2007 9:27 AM To: r-help@stat.math.ethz.ch Subject: [R] enhanced question / standardized coefficients Hello, I would like to repost the question of Joerg: Hello everybody, a question that connect to the question of Frederik Karlsons about 'how to stand. betas' With the stand. betas i can compare the influence of the different explaning variables. What do i with the betas of factors? I can't use the solution of JohnFox, because there is no sd of an factor. How can i compare the influence of the factor with the influence of the numeric variables? I got the same problem. In my regression equation there are several categorical variables and I would like to compute the standard coefficients. How can I do this? Simon [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] spss file import
Hi All, does anyone ever import old SPSS files in a sl3 format? read.spss('file.sl3') does not seem to work... it's not recognised as a supported SPSS format at all. Best, Fede -- Federico C. F. Calboli Department of Epidemiology and Public Health Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax +44 (0)20 75943193 f.calboli [.a.t] imperial.ac.uk f.calboli [.a.t] gmail.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] installing packages and windows vista
Thank you Dan! I dunno if I would have ever found that. Thanks! Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, February 07, 2007 9:49 AM To: Duncan Murdoch; [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: Re: [R] installing packages and windows vista Opening R by right clicking and choosing run as administrator' worked. Was able to run install packages without a problem. I have not tested the other methods suggested. thank you. Dan O'Shea -- Original message -- From: Duncan Murdoch [EMAIL PROTECTED] On 2/6/2007 10:33 AM, Daniel O'Shea wrote: I installed R (R-2.4.1-win32.exe) on a new computer with Windows Vista and a 64 bit operating system (hp dv9000 with intel core t7200). The base R runs fine, but I can not get any of the packages to load. From within R I choose install packages choose a site then a package. I tried installing 2 packages and get similar errors (see below), I just copied and pasted lines from R. Can anyone offer any suggestions? Thank you. I believe that on Vista you need to do like other OS's, and run package installs at a higher security level than the default. I don't have Vista so I've never done this, but I've been told you do it by right clicking on the R icon and choosing Run as administrator. I'd be interested in hearing if this is true of all package installs, or only installs to C:/Program files. Can you have a local library for your user, with only user permissions needed to modify packages there? You'd test this by creating a library directory in your own file space, then using .libPaths() to add it to the library location list. By default new installs would go there. Duncan Murdoch Dan O'Shea utils:::menuInstallPkgs() --- Please select a CRAN mirror for use in this session --- also installing the dependencies 'scatterplot3d', 'rgl', 'ellipse' trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/scatterplot3d_0.3-24.zip' Content type 'application/zip' length 540328 bytes opened URL downloaded 527Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/rgl_0.70.zip' Content type 'application/zip' length 838137 bytes opened URL downloaded 818Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/ellipse_0.3-4.zip' Content type 'application/zip' length 91877 bytes opened URL downloaded 89Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/vegan_1.8-5.zip' Content type 'application/zip' length 1176434 bytes opened URL downloaded 1148Kb Error in zip.unpack(pkg, tmpDir) : cannot open file 'C:/Program Files (x86)/R/R-2.4.1/library/file60bf5753/scatterplot3d/chtml/scatterplot3d.chm' utils:::menuInstallPkgs() also installing the dependencies 'akima', 'gam', 'RColorBrewer', 'sm', 'deldir', 'sp', 'maps', 'spatstat', 'PBSmapping', 'gpclib', 'RArcInfo', 'tkrplot', 'maptools', 'mapproj', 'rgl', 'qcc', 'sgeostat', 'acepack', 'TeachingDemos', 'chron', 'Hmisc' trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/akima_0.5-1.zip' Content type 'application/zip' length 128809 bytes opened URL downloaded 125Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/gam_0.98.zip' Content type 'application/zip' length 238008 bytes opened URL downloaded 232Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/RColorBrewer_0.2-3.zip' Content type 'application/zip' length 39787 bytes opened URL downloaded 38Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/sm_2.1-0.zip' Content type 'application/zip' length 400621 bytes opened URL downloaded 391Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/deldir_0.0-5.zip' Content type 'application/zip' length 108656 bytes opened URL downloaded 106Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/sp_0.9-4.zip' Content type 'application/zip' length 747542 bytes opened URL downloaded 730Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/maps_2.0-33.zip' Content type 'application/zip' length 2219136 bytes opened URL downloaded 2167Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/spatstat_1.11-0.zip' Content type 'application/zip' length 4558460 bytes opened URL downloaded 4451Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/PBSmapping_2.09.zip' Content type 'application/zip' length 6725596 bytes opened URL downloaded 6567Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/gpclib_1.3-3.zip' Content type 'application/zip' length 95120 bytes opened URL downloaded 92Kb trying URL 'http://cran.wustl.edu/bin/windows/contrib/2.4/RArcInfo_0.4-7.zip' Content type 'application/zip' length
Re: [R] Any Limitations for the dataframes?
Shubha Vishwanath Karanth shubhak at ambaresearch.com writes: Hi R, Are there any limitations on the capacity of the data to hold for R data frames or zoo objects? I mean to ask are there any restrictions on the number of rows or column in the R data frames or the zoo objects? Thank you, Shubha Pretty much only memory size (the number of elements in a vector, which probably (?) translates to the number of rows, is limited to 2^31-1, but if you really have more than 2 billion observations you'll probably run out of memory first ... ?Memory help(Memory-limits) If you give more specifics on the problem (approx. number of observations and elements per observation, and what you plan to try to do with them) you may get more useful feedback about whether what you plan to do is feasible and/or sensible. Ben Bolker signature.asc Description: OpenPGP digital signature __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] XML and str
If I read in an .xml file eg with xeg - xmlTreeParse(system.file(exampleData, test.xml, package=XML)) It appears to be OK however examining it with str() gives an apparent error str(xeg,2) List of 2 $ doc:List of 3 ..$ file: list() .. ..- attr(*, class)= chr [1:2] XMLComment XMLNode ..$ version :List of 4 .. ..- attr(*, class)= chr XMLNode ..$ children:Error in obj$children[[...]] : subscript out of bounds I am unsure if this is a feature or a bug and if the latter whether it is in XML or str, it is not causing a problem but I would like to understand what is happening, any ideas ? examining components eg str(xeg$doc$children,2) List of 2 $ comment: list() ..- attr(*, class)= chr [1:2] XMLComment XMLNode etc is OK. XML Version 1.4-1, same behaviour on Windows and Linux, R version 2.4.1 (2006-12-18) The information contained in this E-Mail and any subsequent correspondence is private and is intended solely for the intended recipient(s). The information in this communication may be confidential and/or legally privileged. Nothing in this e-mail is intended to conclude a contract on behalf of QinetiQ or make QinetiQ subject to any other legally binding commitments, unless the e-mail contains an express statement to the contrary or incorporates a formal Purchase Order. For those other than the recipient any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on such information is prohibited and may be unlawful. Emails and other electronic communication with QinetiQ may be monitored and recorded for business purposes including security, audit and archival purposes. Any response to this email indicates consent to this. Telephone calls to QinetiQ may be monitored or recorded for quality control, security and other business purposes. QinetiQ Group plc, Company Registration No: 4586941, Registered office: 85 Buckingham Gate, London SW1E 6PD __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] ncdf library
i have been trying to load the package ncdf using the command library(ncdf). below is my hardware information. platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 4.0 year 2006 month 10 day03 svn rev39566 language R version.string R version 2.4.0 (2006-10-03) when i do below, i get that error and I'm not sure how to fix it ? library(ncdf) Error in package_version(vers) : invalid version specification i listed the directory and the library seems to be there ( but i didn't put ithe library there so maybe it's old but it says 2.4.0 ) so I don't know how to proceed ? i tried library(nnet) just to see if i had the same problem for all libraries but that worked fine. does anyone know anything specific about this library ncdf that needs to be done ? thanks a lot. ls -lrt ncdf total 22 drwxr-xr-x2 vmsadmin bin 2048 Oct 30 15:06 man drwxr-xr-x2 vmsadmin bin 2048 Oct 30 15:06 libs drwxr-xr-x2 vmsadmin bin 2048 Oct 30 15:06 latex drwxr-xr-x2 vmsadmin bin 2048 Oct 30 15:06 html drwxr-xr-x2 vmsadmin bin 2048 Oct 30 15:06 help drwxr-xr-x2 vmsadmin bin 2048 Oct 30 15:06 chtml drwxr-xr-x2 vmsadmin bin 2048 Oct 30 15:06 R-ex drwxr-xr-x2 vmsadmin bin 2048 Oct 30 15:06 R drwxr-xr-x2 vmsadmin bin 2048 Oct 30 15:06 Meta lrwxr-xr-x1 vmsadmin bin27 Oct 30 15:06 MD5 - ../../exec/library/ncdf/MD5 lrwxr-xr-x1 vmsadmin bin29 Oct 30 15:06 INDEX - ../../exec/library/ncdf/INDEX lrwxr-xr-x1 vmsadmin bin35 Oct 30 15:06 DESCRIPTION - ../../exec/library/ncdf/DESCRIPTION lrwxr-xr-x1 vmsadmin bin32 Oct 30 15:06 CONTENTS - ../../exec/library/ncdf/CONTENTS piias171 /ms/dist/fsf/PROJ/R/2.4.0/library 426$ This is not an offer (or solicitation of an offer) to buy/se...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] tCopula package question
Hello everyone, I am having issues with the R copula package. Just trying to run the example I found at this site gives me an error. When I implement this code: mycop - tCopula(param=0.5, dim=8, dispstr = ex, df =5) myfit - fitCopula(x, mycop, c(0.6,10), optim.control=list(trace=1),method=Nelder-Mead) myfit I get the following information on the search method and an error: Error in chol(x, pivot = FALSE) : the leading minor of order 2 is not positive definite myfit Error: object myfit not found Any ideas on why this is happening are appreciated. Thanks. Adam (aat) -- View this message in context: http://www.nabble.com/tCopula-package-question-tf3188503.html#a8850378 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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 statistics in ggplot
On 2/7/07, Vikas Rawal [EMAIL PROTECTED] wrote: How can I superimpose some text labels on ggplot? I could get weighted quantiles using wtd.quantiles function in Hmisc package. But I can't plot these as labels on the boxplot. My code is as follows. list(c(1:3),c(1:3),c(1:3))-t library(Hmisc) for (i in 1:3) { wtd.quantile(crop.2.list[[i]]$aggincome,weights=crop.2.list[[i]]$Multiplier,probs=c(0.25,0.5,0.75))-t[[i]] } data.frame(y=round(unlist(t)),x=c(1,1,1,2,2,2,3,3,3))-levels library(ggplot) ggplot(crop.2.cast,aesthetics=list(x=Tenurial.status,y=aggincome, weight=Multiplier),labels=c(ts,in))-p ggtext(ggboxplot(p),aesthetics=list(x=x,y=y,labels=y),data=levels) That should work. Are you able to send me the data so I can check it myself? Finally, a relatively minor issue at the moment, is it possible to change the x-axis and y-axis labels? Yes: p$xlabel - X label; p$ylabel - Y label Hadley __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Sample Poisson Distribution
Hi, I'm completely new to R, I am all at sea with the interface and the confusing help files, so would appreciate some help to do a simple task. Need to present the mean and variance of 100 different samples of poisson distributions (N=1000, with fixed lambda) in a file in two columnns, and then produce histograms. So far I have figured out: N - 1000 x - rpois(N, 3.1) , and var(x) and mean(x) , and I've seen the hist command, just need to tie it all together. I read that loops aren't really used in R, so what do i need to do? thanks -- View this message in context: http://www.nabble.com/Sample-Poisson-Distribution-tf3188621.html#a8850775 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Sample Poisson Distribution
Do you mean that you have 100 samples, each of size 1000. If this is so, you can perhaps do: N = 1000 n = 100 x = matrix(rpois(N*n, 3.1), ncol=100) # Generate the appropriate no. of Poisson samples and rearrange into 100 columns of 1000 output = cbind(means=apply(x,2,mean), vars=apply(x,2,var)) # apply(x,2,mean) runs mean on each column of x What do you want to draw the histograms of? Histograms of the means and/or variances can be done by hist(output$means) hist(output$vars) Hope this helps Abhijit Thor wrote: Hi, I'm completely new to R, I am all at sea with the interface and the confusing help files, so would appreciate some help to do a simple task. Need to present the mean and variance of 100 different samples of poisson distributions (N=1000, with fixed lambda) in a file in two columnns, and then produce histograms. So far I have figured out: N - 1000 x - rpois(N, 3.1) , and var(x) and mean(x) , and I've seen the hist command, just need to tie it all together. I read that loops aren't really used in R, so what do i need to do? thanks __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] tCopula package question
That may indicate lack of fit. If the data is generated from the t-copula, this worked for me: set.seed(123) mycop - tCopula(param=0.5, dim=8, dispstr = ex, df =5) x - rcopula(mycop, 1000) myfit - fitCopula(x, mycop, c(0.6,10), optim.control=list(trace=1),method=Nelder-Mead) myfit On 2/7/07, aat [EMAIL PROTECTED] wrote: Hello everyone, I am having issues with the R copula package. Just trying to run the example I found at this site gives me an error. When I implement this code: mycop - tCopula(param=0.5, dim=8, dispstr = ex, df =5) myfit - fitCopula(x, mycop, c(0.6,10), optim.control=list(trace=1),method=Nelder-Mead) myfit I get the following information on the search method and an error: Error in chol(x, pivot = FALSE) : the leading minor of order 2 is not positive definite myfit Error: object myfit not found Any ideas on why this is happening are appreciated. Thanks. Adam (aat) -- View this message in context: http://www.nabble.com/tCopula-package-question-tf3188503.html#a8850378 Sent from the R help mailing list archive at Nabble.com. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jun Yan Assistant Professor Department of Statistics and Actuarial Science Voice: 319-335-0824 University of Iowa Fax: 319-335-3017 219 Schaeffer Hall Email: [EMAIL PROTECTED] Iowa City, IA 52242 Web: http://www.stat.uiowa.edu/~jyan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Filling the window in lattice plot
Hello, I have a dataset with 90 columns and 300 rows. I am plotting a scatterplot, splom(~DD[1:20],data=dd,cex=1,pch=.) on a 30 display. When i stretch the display to fill the screen the 20x20 boxes, resize, but don't fill the screen, i.e during the initial draw there is approx 0.25inch gap from the edge of the window, after a resize however this gap increases to 3-4+ inches. So even at the cost of losing the aspect ratio of the boxes, how can resize them so that their total width and height fills the corresponding the dimension of the window. Also, should i wish to preserve the aspect ratio of the boxes, will lattice/R insert scrollbars to the window (assuming my output is for X11 device) Regards Saptarshi Saptarshi Guha | [EMAIL PROTECTED] | http://www.stat.purdue.edu/~sguha He who wonders discovers that this in itself is wonder. -- M.C. Escher [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R in Industry
Martin Maechler wrote: Frank == Frank E Harrell [EMAIL PROTECTED] on Tue, 06 Feb 2007 21:59:45 -0600 writes: Frank Matthew Keller wrote: Bob, Far from flaming you, I think you made a good point - one that I imagine most people who use R have come across. The name R is a big impediment to effective online searches. As a check, I entered R software, SAS software, SPSS software, and S+ software into google. The R 'hit rate' was only ten out of the first 20 results (I didn't look any further). For the other three software packages, the hit rates were all 100% (20/20). I do wonder if anything can/should be done about this. I generally search using the term CRAN but of course, that omits lots of stuff relevant to R. Any ideas about how to do effective online searches for R related materials? I don't think we (the R foundation) will ever change away from R.. Matt Frank I just googled for R and www.r-project.org was the Frank first hit. Don't see a problem at present. We are getting really off-topic, but that's interesting: We all know that Google is helping the Chinese government to censor their own people, so searches there can lead to completely different results. But even here in Zurich Switzerland, I get quite a different hitlist : 1) stat.ethz.ch/~statsoft/stat.programme/R.html [in German] 2) Our local CRAN mirror: stat.ethz.ch/CRAN/ 3) R - (German-language) Wikipedia about letter R: de.wikipedia.org/wiki/R 4) DVD-R - (German-language) Wikipedia de.wikipedia.org/wiki/DVD-R 5) The R Project for Statistical Computing http://www.r-project.org/ So 3/5 are related to R which sounds good, but actually these 3 are all from the first twenty: 3/20. Martin Interesting. I just tried www.google.ca and got 1) The R Project for Statistical Computing http://www.r-project.org/ 2) Wikipedia on the letter R (which also does mention the R software). 3) CRAN: cran.r-project.org 4) R Commander with a pretty respectable number of hits in the next 50, and the sponsored link is Mango Solutions provide training and consulting on the R language. Paul On 2/6/07, Wensui Liu [EMAIL PROTECTED] wrote: I've been looking for job that allows me to use R/S+ since I got out of graduate school 2 years ago but with no success. I am wondering if there is something that can be done to promote the use of R in industry. It's been very frustrating to see people doing statistics using excel/spss and even more frustrating to see people paying $$$ for something much inferior to R. On 2/6/07, Doran, Harold [EMAIL PROTECTED] wrote: The other day, CNN had a story on working at Google. Out of curiosity, I went to the Google employment web site (I'm not looking, but just curious). In perusing their job posts for statisticians, preference is given to those who use R and python. Other languages, S-Plus and something called SAS were listed as lower priorities. When I started using Python, I noted they have a portion of the web site with job postings. CRAN does not have something similar, but think it might be useful. I think R is becoming more widely used in industry and I wonder if helping it move along a bit, the maintainer of CRAN could create a section of the web site devoted to jobs where R is a requirement. Hence, we could have our own little monster.com kind of thing going on. Of the multitude of ways the gospel can be spread, this is small. But, I think every small step forward is good. Anyone think this is useful? Harold [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- WenSui Liu A lousy statistician who happens to know a little programming (http://spaces.msn.com/statcompute/blog) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Frank -- Frank E Harrell Jr Professor and Chair School of Frank Medicine Department of Biostatistics Vanderbilt Frank University Frank __ Frank R-help@stat.math.ethz.ch mailing list Frank
[R] blank upper or lower triangle of cor-matrix
Dear altogether, I want to blank the lower (or upper) part of a correlation matrix as it is done by dist() example: ( d - cor(matrix(runif(12),nrow=4)) ) If I do the following d[lower.tri(d)] - of course everything is changed to character - that's not what should be. Additionally, it does not work to assign 0 or anything else. The same is true for assigning NA. However, what I want is like the following: ( dist(matrix(runif(12),nrow=4)) ) Looking into dist(), it seems that the calculation and the matrix are done in C and not in plain R. How can I realize it? thanks! best, leo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Sample Poisson Distribution
On 07-Feb-07 Thor wrote: Hi, I'm completely new to R, I am all at sea with the interface and the confusing help files, so would appreciate some help to do a simple task. Need to present the mean and variance of 100 different samples of poisson distributions (N=1000, with fixed lambda) in a file in two columnns, and then produce histograms. So far I have figured out: N - 1000 x - rpois(N, 3.1) , Comment: The Poisson distribution has only one parameter, lambda, so it should be rpois(N, lambda), e.g. rpois(N, 3). You will get an error with your second parameter 1. and var(x) and mean(x) , and I've seen the hist command, just need to tie it all together. I read that loops aren't really used in R, so what do i need to do? Since you're completely new, there are features of how R handles things in its data structures which are very useful for this kind of thing. In this case, the trick is that if you construct a matrix out of a single vector with many elements in it, R will fill in the columns from the vector working down each column anf then from left to right. For example: matrix(c(1,2,3,4,5,6),ncol=2) [,1] [,2] [1,]14 [2,]25 [3,]36 So you can get all 100 samples into 100 columns of a matrix A with N rows as N-1000; Nsamp-100 A - matrix(rpois(N*Nsamp, 3),ncol=Nsamp) See ?matrix for a summary of the above. Then (though here it's not quite clear what you really want) you can put the mean of each of the 100 columns into one column of your results, and the variance of each column into the next column of results, obtaining a matrix with 100 rows and 2 columns: So now you need to get the mean and varuance of each column of A. If you just try mean(A) you will get one number, because R will simply calculate the mean of all the numbers in A. The function to use here is apply(): means-apply(A,2,mean) vars -apply(A,2,var) since this works along the 2nd dimension of A (i.e. the columns) and calculates the mean for each one, and the variance fo each one. You can tie it all together in one operation by using cbind(), which assembles a collection of vectors (all theaame length) into columns side by side and makes a matrix ofthem: Result - cbind(means, vars) or, without the intermediate calculation, Result - cbind(apply(A,2,mean), apply(A,2,var)) (However, it will be useful later to have the separate intermediate results). At this stage I'm really not sure whatyou exactly want, since you don't say what you want the histograms of. But I'm going to guess that you want the histograms of the 100 means, and the 100 variances. You can do this either with hist(means) hist(vars) or equivalently with hist(Result[,1]) hist(Result[,2]) In R there are many possibilities for neat manoevres of this kind, and I tend to agree that they are not always easily found by people new to R. It's well worth reading the introductory documentation for R, under Documentation on the CRAN website, especially An Introduction to R and (under Contributed Documentation) Using R for Data Analysis and Graphics - Introduction, Examples and Commentary, Simple R, Practical Regression and Anova using R and R for Beginners. You will find several examples of data manipulation techniques in these. Once you get used to R you will be using them all the time. Best wishes, and good luck with R! Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 07-Feb-07 Time: 18:51:52 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] fill-in a table of pairs
How about this: x 12 1 joe 0.45 2 mike 0.34 3 jim 0.25 combine - combn(3, 2) combine [,1] [,2] [,3] [1,]112 [2,]233 ans - cbind(x[combine[1,],2], x[combine[2,], 2]) rownames(ans) - paste(x[combine[1,], 1], x[combine[2,], 1], sep='.') ans [,1] [,2] joe.mike 0.45 0.34 joe.jim 0.45 0.25 mike.jim 0.34 0.25 On 2/7/07, Serguei Kaniovski [EMAIL PROTECTED] wrote: Hallo, I have a table of names and values: joe 0.45 mike 0.34 jim 0.25 I would like to fill-in a table of all pairs of names (which I aleady have) joe.mike NA NA joe.jim NA NA mike.jim NA NA with the values from the first table in the order of the pairs. The outcome looks like joe.mike 0.45 0.34 joe.jim 0.45 0.25 mike.jim 0.34 0.25 Thanks a lot, Serguei [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] blank upper or lower triangle of cor-matrix
You can try as.dist(d) Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leo Gürtler Sent: Wednesday, February 07, 2007 1:36 PM To: r-help@stat.math.ethz.ch Subject: [R] blank upper or lower triangle of cor-matrix Dear altogether, I want to blank the lower (or upper) part of a correlation matrix as it is done by dist() example: ( d - cor(matrix(runif(12),nrow=4)) ) If I do the following d[lower.tri(d)] - of course everything is changed to character - that's not what should be. Additionally, it does not work to assign 0 or anything else. The same is true for assigning NA. However, what I want is like the following: ( dist(matrix(runif(12),nrow=4)) ) Looking into dist(), it seems that the calculation and the matrix are done in C and not in plain R. How can I realize it? thanks! best, leo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Sample Poisson Distribution
On 07-Feb-07 Ted Harding wrote: On 07-Feb-07 Thor wrote: [...] So far I have figured out: N - 1000 x - rpois(N, 3.1) , Comment: The Poisson distribution has only one parameter, lambda, so it should be rpois(N, lambda), e.g. rpois(N, 3). You will get an error with your second parameter 1. OOOPS!! My eyesight let me down here, or else it was a speck on my computer screen! Of course I now see it is 3.1 and not 3,1, so wherever I wrote 3 before it should be 3.1! Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 07-Feb-07 Time: 19:10:18 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] blank upper or lower triangle of cor-matrix
And if you want to know how it is done, take a look at stats:::print.dist -Christos -Original Message- From: Christos Hatzis [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 07, 2007 2:16 PM To: 'Leo Gürtler'; 'r-help@stat.math.ethz.ch' Subject: RE: [R] blank upper or lower triangle of cor-matrix You can try as.dist(d) Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leo Gürtler Sent: Wednesday, February 07, 2007 1:36 PM To: r-help@stat.math.ethz.ch Subject: [R] blank upper or lower triangle of cor-matrix Dear altogether, I want to blank the lower (or upper) part of a correlation matrix as it is done by dist() example: ( d - cor(matrix(runif(12),nrow=4)) ) If I do the following d[lower.tri(d)] - of course everything is changed to character - that's not what should be. Additionally, it does not work to assign 0 or anything else. The same is true for assigning NA. However, what I want is like the following: ( dist(matrix(runif(12),nrow=4)) ) Looking into dist(), it seems that the calculation and the matrix are done in C and not in plain R. How can I realize it? thanks! best, leo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Singular Gradient
I tried to fit data with the following function: fit-nls(y~ Is*(1-exp(-l*x))+Iph,start=list(Is=-2e-5,l=2.3,Iph=-0.3 ),control=list(maxiter=500,minFactor=1/1,tol=10e-05),trace=TRUE) But I get only a singular Gradient warning... the data can by found attached(there are two sampels of data col 1/2 and 3/4). I tried to fix it by chanching the start parameters but that didn't solve the problem. Would it be a possibiliti to use the selfstart Model? How? Thanks for any answers This __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] isoMDS - high stress value and strange configuration
Dear R users, I have a specific question about isoMDS. Imagine the following (fake) distance table: hamburg bremen berlin munich cologne hamburg 0911982677 424 bremen 911 0293547 513 berlin 982293 0785 875 munich 677547785 0 375 cologne 424513875375 0 Now if I try a non-metric multidimensional scaling on these dissimilarities using isoMDS (or metaMDS), the stress value is 6.34. Nevertheless, other programs (e.g. the Minissa routine implemented in UCINet) yield a stress value of 0.00, and the configuration looks completely different. I tried this with multiple distance matrices: One time UCINet computed a stress value of 0.21 while isoMDS produced a stress of 0.33, and again the configuration was completely different and apparently random (while the configuration in UCINet still made sense). Here is what I tried: isoMDS(cities, y = cmdscale(cities, k = 2), k = 2, maxit = 50) Please give me a hint on how to improve the results. I suppose the above command is not complete, or something is wrong with it, or maybe the input distances are not in the right format. Btw, the problem does not occur when I use the real distances between these cities, not some other numbers, so apparently three-digit numbers should be fine as input values? Thanks! Phil __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Plotting groupedData objects
Hi all. I have what I'm guessing is a fairly easy question. I want to plot groupedData objects, but there are a large number of subjects in my data. When I use the simple command plot(MyData) where MyData is a groupedData object, there are simply too many individual plots to see anything. I would like, say, 15 per page and for the plots to cover multiple pages. All of the individuals have a different number of time points (this is in a longitudinal context). I wasn't able to find a straightforward solution. On an unrelated note, why does nlsList, for example, return the matrix of coefficients in a different order than the original data set (i.e., the row numbers are all mixed up)? I find it hard to convert this back to the way in which the data were input. I'm guessing there is a good reason, so I'm interested in hearing it. Thanks for any help, Ken - Sucker-punch spam with award-winning protection. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] XML and str
Ashley == Ashley Ford [EMAIL PROTECTED] on Wed, 07 Feb 2007 17:18:56 + writes: Ashley If I read in an .xml file eg with xeg - xmlTreeParse(system.file(exampleData, test.xml, package=XML)) Ashley It appears to be OK however examining it with str() gives an apparent Ashley error str(xeg, 2) Ashley List of 2 Ashley $ doc:List of 3 Ashley ..$ file: list() Ashley .. ..- attr(*, class)= chr [1:2] XMLComment XMLNode Ashley ..$ version :List of 4 Ashley .. ..- attr(*, class)= chr XMLNode Ashley ..$ children:Error in obj$children[[...]] : subscript out of bounds Ashley I am unsure if this is a feature or a bug and if the latter whether it Ashley is in XML or str, it is not causing a problem but I would like to Ashley understand what is happening, any ideas ? Yes - thank you for providing a well-reproducible example. After setting options(error = recover) I do obj - xeg$doc mode(obj) # list [1] list is.list(obj) # TRUE [1] TRUE length(obj) # 3 [1] 3 obj[[3]] # --- the error you see above. Error in obj$children[[...]] : subscript out of bounds Enter a frame number, or 0 to exit 1: obj[[3]] 2: `[[.XMLDocumentContent`(obj, 3) Selection: 0 obj$children # works, should be identical to obj[[3]] $comment !--A comment-- $foo foo x=1 element attrib1=my value/ .. This shows that the XML package implements the [[ method wrongly IMHO and also inconsistently with the $ method. From a strict OOP view, the XML author could argue that this is not a bug in XML but rather str() which assumes that x[[length(x)]] works for objects of mode list even when they are not of *class* list, but I hope he would still rather consider changing [[.XMLDocumentContent ... Martin Ashley examining components eg str(xeg$doc$children,2) Ashley List of 2 Ashley $ comment: list() Ashley ..- attr(*, class)= chr [1:2] XMLComment XMLNode Ashley etc Ashley is OK. Ashley XML Version 1.4-1, Ashley same behaviour on Windows and Linux, R version 2.4.1 (2006-12-18) Ashley The information contained in this E-Mail and any subsequent Ashley correspondence is private and is intended solely for the intended Ashley recipient(s). The information in this communication may be confidential Ashley and/or legally privileged. Nothing in this e-mail is intended to Ashley conclude a contract on behalf of QinetiQ or make QinetiQ subject to any Ashley other legally binding commitments, unless the e-mail contains an express Ashley statement to the contrary or incorporates a formal Purchase Order. Ashley For those other than the recipient any disclosure, copying, Ashley distribution, or any action taken or omitted to be taken in reliance on Ashley such information is prohibited and may be unlawful. Ashley Emails and other electronic communication with QinetiQ may be monitored Ashley and recorded for business purposes including security, audit and Ashley archival purposes. Any response to this email indicates consent to Ashley this. Ashley Telephone calls to QinetiQ may be monitored or recorded for quality Ashley control, security and other business purposes. Ashley QinetiQ Group plc, Ashley Company Registration No: 4586941, Ashley Registered office: 85 Buckingham Gate, London SW1E 6PD Ashley __ Ashley R-help@stat.math.ethz.ch mailing list Ashley https://stat.ethz.ch/mailman/listinfo/r-help Ashley PLEASE do read the posting guide http://www.R-project.org/posting-guide.html Ashley and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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 with subsets and xyplot
Hello I have a dataframe that looks like this MSA CITY HIVEST YEAR YR CAT 1 0200 Albuquerque 0.50 1996 1996 5 2 0520 Atlanta13.00 1997 1997 5 3 0720 Baltimore 29.10 1994 1994 1 4 0720 Baltimore 13.00 1995 1995 5 5 0720 Baltimore 3.68 1996 1996 3 6 0720 Baltimore 9.00 1997 1997 5 7 0720 Baltimore 11.00 1998 1998 5 8 0875 Bergen-Passaic 51.80 1990 1990 5 many more rows I would like to create some xyplots, but separately for MSAs that are high, moderate or low on HIVEST. Here's what I tried READ IN DATA AND RECODE SOME VARIABLES attach(hivest) cat - CAT cat[cat 5] - 6 msa - as.numeric(MSA) msa[msa == 7361] - 7360 msa[msa == 7362] - 7360 msa[msa == 7363] - 7360 msa[msa == 5601] - 5600 msa[msa == 5602] - 5600 msa[msa == 6484] - 6483 FIND MEANS FOR EACH MSA, FOR SUBSETTING LATER meanbymsa - aggregate(HIVEST, by = list(msa), FUN = mean, na.rm = T) meanbymsa[,2] gives me the column I want; the 25%tile of this column is about 3.1. but when I try plot1 - xyplot(HIVEST~YEAR|as.factor(msa), pch = LETTERS[cat], subset = (meanbymsa[,2] 3.1)) plot1 I don't get what I expect. No errors, and it is a subset, but the subset is NOT MSAs with low values of HIVEST. Any help appreciated. Peter Peter L. Flom, PhD Assistant Director, Statistics and Data Analysis Core Center for Drug Use and HIV Research National Development and Research Institutes 71 W. 23rd St http://cduhr.ndri.org www.peterflom.com New York, NY 10010 (212) 845-4485 (voice) (917) 438-0894 (fax) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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 with subsets and xyplot
?aggregate says: ... the result is reformatted into a data frame containing the variables in by and x. The ones arising from by contain the unique combinations of grouping values used for determining the subsets, and the ones arising from x the corresponding summary statistics for the subset of the respective variables in x. so meansbymsa does not have the same number of rows as your original data frame, which it must for subsetting to work properly (meansbymsa[,2] was recycled to be of the right length by default, which produces the nonsense you got. See ?xyplot) Bert Gunter Genentech Nonclinical Statistics South San Francisco, CA 94404 650-467-7374 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Flom Sent: Wednesday, February 07, 2007 12:10 PM To: [EMAIL PROTECTED] Subject: [R] Problem with subsets and xyplot Hello I have a dataframe that looks like this MSA CITY HIVEST YEAR YR CAT 1 0200 Albuquerque 0.50 1996 1996 5 2 0520 Atlanta13.00 1997 1997 5 3 0720 Baltimore 29.10 1994 1994 1 4 0720 Baltimore 13.00 1995 1995 5 5 0720 Baltimore 3.68 1996 1996 3 6 0720 Baltimore 9.00 1997 1997 5 7 0720 Baltimore 11.00 1998 1998 5 8 0875 Bergen-Passaic 51.80 1990 1990 5 many more rows I would like to create some xyplots, but separately for MSAs that are high, moderate or low on HIVEST. Here's what I tried READ IN DATA AND RECODE SOME VARIABLES attach(hivest) cat - CAT cat[cat 5] - 6 msa - as.numeric(MSA) msa[msa == 7361] - 7360 msa[msa == 7362] - 7360 msa[msa == 7363] - 7360 msa[msa == 5601] - 5600 msa[msa == 5602] - 5600 msa[msa == 6484] - 6483 FIND MEANS FOR EACH MSA, FOR SUBSETTING LATER meanbymsa - aggregate(HIVEST, by = list(msa), FUN = mean, na.rm = T) meanbymsa[,2] gives me the column I want; the 25%tile of this column is about 3.1. but when I try plot1 - xyplot(HIVEST~YEAR|as.factor(msa), pch = LETTERS[cat], subset = (meanbymsa[,2] 3.1)) plot1 I don't get what I expect. No errors, and it is a subset, but the subset is NOT MSAs with low values of HIVEST. Any help appreciated. Peter Peter L. Flom, PhD Assistant Director, Statistics and Data Analysis Core Center for Drug Use and HIV Research National Development and Research Institutes 71 W. 23rd St http://cduhr.ndri.org www.peterflom.com New York, NY 10010 (212) 845-4485 (voice) (917) 438-0894 (fax) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] heteroscedasticity problem
Dear Listers, I have a regression problem (x-y) with biological data, where x influences y in two ways, (1) y increases with x and (2) the variation around the mean (residuals) decreases with increasing x, i.e. y becomes more 'predictable' as x increases. The relationship is saturating, y~a + bx + cx^2, gives a very good fit. I know basically how to test for heteroscedasticity. My question is if there is an elegant regression method, which captures both, the mean and the (non-constant) variation around the mean. Such a method would ideally yield an estimate of the mean and its variation, both as a function of x. The pattern corresponds very well to some established ecological theory (each x is the species richness of a community of primary producers, y is the productivity of each community; productivity and its predictability both increase with increasing species richness). Apologies for the probably clumsy decription of my problem - I am ecologist, not statistician (but a big fan of R). Cheers, Robert Robert Ptacnik Norwegian Institute for Water Research (NIVA) Gaustadalléen 21 NO-0349 Oslo FON +47 982 277 81 FAX +47 221 852 00 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] heteroscedasticity problem
If you haven't already you might want to take a look at: http://www.econ.uiuc.edu/~roger/research/rq/QReco.pdf which is written by and for ecologists. url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Champaign, IL 61820 On Feb 7, 2007, at 2:52 PM, [EMAIL PROTECTED] wrote: Dear Listers, I have a regression problem (x-y) with biological data, where x influences y in two ways, (1) y increases with x and (2) the variation around the mean (residuals) decreases with increasing x, i.e. y becomes more 'predictable' as x increases. The relationship is saturating, y~a + bx + cx^2, gives a very good fit. I know basically how to test for heteroscedasticity. My question is if there is an elegant regression method, which captures both, the mean and the (non-constant) variation around the mean. Such a method would ideally yield an estimate of the mean and its variation, both as a function of x. The pattern corresponds very well to some established ecological theory (each x is the species richness of a community of primary producers, y is the productivity of each community; productivity and its predictability both increase with increasing species richness). Apologies for the probably clumsy decription of my problem - I am ecologist, not statistician (but a big fan of R). Cheers, Robert Robert Ptacnik Norwegian Institute for Water Research (NIVA) Gaustadalléen 21 NO-0349 Oslo FON +47 982 277 81 FAX +47 221 852 00 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] setting a number of values to NA over a data.frame.
This is probably a simple problem but I don't see a solution. I have a data.frame with a number of columns where I would like 0 - NA thus I have df1[,144:157] - NA if df1[, 144: 157] ==0 and df1[, 190:198] - NA if df1[, 190:198] ==0 but I cannot figure out a way do this. cata - c( 1,1,6,1,1,NA) catb - c( 1,2,3,4,5,6) doga - c(3,5,3,6,4, 0) dogb - c(2,4,6,8,10, 12) rata - c (NA, 9, 9, 8, 9, 8) ratb - c( 1,2,3,4,5,6) bata - c( 12, 42,NA, 45, 32, 54) batb - c( 13, 15, 17,19,21,23) id - c('a', 'b', 'b', 'c', 'a', 'b') site - c(1,1,4,4,1,4) mat1 - cbind(cata, catb, doga, dogb, rata, ratb, bata, batb) data1 - data.frame(site, id, mat1) data1 # Obviously this works fine for one column data1$site[data1$site ==1] - NA ; data1 but I cannot see how to do this with indices that would allow me to do more than one column in the data.frame. At one point I even tried something like this a - c(site) data1$a[data1$a ==1] - NA which seems to produce a corrupt data.frame. I am sure it is simple but I don't see it. Any help would be much appreciated. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] heteroscedasticity problem
Robert: Just to provide a little follow up on Roger Koenker's response, there indeed has been some interest and publications using quantile regression for estimating species richness-productivity patterns in ecology. And Roger's quantreg package available for R is a great statistical tool to use to estimate these relationships. If you have trouble getting started or finding recent pubs, contact me off list and I will be glad to point you in productive (pun intended) directions. Brian Brian S. Cade U. S. Geological Survey Fort Collins Science Center 2150 Centre Ave., Bldg. C Fort Collins, CO 80526-8818 email: [EMAIL PROTECTED] tel: 970 226-9326 roger koenker [EMAIL PROTECTED] 02/07/2007 02:39 PM To [EMAIL PROTECTED] cc R-help list r-help@stat.math.ethz.ch, Brian S Cade [EMAIL PROTECTED] Subject Re: [R] heteroscedasticity problem If you haven't already you might want to take a look at: http://www.econ.uiuc.edu/~roger/research/rq/QReco.pdf which is written by and for ecologists. url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Champaign, IL 61820 On Feb 7, 2007, at 2:52 PM, [EMAIL PROTECTED] wrote: Dear Listers, I have a regression problem (x-y) with biological data, where x influences y in two ways, (1) y increases with x and (2) the variation around the mean (residuals) decreases with increasing x, i.e. y becomes more 'predictable' as x increases. The relationship is saturating, y~a + bx + cx^2, gives a very good fit. I know basically how to test for heteroscedasticity. My question is if there is an elegant regression method, which captures both, the mean and the (non-constant) variation around the mean. Such a method would ideally yield an estimate of the mean and its variation, both as a function of x. The pattern corresponds very well to some established ecological theory (each x is the species richness of a community of primary producers, y is the productivity of each community; productivity and its predictability both increase with increasing species richness). Apologies for the probably clumsy decription of my problem - I am ecologist, not statistician (but a big fan of R). Cheers, Robert Robert Ptacnik Norwegian Institute for Water Research (NIVA) Gaustadalléen 21 NO-0349 Oslo FON +47 982 277 81 FAX +47 221 852 00 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] setting a number of values to NA over a data.frame.
John - Your initial problem uses 0, but the example uses 1 for the value that gets an NA. My solution uses 1 to fit with your example. There may be a better way, but try something like data1[3:5] - data.frame(lapply(data1[3:5], function(x) ifelse(x==1, NA, x))) The data1[3:5] is just a test subset of columns I chose from your data1 example. Notice it appears twice, once on each side of the assignment operator. In English, apply to each column of the data frame (which is a list) a function that will return NA if the element is 1, and the value otherwise, and then turn the modified lists into a data.frame, and save it as data1. See the help files for lapply and ifelse if you haven't seen those before. Maybe someone has a better way? Erik John Kane wrote: This is probably a simple problem but I don't see a solution. I have a data.frame with a number of columns where I would like 0 - NA thus I have df1[,144:157] - NA if df1[, 144: 157] ==0 and df1[, 190:198] - NA if df1[, 190:198] ==0 but I cannot figure out a way do this. cata - c( 1,1,6,1,1,NA) catb - c( 1,2,3,4,5,6) doga - c(3,5,3,6,4, 0) dogb - c(2,4,6,8,10, 12) rata - c (NA, 9, 9, 8, 9, 8) ratb - c( 1,2,3,4,5,6) bata - c( 12, 42,NA, 45, 32, 54) batb - c( 13, 15, 17,19,21,23) id - c('a', 'b', 'b', 'c', 'a', 'b') site - c(1,1,4,4,1,4) mat1 - cbind(cata, catb, doga, dogb, rata, ratb, bata, batb) data1 - data.frame(site, id, mat1) data1 # Obviously this works fine for one column data1$site[data1$site ==1] - NA ; data1 but I cannot see how to do this with indices that would allow me to do more than one column in the data.frame. At one point I even tried something like this a - c(site) data1$a[data1$a ==1] - NA which seems to produce a corrupt data.frame. I am sure it is simple but I don't see it. Any help would be much appreciated. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] Singular Gradient
On 2/7/07, This Wiederkehr [EMAIL PROTECTED] wrote: I tried to fit data with the following function: fit-nls(y~ Is*(1-exp(-l*x))+Iph,start=list(Is=-2e-5,l=2.3,Iph=-0.3 ),control=list(maxiter=500,minFactor=1/1,tol=10e-05),trace=TRUE) But I get only a singular Gradient warning... Did you get any trace output at all? It is not clear if you got the singular gradient warning before the first iteration completed, which means there is a problem at the starting estimates, or after a few iterations. Without the data it is difficult to decide. the data can by found attached(there are two sampels of data col 1/2 and 3/4). Thanks for offering to include the data. My copy of your message did not have the data enclosed. Did you perhaps forget to attach the file? I tried to fix it by chanching the start parameters but that didn't solve the problem. Would it be a possibiliti to use the selfstart Model? How? Yes. Try SSasymp. I believe that model is equivalent to your model but in a different parameterization. Thanks for any answers This __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] setting a number of values to NA over a data.frame.
Works beautifully. I modified it a bit to handle the discontinous ranges to: a - c(3:4, 8) data1[a] - data.frame(lapply(data1[a], function(x) ifelse(x==1, NA, x))) There may be a prettier way to handle the disconituity but this works so it looks like I'm in good shape. I had looked at ifelse and at apply (not lapply) but did not think to put them together. Thanks Thanks very muc --- Erik Iverson [EMAIL PROTECTED] wrote: John - Your initial problem uses 0, but the example uses 1 for the value that gets an NA. My solution uses 1 to fit with your example. There may be a better way, but try something like data1[3:5] - data.frame(lapply(data1[3:5], function(x) ifelse(x==1, NA, x))) The data1[3:5] is just a test subset of columns I chose from your data1 example. Notice it appears twice, once on each side of the assignment operator. In English, apply to each column of the data frame (which is a list) a function that will return NA if the element is 1, and the value otherwise, and then turn the modified lists into a data.frame, and save it as data1. See the help files for lapply and ifelse if you haven't seen those before. Maybe someone has a better way? Erik John Kane wrote: This is probably a simple problem but I don't see a solution. I have a data.frame with a number of columns where I would like 0 - NA thus I have df1[,144:157] - NA if df1[, 144: 157] ==0 and df1[, 190:198] - NA if df1[, 190:198] ==0 but I cannot figure out a way do this. cata - c( 1,1,6,1,1,NA) catb - c( 1,2,3,4,5,6) doga - c(3,5,3,6,4, 0) dogb - c(2,4,6,8,10, 12) rata - c (NA, 9, 9, 8, 9, 8) ratb - c( 1,2,3,4,5,6) bata - c( 12, 42,NA, 45, 32, 54) batb - c( 13, 15, 17,19,21,23) id - c('a', 'b', 'b', 'c', 'a', 'b') site - c(1,1,4,4,1,4) mat1 - cbind(cata, catb, doga, dogb, rata, ratb, bata, batb) data1 - data.frame(site, id, mat1) data1 # Obviously this works fine for one column data1$site[data1$site ==1] - NA ; data1 but I cannot see how to do this with indices that would allow me to do more than one column in the data.frame. At one point I even tried something like this a - c(site) data1$a[data1$a ==1] - NA which seems to produce a corrupt data.frame. I am sure it is simple but I don't see it. Any help would be much appreciated. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] path for source()
hello, i have a couple of .R files distributed about my file system. i commonly source() these from other files, but i have to include the full file path. this is not always convenient if you move files around. is there a way of setting the search path for source()? thanks a lot! cheers, andrew. -- Andrew B. Collier Space Physics Group Hermanus Magnetic Observatory Honorary Research Fellowtel: +27 31 2601157 Space Physics Research Institutefax: +27 31 2616550 University of KwaZulu-Natal, Durban, 4041, South Africa gsm: +27 83 3813655 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/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] isoMDS - high stress value and strange configuration
I have a specific question about isoMDS. Imagine the following (fake) distance table: hamburg bremen berlin munich cologne hamburg 0911982677 424 bremen 911 0293547 513 berlin 982293 0785 875 munich 677547785 0 375 cologne 424513875375 0 Now if I try a non-metric multidimensional scaling on these dissimilarities using isoMDS (or metaMDS), the stress value is 6.34. Nevertheless, other programs (e.g. the Minissa routine implemented in UCINet) yield a stress value of 0.00, and the configuration looks completely different. This indeed seems to be a case where NMDS is trapped in its starting configuration. Metric scaling (cmdscale) produces a cute horseshoe, but the best NMDS solutions looks completely different. Any small change from the initial solution leads into a worse configuration, and you need a bigger change in the beginning. Using a random configuration seems to help: isoMDS(dis, initMDS(dis)) initial value 36.383132 iter 5 value 28.671652 iter 10 value 16.711327 iter 15 value 6.392572 iter 20 value 3.007208 final value 0.00 converged $points [,1] [,2] hamburg 29.428121 -36.07858 bremen2.740499 32.38745 berlin1.984215 35.35429 munich -16.910941 -14.13750 cologne -13.844187 -15.24468 $stress [1] 1.56159e-14 In this case I generated the random configuration using function initMDS of vegan, but you can do that quite well by any other way. Another point (which does not matter here so much) is that isoMDS multiplies stress by 100, so that your stress of 6 would corresponde 0.06 in some other software (assuming they use the same stress). cheers, jari oksanen -- Jari Oksanen [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.