[R] any linear programming routine in R
Dear all is there any linear programming routine available for R? if not, can you suggest any alternatives? not need to be very powerful, I get only a samll problem to resolve. many thanks yong __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] load function to R GUI
The first menu item on the `File' menu is called `Source R code' and calls source(). Did you look through the menus? If not, it would be worth familiarizing yourself with them. On Mon, 14 Jun 2004, Evgueni Parilov wrote: Thanks! That was exactly what I wanted. Evgueni Ko-Kang Kevin Wang wrote: Hi, -Original Message- From: [EMAIL PROTECTED] Hi all! I looked through the manual and FAQ, and did not find any information on how to load functions from files (with .R extension) to run them in R GUI under Windows. The only way I know is to create and edit a function inside GUI. But what if I want to edit it in Emacs (do not want to use ESS) and then load into GUI? Any suggestions... Do you mean ?source? i.e. save your function in, say, foo.R then use the source() function to get it in. HTH Kevin __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Clear Console
Enrique Bengoechea wrote: Hi, Could someone please point to me which function clears the R console under Windows? (exactly what the R Gui Windows menu Edit Clear Console does). Seems simple but I haven't been succesful with the help system (help.search for console, clear console, screen...) nor on the list archives. Thanks in advance!! Looking into the sources tells you that there is no R function to do so. Either use the menu or press Ctrl+L. Uwe Ligges Enrique __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] installing my own package - problems with INDEX
Hi there; I am a neophyte to R though I have been messing around with programming in other languages and environments for some years (my dog's name is punchcard to give you some idea of how many years). I have been trying to make a package and install it, to no avail. The functions I have written all work as expected (by me, that is). But I cannot get the html help pages to work. The failure appears to be in creating the INDEX file. No matter how carefully I check all of my *.Rd pages, the error message that I have unbalanced braces keeps showing up. I cannot find any error in matching braces. I am using Alpha as the editor, and it identifies mismatched braces - there are none in the *.Rd file. Another aspect of this problem is that the INDEX file only contains one line, that of the first file. However, the html dir has an index file (00Index.html) that contains all of the functions I have documented, but they are all linked to the same identical function web page - the first one. Please give me a hint. There are no mismatched braces as far as I can tell. Even when I try to check a single function and its Rd file, I get the same error message. And there are no other error messages. The package can be attached and the functions work, but the help pages do not. I must be doing something really simple, but very wrong. What are the 5 most common first mistakes some one makes in Rd files? thanks -ph __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] any linear programming routine in R
On Tue, 15 Jun 2004, Yong Wang wrote: is there any linear programming routine available for R? Yes. help.search shows print.simplex(boot) Print Solution to Linear Programming Problem simplex(boot) Simplex Method for Linear Programming Problems simplex.object(boot)Linear Programming Solution Objects solveLP(linprog)solve Linear Programming / Optimization problems lp.object(lpSolve) LP (linear programming) object You would have found linprog and lpsolve by looking in the R FAQ's list of packages. if not, can you suggest any alternatives? not need to be very powerful, I get only a samll problem to resolve. You asked on S-news too. `boot' is also available for S-PLUS. -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Quadruple precision in R
On Mon, 14 Jun 2004, Ravi Varadhan wrote: Is it possible to perform computations in quadruple precision (more generally, with more digits in the floating-point arithmetic than that allowed by double precision) in R? You are making the assumption that R uses double precision. Whereas R uses C type `double', some compilers may allow you to allocate that to an extended precision type. However, the most commonly used platforms and compilers for R have no hardware or software support for `quadruple precision', and it seems to have gone out of fashion. Why do you ask? The data in the calculations is unlikely to be anything like as accurate as standard double precision, and well-written algorithms usually manage to give answers to within a hundred or so times that precision. Unless, that is, the problem is ill conditioned, in which case the exact answer will be sensitive to minute inaccuracies in the data (as popularized by Lorenz's butterfly effect). The only times I have ever needed extended precision were - to handle exact calculations on very large integers and - on such ill-conditioned problems. One example was to explore the fine structure of pseudo-random number generators. These days I would use an arbitrary-precision integer computation package (and computer algebra packages often have such facilities). -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Parsing results from boot
Scott == Scott Norton [EMAIL PROTECTED] on Tue, 15 Jun 2004 00:09:03 -0400 writes: Scott This probably has a super easy answer...but I claim Scott newbie status! (I did search help lists but this Scott question is hard to isolate keyword-wise) Scott Basically, I'm trying to figure out how to parse the Scott results from executing boot(). I'm mainly interested Scott in assigning the standard error estimate to a scalar Scott variable. Scott For example: Scott -- b-c(100,100,120,130,1000,1200,1100,1150,125) b.boot - boot(b, function(b,i) median(b[i]), R=1000) b.boot Scott ORDINARY NONPARAMETRIC BOOTSTRAP Scott Call: Scott boot(data = b, statistic = function(b, i) median(b[i]), R = 1000) Scott Bootstrap Statistics : Scott original biasstd. error Scott t1* 130 354.75450.9763 Scott -- Scott I'm interested in the value for std.error (i.e. 450.9763). Scott Now executing the folling: Scott -- summary(b.boot) Scott Length Class Mode Scott t0 1 -none- numeric Scott t 1000 -none- numeric Scott R1 -none- numeric Scott data 9 -none- numeric Scott seed 626 -none- numeric Scott statistic1 -none- function Scott sim 1 -none- character Scott call 4 -none- call Scott stype1 -none- character Scott strata 9 -none- numeric Scott weights 9 -none- numeric Scott --- which shows that summary.default() is called because there's no summary() method for 'boot' objects [comment see below]. Scott seems to imply that it's not actually assigned to an Scott output variable...but it is shown when I just type b.boot Scott Where is the std.error being assigned? Logically, it must be in the print() method for 'boot' objects.. Scott and how to I access it? Typing getS3method(print, class = boot) or getAnywhere(print.class) gives a humongous function listing, and somewhere in there t0 - boot.out$t0[index] if (is.null(boot.out$call$weights)) { op - cbind(t0, apply(t, 2, mean, na.rm = TRUE) - t0, sqrt(apply(t, 2, function(t.st) var(t.st[!is.na(t.st)] dimnames(op) - list(rn, c(original, bias , std. error)) } (which is not sufficient to understand the code). So you see that this is really computed inside the print method. If boot was programmed as we do other typical ``classes''. The print method would print much less, the summary method would compute all the interested quantities and return an object of class summary.boot and there would be a simple print.summary.boot() method. I assume Brian Ripley (as maintainer of 'boot') would accept (well-written) user contributions to implement these, instead of the current print.boot() mess^H^H^H^Himplementation. Regards, Martin Maechler __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] symbolic iteration
Dear all, I have 122 vectors named from L1 to L122. Now I hope to take log to each of the series, say L1 - log(L1) ... L122-log(L122) Can anyone show me a iterative way to make the job simple. I mean the way something like for(i in 1:122){ ... } or other similar methods. Many thanks. Jin __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] installing my own package - problems with INDEX
Hi! If I have similar problem. I first run R CMD check. Then I change to the directory mypackage.Rcheck where R CMD check generated a file mypackage-manual.tex. Then I try to compile the file using latex by myself. In addition I am using a latex error aware editor (texniccenter on windows). When I have the error pinned down in tex file, its usually quite easy to find the corresponding Rd file and then the error in the Rd file. Sincerely Eryk. *** REPLY SEPARATOR *** On 6/15/2004 at 3:14 AM Pamela Hall wrote: Hi there; I am a neophyte to R though I have been messing around with programming in other languages and environments for some years (my dog's name is punchcard to give you some idea of how many years). I have been trying to make a package and install it, to no avail. The functions I have written all work as expected (by me, that is). But I cannot get the html help pages to work. The failure appears to be in creating the INDEX file. No matter how carefully I check all of my *.Rd pages, the error message that I have unbalanced braces keeps showing up. I cannot find any error in matching braces. I am using Alpha as the editor, and it identifies mismatched braces - there are none in the *.Rd file. Another aspect of this problem is that the INDEX file only contains one line, that of the first file. However, the html dir has an index file (00Index.html) that contains all of the functions I have documented, but they are all linked to the same identical function web page - the first one. Please give me a hint. There are no mismatched braces as far as I can tell. Even when I try to check a single function and its Rd file, I get the same error message. And there are no other error messages. The package can be attached and the functions work, but the help pages do not. I must be doing something really simple, but very wrong. What are the 5 most common first mistakes some one makes in Rd files? thanks -ph __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic Ihnestrasse 63-73 14195 Berlin 'v' tel: 0049-30-83875219 / \ mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Parsing results from boot
On Tue, 15 Jun 2004, Martin Maechler wrote: If boot was programmed as we do other typical ``classes''. The print method would print much less, the summary method would compute all the interested quantities and return an object of class summary.boot and there would be a simple print.summary.boot() method. I assume Brian Ripley (as maintainer of 'boot') would accept (well-written) user contributions to implement these, instead of the current print.boot() mess^H^H^H^Himplementation. Only if Angelo Canty (the author) was happy too. If anyone is thinking of doing this, please discuss it with Angelo first. -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] symbolic iteration
I don't see why this needs to be iterative: the computations could be done in parallel. But via a for loop you could use for(i in 1:122) { nm - paste(L, i, sep=) assign(nm, log(get(nm)) } You would do better, I think, to have 122 similar data items in a list. datalist - lapply(1:122, function(x) get(paste(L, x, sep=))) Then you could just do logdatalist - lapply(datalist, log) and so on. On Tue, 15 Jun 2004, Jin Shusong wrote: I have 122 vectors named from L1 to L122. Now I hope to take log to each of the series, say L1 - log(L1) ... L122-log(L122) Can anyone show me a iterative way to make the job simple. I mean the way something like for(i in 1:122){ ... } or other similar methods. -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Glueing factors together
Hi folks, Suppose I have a series of cases each with categorical factors A, B. What is the best way to glue A and B together into a single factor? For example, given A0 B1 ... A1 B1 ... A0 B2 ... A1 B0 ... A0 B0 ... A1 B2 ... then I'd like to end up with a single factor with levels A0B0, A0B1, A0B2, A1B0, A1B1, A1B2 according to all the combinations which actually occur in the data (e.g. if (A1,B2) did not occur in the data, then A1B2 would not be a level in the resulting glued factor). I can see clumsy and tedious ways involving manipulating strings, paste(), etc.; but I'm sure it must be possible more elegantly. With thanks, and best wishes to all, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 167 1972 Date: 15-Jun-04 Time: 09:26:06 -- XFMail -- __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] symbolic iteration
Dear Jin, you could try something like, L1 - runif(10) L2 - runif(20) L3 - runif(30) L4 - runif(40) res - vector(mode=list, length=4) ss - paste(log(L, 1:4, ), sep=) for(i in 1:4) res[[i]] - eval(parse(text=ss[i])) res I hope this helps. Best, Dimitris Dimitris Rizopoulos Doctoral Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/396887 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm - Original Message - From: Jin Shusong [EMAIL PROTECTED] To: R Help [EMAIL PROTECTED] Sent: Tuesday, June 15, 2004 10:06 AM Subject: [R] symbolic iteration Dear all, I have 122 vectors named from L1 to L122. Now I hope to take log to each of the series, say L1 - log(L1) ... L122-log(L122) Can anyone show me a iterative way to make the job simple. I mean the way something like for(i in 1:122){ ... } or other similar methods. Many thanks. Jin __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Parsing results from boot
Prof Brian Ripley [EMAIL PROTECTED] writes: On Tue, 15 Jun 2004, Martin Maechler wrote: If boot was programmed as we do other typical ``classes''. The print method would print much less, the summary method would compute all the interested quantities and return an object of class summary.boot and there would be a simple print.summary.boot() method. I assume Brian Ripley (as maintainer of 'boot') would accept (well-written) user contributions to implement these, instead of the current print.boot() mess^H^H^H^Himplementation. Only if Angelo Canty (the author) was happy too. If anyone is thinking of doing this, please discuss it with Angelo first. If someone is feeling up to the necessary brow-beating, he/she might want to apply it to Terry Therneau and summary.coxph as well. Of course it is somewhat discouraging that neither Brian nor Thomas seem to have been successful in getting the point across -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Glueing factors together
(Ted Harding) [EMAIL PROTECTED] writes: ... then I'd like to end up with a single factor with levels A0B0, A0B1, A0B2, A1B0, A1B1, A1B2 according to all the combinations which actually occur in the data (e.g. if (A1,B2) did not occur in the data, then A1B2 would not be a level in the resulting glued factor). I can see clumsy and tedious ways involving manipulating strings, paste(), etc.; but I'm sure it must be possible more elegantly. You mean like interaction()? -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] loading multiple C files to R
Hi, I am willing to load multiple C files to R, which are inter-dependent (functions used in one may be defined in other). What I was trying is to first compile all of them separately (using R CMD SHLIB ...) and then load them one by one (using dyn.load(...) ), but it doesnt work (which seems to be obvious). During loading, it was unable to recognize the functions declared in already loaded file. Please help. Is there any documentation available on this topic, other than Writing R extensions? Thanks, Utsav __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] SJava
On Mon, 14 Jun 2004, A Friend wrote: Does anyone have any experience with SJava especially on Windows? Yes, people do have experience, as searching the list archives will show you. The experiences reported tend not to be good ones (selection bias, of course). The problem tends to be that SJava was last updated in July 2002 and has not been adapted for changes in R since. I have a version for R 1.7.1 on http://www.stats.ox.ac.uk/pub/RWin. Simon Urbanek has been working on it more recently, and has a version available from http://stats.math.uni-augsburg.de/iPlots/. Further, SJava is part of the Omegahat project, not R, and looking at its lists (if currently up: it generated a configuration error for me) would yield more information. -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Glueing factors together
Dear Ted, you could try something like, dat - data.frame(V1=sample(LETTERS[1:3], 10, rep=T), V2=sample(letters[1:3], 10, rep=T)) mat - apply(as.matrix(dat), 1, function(x) paste(x, collapse=)) dat$glue - factor(mat) dat I hope this helps. Best, Dimitris Dimitris Rizopoulos Doctoral Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/396887 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm - Original Message - From: Ted Harding [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 15, 2004 10:26 AM Subject: [R] Glueing factors together Hi folks, Suppose I have a series of cases each with categorical factors A, B. What is the best way to glue A and B together into a single factor? For example, given A0 B1 ... A1 B1 ... A0 B2 ... A1 B0 ... A0 B0 ... A1 B2 ... then I'd like to end up with a single factor with levels A0B0, A0B1, A0B2, A1B0, A1B1, A1B2 according to all the combinations which actually occur in the data (e.g. if (A1,B2) did not occur in the data, then A1B2 would not be a level in the resulting glued factor). I can see clumsy and tedious ways involving manipulating strings, paste(), etc.; but I'm sure it must be possible more elegantly. With thanks, and best wishes to all, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 167 1972 Date: 15-Jun-04 Time: 09:26:06 -- XFMail -- __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] loading multiple C files to R
On Tue, 15 Jun 2004, Utsav Boobna wrote: Hi, I am willing to load multiple C files to R, which are inter-dependent (functions used in one may be defined in other). What I was trying is to first compile all of them separately (using R CMD SHLIB ...) and then load them one by one (using dyn.load(...) ), but it doesnt work (which seems to be obvious). During loading, it was unable to recognize the functions declared in already loaded file. Please help. Is there any documentation available on this topic, other than Writing R extensions? Which is sufficient, as it tells you This accepts as arguments a list of files which must be object files (with extension @file{.o}) or C, C++, or FORTRAN sources (with extensions @file{.c}, @file{.cc} or @file{.cpp} or @file{.C}, and @file{.f}, respectively). See @kbd{R CMD SHLIB --help}, or the on-line help for @code{SHLIB}, for usage information. Did you not notice `a list of files'? You should be calling R CDM SHLIB only once. -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Glueing factors together
On 15-Jun-04 Peter Dalgaard wrote: (Ted Harding) [EMAIL PROTECTED] writes: ... then I'd like to end up with a single factor with levels A0B0, A0B1, A0B2, A1B0, A1B1, A1B2 according to all the combinations which actually occur in the data (e.g. if (A1,B2) did not occur in the data, then A1B2 would not be a level in the resulting glued factor). I can see clumsy and tedious ways involving manipulating strings, paste(), etc.; but I'm sure it must be possible more elegantly. You mean like interaction()? Thanks! Yes, interaction(A,B,drop=TRUE) does it. Best wishes, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 167 1972 Date: 15-Jun-04 Time: 09:54:18 -- XFMail -- __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] loading multiple C files to R
On Tue, Jun 15, 2004 at 01:43:21AM -0700, Utsav Boobna wrote: Hi, I am willing to load multiple C files to R, which are inter-dependent (functions used in one may be defined in other). What I was trying is to first compile all of them separately (using R CMD SHLIB ...) and then load them one by one (using dyn.load(...) ), but it doesnt work (which seems to be obvious). During loading, it was unable to recognize the functions declared in already loaded file. Please help. Is there any documentation available on this topic, other than Writing R extensions? Thanks, Utsav __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Dear Utsav, I think that you missed an option in dyn.load(). You can load your program by dyn.load(your.program,local=FALSE) Good luck. Jin __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Glueing factors together
Hi, Ted: Probably not the most elegant way, but not too tedious either. a - as.factor(c(A0,A1,A2)) b - as.factor(c(B0,B1,B2)) as.vector(outer(a,b,FUN=paste,sep=)) [1] A0B0 A1B0 A2B0 A0B1 A1B1 A2B1 A0B2 A1B2 A2B2 Best, ft. -- Fernando TUSELLe-mail: Departamento de Econometría y Estadística [EMAIL PROTECTED] Facultad de CC.EE. y Empresariales Tel: (+34)94.601.3733 Avenida Lendakari Aguirre, 83 Fax: (+34)94.601.3754 E-48015 BILBAO (Spain)Secr: (+34)94.601.3740 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Glueing factors together
Apologies, disregard my former message! I overlloked the requirement that only combinations present in the data must be taken. ft. -- Fernando TUSELLe-mail: Departamento de Econometría y Estadística [EMAIL PROTECTED] Facultad de CC.EE. y Empresariales Tel: (+34)94.601.3733 Avenida Lendakari Aguirre, 83 Fax: (+34)94.601.3754 E-48015 BILBAO (Spain)Secr: (+34)94.601.3740 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] installing my own package - problems with INDEX
Pamela Hall wrote: Hi there; I am a neophyte to R though I have been messing around with programming in other languages and environments for some years (my dog's name is punchcard to give you some idea of how many years). I have been trying to make a package and install it, to no avail. The functions I have written all work as expected (by me, that is). But I cannot get the html help pages to work. The failure appears to be in creating the INDEX file. No matter how carefully I check all of my *.Rd pages, the error message that I have unbalanced braces keeps showing up. I cannot find any error in matching braces. I am using Alpha as the editor, and it identifies mismatched braces - there are none in the *.Rd file. Have you checked really carefully for Unbalanced braces? Many editors Please do so an look whether opening and closing of barces happens in the correct order. Also, watch out for escaped braces and stuff like that. Some appropriate editor might help, but don't rely on it (since it's not the parser itself). Uwe Ligges Another aspect of this problem is that the INDEX file only contains one line, that of the first file. However, the html dir has an index file (00Index.html) that contains all of the functions I have documented, but they are all linked to the same identical function web page - the first one. Please give me a hint. There are no mismatched braces as far as I can tell. Even when I try to check a single function and its Rd file, I get the same error message. And there are no other error messages. The package can be attached and the functions work, but the help pages do not. I must be doing something really simple, but very wrong. What are the 5 most common first mistakes some one makes in Rd files? thanks -ph __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] import SYSTAT .syd file?
Does anyone know how to read a SYSTAT .syd file on Linux? (Splus 6 does it, but it is easier to find a Windows box with Systat than to download their demo. I'm wondering if there is a better way than either of these options.) Jon -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page:http://www.sas.upenn.edu/~baron R search page:http://finzi.psych.upenn.edu/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] slope estimations of teeth like data
Dear all Suppose I have teeth like data similar like x - 1:200 y - 0.03*x[1:100]+rnorm(100, mean=.001, sd=.03) z - 3-rep(seq(1,100,10),each=10)*.03+rnorm(100,mean=.001, sd=.03) plot(x,c(y,z)) and I want to have a gradient estimations for some values from increasing part of data like y.agg - aggregate(diff(c(y,z)), list(rep(seq(1,200,10),each=10)[1:199]), mean) y.agg[1:10,] ##is OK, I want that y.agg[11:20,] ##is not OK, I do not want that actual data are similar but more irregular and have subsequent gradual increases and decreases, more like set.seed(1) yy-NULL for( i in 1:10) yy - c(yy,c(y,z)[1:floor(runif(1)*200)]) length(yy) [1] 1098 plot(1:1098,yy) Is there anybody who has some experience with such data, mainly how to extract only increasing portions or to filter values of yy such as only aggregated slopes from increasing parts are computed and other parts are set to NA. Sometimes actual data have so long parts of steady or even slightly increasing values at decreasing part that aggregated values are slightly positive although they are actually from decreasing portion of data. Thank you Petr Pikal [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] import SYSTAT .syd file?
Jonathan Baron [EMAIL PROTECTED] writes: Does anyone know how to read a SYSTAT .syd file on Linux? (Splus 6 does it, but it is easier to find a Windows box with Systat than to download their demo. I'm wondering if there is a better way than either of these options.) Jon -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page:http://www.sas.upenn.edu/~baron R search page:http://finzi.psych.upenn.edu/ Google turned up this thing: http://www.salford-systems.com/lfr.f (which of course we can't use in R because of the copyright. Someone might be able to abstract a format specification from it though...) -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (sans objet)
Dear users I have a problem with the dr function: dimension reduction. I give you my example, and i'll be pleased to read your comments. #let be X a matrix 50*100: library(dr); X- matrix(rnorm(50*100,5,1),50,100); #and let be Y a vector response: Y- sample(0:1,50,replace=T); #I choose (for the expérience, but in reality i don't have it) a few variables #which are censed to explain Y: index- sample(1:100,10); X[Y==1,index]-10*X[Y==1,index]; #so now I want to proceed to a logistic regression, but I don't know the vector #index. So I have to reduce the dimension of X, and that's why I use the function #dr (dr package). model- dr(Y~X,family=binomial,method=phdy); edr- dr.direction(model); #And now my problem: I hope that edr is a matrix constructed with linear #combinaison of X, prinipally the index vectors of X. But in reality it's not the #situation: library(nnet); fit-multinom(Y~.,data=data.frame(edr)); pred-predict(fit,data.frame(edr)); table(Y,pred) 0 21 0 19 thank you for tel me where is my error! best regards Benjamin Esterni Institut Paoli Calmettes France [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
R: [R] slope estimations of teeth like data
Dear Petr, Probably I don't understand exactly what you are looking for. However your plot(x,c(y,z)) suggests a broken-line model for the response c(y,x) versus the variables x. Therefore you could estimate a segmented model to obtain (different) slope (and breakpoint) estimates. See the package segmented. best, vito - Original Message - From: Petr Pikal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 15, 2004 1:11 PM Subject: [R] slope estimations of teeth like data Dear all Suppose I have teeth like data similar like x - 1:200 y - 0.03*x[1:100]+rnorm(100, mean=.001, sd=.03) z - 3-rep(seq(1,100,10),each=10)*.03+rnorm(100,mean=.001, sd=.03) plot(x,c(y,z)) and I want to have a gradient estimations for some values from increasing part of data like y.agg - aggregate(diff(c(y,z)), list(rep(seq(1,200,10),each=10)[1:199]), mean) y.agg[1:10,] ##is OK, I want that y.agg[11:20,] ##is not OK, I do not want that actual data are similar but more irregular and have subsequent gradual increases and decreases, more like set.seed(1) yy-NULL for( i in 1:10) yy - c(yy,c(y,z)[1:floor(runif(1)*200)]) length(yy) [1] 1098 plot(1:1098,yy) Is there anybody who has some experience with such data, mainly how to extract only increasing portions or to filter values of yy such as only aggregated slopes from increasing parts are computed and other parts are set to NA. Sometimes actual data have so long parts of steady or even slightly increasing values at decreasing part that aggregated values are slightly positive although they are actually from decreasing portion of data. Thank you Petr Pikal [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] AIC in glm.nb and glm(...family=negative.binomial(.))
Can anyone explain to me why the AIC values are so different when using glm.nb and glm with a negative.binomial family, from the MASS library? I'm using R 1.8.1 with Mac 0S 10.3.4. library(MASS) dfr - data.frame(c=rnbinom(100,size=2,mu=rep(c(10,20,100,1000),rep(25,4))), + f=factor(rep(seq(1,4),rep(25,4 AIC(nb1 - glm.nb(c~f, data=dfr)) [1] 1047 AIC(glm(c~f, family=negative.binomial(nb1$theta), data=dfr)) [1] -431804 Actually, the difference is already apparent with the function logLik, but I still would like to understand the difference in what is calculated in the two instances. Thank you, in advance. Ken Knoblauch Inserm U 371 Cerveau et Vision 18 avenue du Doyen Lepine 69675 Bron cedex France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: 06 84 10 64 10 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] fit.mult.impute and quantile regression
Having not tried this, it is dangerous to speculate, but it appears to me that there would be no problem passing rq arguments (crucially, only tau, the specification of the quantile of interest) to fit.mult.impute, since the call to the fitter procedure includes a ... argument. The real question would seem to be: are the assumptions underlying the imputation procedure consistent with the rq fitting, that is are they assuming something stronger than that the tauth conditional quantile function of y is linear in x? There seem to be quite a variety of options for the imputation in transcan, maybe Frank could advise on this? 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 Jun 15, 2004, at 11:52 AM, [EMAIL PROTECTED] wrote: I have a largish dataset (1025) with around .15 of the data missing at random overall, but more like .25 in the dependent variable. I am interested in modelling the data using quantile regression, but do not know how to do this with multiply imputed data (which is what the dataset seems to need). The original plan was to use qr (or whatever) from the quantreg package as the 'fitter' argument in Design's fit.mult.impute, but it is not clear whether this would work, especially as fit.mult.impute seems only to work with the default settings of its 'fitter' arguments, which rather defeats the purpose of quantile regression. Help!! ___ Most doctors use http://www.Doctors.net.uk e-mail. Move to a free professional address with spam and virus protection. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] factor analysis package
Hello everyone, is there a package/packages for factor analysis, particularly PCA? thanks, Katja Katja Löytynoja Taitoniekantie 9 A 218 40 740 Jyväskylä Finland tel.+35814 608058 cell.+35850 336 0174 [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] factor analysis package
Katja Loytynoja [EMAIL PROTECTED] writes: Hello everyone, is there a package/packages for factor analysis, particularly PCA? help.search(factor analysis) help.search(principal components) (Whether PCA qualifies as factor analysis is debatable, though...) -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] factor analysis package
R comes with support for factor analysis and PCA (*not* the same thing) in package stats which is normally loaded. Try help.search(factor analysis) help.search(principal components) On Tue, 15 Jun 2004, Katja Loytynoja wrote: Hello everyone, is there a package/packages for factor analysis, particularly PCA? PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html PLEASE DO. -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] installing my own package - problems with INDEX
Have you checked really carefully for Unbalanced braces? Many editors Please do so an look whether opening and closing of barces happens in the correct order. Also, watch out for escaped braces and stuff like that. Some appropriate editor might help, but don't rely on it (since it's not the parser itself). Uwe Ligges Yes. Alpha is a good editor, designed for programming and has a tec mode (and an R/S mode, along with many many others). It also colourizes everything so its easy to see what you're doing. I made the skeleton of the Rd file with the prompt() so I believe I have the correct structure. I have even tried to build a package of 1 function and 1 Rd file. With 1 Rd file I can count the braces! I know the file is correct. At 10:11 +0200 6/15/04, Wolski wrote: Hi! If I have similar problem. I first run R CMD check. Then I change to the directory mypackage.Rcheck where R CMD check generated a file mypackage-manual.tex. Then I try to compile the file using latex by myself. In addition I am using a latex error aware editor (texniccenter on windows). When I have the error pinned down in tex file, its usually quite easy to find the corresponding Rd file and then the error in the Rd file. Sincerely Eryk. I am not creating latex versions of the help pages. This package is for a small group of people (about 40) and only works on a specific set of non-public data, so I'm not trying to make this package work for everyone. It seems that my installation of latex is a bit skiddly-whumpus, but I haven't the time to mess with it now as I have a deadline for the R package completion. HTML files are sufficient. So, I have used the option that doesn't make latex files. however, the editor I use, alpha, has a tex mode and I've been using that since it keeps track of matching braces, indentation and colours text so I know what part of the code it is. The problem really isn't one of braces - as I said, I have tried to build it with a single function and a single Rd file,and it still gives me the same error. If I build it with 2 functions and 2 Rd file, then the same error shows up AND only the first function is indexed and the help page for the second function points to the help page for the first function. I must be doing something else wrong. Its not the braces. This is what I have done that may not be right? 1. I put all of the Rd files into 1 file with a \eof separating them. This is how it appears in already built packages, however, I haven't seen any reference to that in the R manual. But if I don't do that, R CMD check completely fails. 2. What about the functions themselves? I have tried them as separate files or concatenated into one file. The functions always appear to have been sourced and are available in R, but the help pages fail either way. 3. \keyword. Very few of my functions really fit into any of the keyword.db options. I note that there also appears to be keywords for packages that can be added (eg spatial). Can I make my own keyword and add it to the keyword.db? -ph __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] installing my own package - problems with INDEX
Maybe you can show us one of the Rd files that doesn't work, so some one on this list can see what the problem might be? Cheers, Andy From: Pamela Hall Have you checked really carefully for Unbalanced braces? Many editors Please do so an look whether opening and closing of barces happens in the correct order. Also, watch out for escaped braces and stuff like that. Some appropriate editor might help, but don't rely on it (since it's not the parser itself). Uwe Ligges Yes. Alpha is a good editor, designed for programming and has a tec mode (and an R/S mode, along with many many others). It also colourizes everything so its easy to see what you're doing. I made the skeleton of the Rd file with the prompt() so I believe I have the correct structure. I have even tried to build a package of 1 function and 1 Rd file. With 1 Rd file I can count the braces! I know the file is correct. At 10:11 +0200 6/15/04, Wolski wrote: Hi! If I have similar problem. I first run R CMD check. Then I change to the directory mypackage.Rcheck where R CMD check generated a file mypackage-manual.tex. Then I try to compile the file using latex by myself. In addition I am using a latex error aware editor (texniccenter on windows). When I have the error pinned down in tex file, its usually quite easy to find the corresponding Rd file and then the error in the Rd file. Sincerely Eryk. I am not creating latex versions of the help pages. This package is for a small group of people (about 40) and only works on a specific set of non-public data, so I'm not trying to make this package work for everyone. It seems that my installation of latex is a bit skiddly-whumpus, but I haven't the time to mess with it now as I have a deadline for the R package completion. HTML files are sufficient. So, I have used the option that doesn't make latex files. however, the editor I use, alpha, has a tex mode and I've been using that since it keeps track of matching braces, indentation and colours text so I know what part of the code it is. The problem really isn't one of braces - as I said, I have tried to build it with a single function and a single Rd file,and it still gives me the same error. If I build it with 2 functions and 2 Rd file, then the same error shows up AND only the first function is indexed and the help page for the second function points to the help page for the first function. I must be doing something else wrong. Its not the braces. This is what I have done that may not be right? 1. I put all of the Rd files into 1 file with a \eof separating them. This is how it appears in already built packages, however, I haven't seen any reference to that in the R manual. But if I don't do that, R CMD check completely fails. 2. What about the functions themselves? I have tried them as separate files or concatenated into one file. The functions always appear to have been sourced and are available in R, but the help pages fail either way. 3. \keyword. Very few of my functions really fit into any of the keyword.db options. I note that there also appears to be keywords for packages that can be added (eg spatial). Can I make my own keyword and add it to the keyword.db? -ph __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] (sans objet)
On Tue, 15 Jun 2004, Benjamin Esterni wrote: I have a problem with the dr function: dimension reduction. It seems that you are using it inappropriately. I give you my example, and i'll be pleased to read your comments. #let be X a matrix 50*100: library(dr); You should not be terminating lines with ;. This is R, not C. X- matrix(rnorm(50*100,5,1),50,100); #and let be Y a vector response: Y- sample(0:1,50,replace=T); #I choose (for the expérience, but in reality i don't have it) a few variables #which are censed to explain Y: index- sample(1:100,10); X[Y==1,index]-10*X[Y==1,index]; #so now I want to proceed to a logistic regression, but I don't know the vector #index. So I have to reduce the dimension of X, and that's why I use the function #dr (dr package). model- dr(Y~X,family=binomial,method=phdy); edr- dr.direction(model); #And now my problem: I hope that edr is a matrix constructed with linear #combinaison of X, prinipally the index vectors of X. But in reality it's not the #situation: Your variables have no predictive power at all. Look at pairs(cbind(Y, edr)) library(nnet); fit-multinom(Y~.,data=data.frame(edr)); Take a look at this. The fit is useless, because your variables are. pred-predict(fit,data.frame(edr)); table(Y,pred) 0 21 0 19 Given that Y has 50 values and that table labels dims, how on earth did you get that? -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] installing my own package - problems with INDEX
Pamela == Pamela Hall [EMAIL PROTECTED] on Tue, 15 Jun 2004 08:41:27 -0400 writes: ... Pamela I must be doing something else wrong. Its not the braces. Pamela This is what I have done that may not be right? Pamela 1. I put all of the Rd files into 1 file with a \eof separating them. This is how it appears in already built packages, however, I haven't seen any reference to that in the R manual. But if I don't do that, R CMD check completely fails. That's definitely not the recommended way. But it might not be the problem either Pamela 2. What about the functions themselves? I have tried them as separate files or concatenated into one file. The functions always appear to have been sourced and are available in R, but the help pages fail either way. as you're guessing yourself, this should be a completely orthogonal matter. Pamela 3. \keyword. Very few of my functions really fit into any of the keyword.db options. I note that there also appears to be keywords for packages that can be added (eg spatial). Can I make my own keyword and add it to the keyword.db? No, don't. This is becoming a FAQ.. (we had this topic recently with Rmetrics), The \keyword{}s are not ``key words'' in the usual sense, but rather __category__ entries. Categories of applied statistics / data analysis. To choose one, you might find it easier to read KEYWORDS rather than KEYWORDS.db For ``real'' key words, you can nowadays use \concept{ .. } the content of which is also searched by help.search() [when the package is installed]. Again, please tell us what you are doing and we may help you to choose appropriate keywords (or --much less probably-- you convince us that some new keywords are needed). Regards, Martin Maechler __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: R: [R] slope estimations of teeth like data
__ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: R: [R] slope estimations of teeth like data
On 15 Jun 2004 at 13:52, Vito Muggeo wrote: Dear Petr, Probably I don't understand exactly what you are looking for. However your plot(x,c(y,z)) suggests a broken-line model for the response c(y,x) versus the variables x. Therefore you could estimate a segmented model to obtain (different) slope (and breakpoint) estimates. See the package segmented. Thank you Vito, but it is not what I want. plot(x,c(y,z)) shows only one spike and I have many such spikes in actual data. My actual data look like those set.seed(1) y - 0.03*x[1:100]+rnorm(100, mean=.001, sd=.03) z - 3-rep(seq(1,100,10),each=10)*.03+rnorm(100,mean=.001, sd=.03) yy - NULL for( i in 1:10) yy - c(yy,c(y,z)[1:floor(runif(1)*200)]) y.l - length(yy) plot(1:y.l, yy) x axis is actually a time and y is a weight of gradually filled conteiner, which is irregularly emptied. I want to do an hourly and/or daily averages of increases in weight (it can by done by aggregate) myfac - gl(y.l/12,12,length=1271) #hopefully length is ok y.agg - aggregate(diff(yy), list(myfac), mean) ## there will be list(hod=cut(time.axis,hour)) construction actually 0.03 can be expected average result and some aggregated values ar OK but some are wrong as they include values from emptying time. *** This*** is probably what I need, I need to set some logical vector which will be TRUE when there was a filling time and FALSE during other times. And I need to specify it according a data I have available. Best what I was able to do was to consider filling time as a time when let say diff(yy) = 0 was between prespecified limits, but you know how it is with real life and prespecified limits. Or I can plot my data against time, manually find out regions which are correct and make a aggregation only with correct data. But there are 24*60*3 values each day so I prefer not to do it manually. Or finally I can throw away any hourly average which is not in set limits, but I prefer to throw away as little data as possible. I hope I was able to clarify the issue a bit. Thank you Best regards Petr best, vito - Original Message - From: Petr Pikal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 15, 2004 1:11 PM Subject: [R] slope estimations of teeth like data Dear all Suppose I have teeth like data similar like x - 1:200 y - 0.03*x[1:100]+rnorm(100, mean=.001, sd=.03) z - 3-rep(seq(1,100,10),each=10)*.03+rnorm(100,mean=.001, sd=.03) plot(x,c(y,z)) and I want to have a gradient estimations for some values from increasing part of data like y.agg - aggregate(diff(c(y,z)), list(rep(seq(1,200,10),each=10)[1:199]), mean) y.agg[1:10,] ##is OK, I want that y.agg[11:20,] ##is not OK, I do not want that actual data are similar but more irregular and have subsequent gradual increases and decreases, more like set.seed(1) yy-NULL for( i in 1:10) yy - c(yy,c(y,z)[1:floor(runif(1)*200)]) length(yy) [1] 1098 plot(1:1098,yy) Is there anybody who has some experience with such data, mainly how to extract only increasing portions or to filter values of yy such as only aggregated slopes from increasing parts are computed and other parts are set to NA. Sometimes actual data have so long parts of steady or even slightly increasing values at decreasing part that aggregated values are slightly positive although they are actually from decreasing portion of data. Thank you Petr Pikal [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Petr Pikal [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] slope estimations of teeth like data
On Tue, 15 Jun 2004 13:11:45 +0200 Petr Pikal wrote: Dear all Suppose I have teeth like data similar like x - 1:200 y - 0.03*x[1:100]+rnorm(100, mean=.001, sd=.03) z - 3-rep(seq(1,100,10),each=10)*.03+rnorm(100,mean=.001, sd=.03) plot(x,c(y,z)) and I want to have a gradient estimations for some values from increasing part of data like y.agg - aggregate(diff(c(y,z)), list(rep(seq(1,200,10),each=10)[1:199]), mean) y.agg[1:10,] ##is OK, I want that y.agg[11:20,] ##is not OK, I do not want that actual data are similar but more irregular and have subsequent gradual increases and decreases, more like set.seed(1) yy-NULL for( i in 1:10) yy - c(yy,c(y,z)[1:floor(runif(1)*200)]) length(yy) [1] 1098 plot(1:1098,yy) Just like Vito, I am also not really sure what you are looking for. But some breakpoint-estimating procedure might be of help. Vito already mentioned segmented(), furthermore there is breakpoints() in strucchange. But to estimate all breakpoints in yy (as defined above) is challenging. breakpoints() requires some time for computations, e.g. R library(strucchange) R xx - 1:1098 R bp - breakpoints(yy ~ xx, h = 0.05) ## this will take some time R plot(xx, yy) R lines(xx, fitted(bp), col = 4) The algorithm in segmented is (often considerably) quicker but requires start values for the breakpoints. R library(segmented) R sg - segmented(lm(yy ~ xx), xx, seq(200, 900, length = 12), tol = 1e-3) ## decrease tolerance R plot(xx, yy) R lines(xx, fitted(sg), col = 4) If this is what you are looking for you can also contact me and Vito, I guess, to see how the function calls can be improved to suit your needs. hth, Z Is there anybody who has some experience with such data, mainly how to extract only increasing portions or to filter values of yy such as only aggregated slopes from increasing parts are computed and other parts are set to NA. Sometimes actual data have so long parts of steady or even slightly increasing values at decreasing part that aggregated values are slightly positive although they are actually from decreasing portion of data. Thank you Petr Pikal [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] error with barplot command?
On Mon, 14 Jun 2004 22:43:27 +0100 (BST), (Ted Harding) [EMAIL PROTECTED] wrote : On 14-Jun-04 Duncan Murdoch wrote: Please try 1.9.1 beta. This should be fixed now... ... Does this mean that barplot() got un-fixed between 1.8.0 and 1.9.0? Yes, and this is why we *really strongly* encourage people to try out the patch, alpha and beta versions. Sometimes (as in this case) changes have unintended side effects; it's much better to catch them before a release than after. If you're on Windows, binary builds of the patch, alpha and beta releases are available on the CRAN mirrors (e.g. cran.uk.r-project.org) in the /bin/windows/base directory. Follow the link to the r-patched release. For other platforms you can download the source and recompile it. Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Manova question.
Hi list, I'm attempting to re-create a Repeated Measures Compositional Analysis as described in the work by Aebischer et. al. (Ecology. 1993. 74(5): 1313-1325). In this paper they describe transitions of data into a log ratio difference matrix, from which they obtain two matrices using a monova routine. I am able to produce the second of the two matrices, but I'm having trouble with the first. the difference matrix going in is given here. Animal Scrub Bl wood Con woodGrass 1 0.970 -2.380 -5.154 -9.408 2 1.217 -0.173 -4.955 -5.521 3 1.178 -0.248 -4.089 0.338 4 0.520 0.466 -4.801 -1.946 5 8.445 9.319 10.753 8.171 6 8.654 9.327 10.732 8.152 7 8.429 9.350 10.818 8.141 8 9.120 9.565 3.813 8.127 9 9.227 9.882 3.813 7.779 10 9.423 8.086 3.813 8.539 11 9.626 9.392 3.813 8.135 12 9.234 8.302 3.813 8.537 13 8.672 8.908 9.832 8.416 And the first of the matrices is given here, and is matrix of mean-corrected sums of squares and cross products calculated from the difference matrix. Scrub Bl wood Con woodGrass Scrub 179.52 214.59 244.58 273.75 Bl wood 214.59 268.44 314.35 343.86 Con wood244.58 314.35 471.09 400.22 Grass 273.75 343.86 400.22 477.78 From manova on the data set I can get the diagonal of the matrix, but not the others. manova(y ~ NULL) Terms: Residuals Scrub179.5273 Bl.wood 268.4347 Con.wood 471.0845 Grass477.8014 Deg. of Freedom12 Could anyone offer a suggestion ? Thanks Ken __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] AIC in glm.nb and glm(...family=negative.binomial(.))
You have the code, so take a look for youself. There's an error in the aic formula in negative.binomial (and neg.bin) On Tue, 15 Jun 2004, Ken Knoblauch wrote: Can anyone explain to me why the AIC values are so different when using glm.nb and glm with a negative.binomial family, from the MASS library? I'm using R 1.8.1 with Mac 0S 10.3.4. library(MASS) dfr - data.frame(c=rnbinom(100,size=2,mu=rep(c(10,20,100,1000),rep(25,4))), + f=factor(rep(seq(1,4),rep(25,4 AIC(nb1 - glm.nb(c~f, data=dfr)) [1] 1047 AIC(glm(c~f, family=negative.binomial(nb1$theta), data=dfr)) [1] -431804 Actually, the difference is already apparent with the function logLik, but I still would like to understand the difference in what is calculated in the two instances. -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Clustering of sparse graphs.
Hi! I have graph with 1 or more (up 1000k) nodes and only few edges (can be weighted or not). It is a really sparse matrix. I can generate this graph using R. Which structure I can, should, use to store the edges? (mSparse?) Having this datastructures which clustering algorithm I can use in R? Sincerely Eryk __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] odesolve: lsoda vs rk4
lsoda doesn't pass along the names attribute of the state vector, y. If you want to use the names of the state vector in your code, you need to reassign it inside your ode function. I should either fix this in the code for lsoda, or at least document it! For example, I can run the following modification of your code: func2 - function(t, y, p) { names(y) - c(A,B,C,D) ### Here put the names attribute back Ad - p[p2]*(p[p1]*y[A]*y[D])/(p[p2]+p[p3]) + p[p6]*(p[p4]*y[B]*p[p10])/(p[p5]+p[p6]) - p[p1]*y[A]*y[C] Bd - p[p3]*(p[p1]*y[A]*y[D])/(p[p2]+p[p3]) + p[p5]*(p[p4]*y[B]*p[p10])/(p[p5]+p[p6]) - p[p4]*y[B]*p[p10] Cd - (p[p1]+p[p7])*y[A]*y[D] - p[p1]*y[A]*y[C]-p[p9]*y[C] Dd -p[p9]*y[C] - p[p7]*y[A]*y[D] list(c(Ad, Bd, Cd, Dd)) } out2 - lsoda(y, times, func2, parms) out2[c(1:10,1000),] timeABC D [1,] 0.00 2.50e-06 2.50e-06 1.70e-06 5.70e-07 [2,] 0.05 2.432561e-06 2.500379e-06 1.671689e-06 5.312515e-07 [3,] 0.10 2.368078e-06 2.499286e-06 1.639363e-06 4.980014e-07 [4,] 0.15 2.306621e-06 2.496841e-06 1.603709e-06 4.697523e-07 [5,] 0.20 2.248381e-06 2.493370e-06 1.566611e-06 4.451401e-07 [6,] 0.25 2.193360e-06 2.488923e-06 1.528312e-06 4.239702e-07 [7,] 0.30 2.141477e-06 2.483726e-06 1.489881e-06 4.053217e-07 [8,] 0.35 2.092710e-06 2.477833e-06 1.451555e-06 3.889875e-07 [9,] 0.40 2.046809e-06 2.471378e-06 1.413729e-06 3.744582e-07 [10,] 0.45 2.003632e-06 2.464438e-06 1.376627e-06 3.614428e-07 [11,] 49.95 2.675890e-06 5.563057e-08 1.595362e-09 -7.457989e-11 In the event the results of lsoda and rk4 differ, I would trust the lsoda result over that of rk4 (see the warnings in the help file for rk4). On June 10, 2004, Chris Knight wrote: [snip ...] I'm trying to use odesolve for integrating various series of coupled 1st order differential equations (derived from a system of enzymatic catalysis and copied below, apologies for the excessively long set of parameters). The thing that confuses me is that, whilst I can run the function rk4: out - rk4(y=y,times=times,func=func, parms=parms) and the results look not unreasonable: out-as.data.frame(out) par(mfrow=c(4,1)) for (i in 2:(dim(out)[2]))plot(out[,1],out[,i], pch=., xlab=time, ylab=names(out)[i]) If I try doing the same thing with lsoda: out - lsoda(y=y,times=times,func=func, parms=parms, rtol=1e-1, atol= 1e-1) I run into problems with a series of 'Excessive precision requested' warnings with no output beyond the first time point. Fiddling with rtol and atol doesn't seem to do very much. What is likely to be causing this (I'm guessing the wide range of the absolute values of the parameters can't be helping), is there anything I can sensibly do about it and, failing that, can I reasonably take the rk4 results as being meaningful? Any help much appreciated, Thanks in advance, Chris [code deleted...] ~~ Dr. Christopher Knight Tel:+44 1865 275111 Dept. Plant Sciences +44 1865 275790 South Parks Road Oxford OX1 3RB Fax:+44 1865 275074 ` · . , ,(((º ~~ R. Woodrow Setzer, Jr.Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-4284 Pharmacokinetics Branch NHEERL B143-01; US EPA; RTP, NC 27711 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] load function to R GUI
Yep, shame on me. But on the other hand, this is a good example of a vague menu item. I think that instead of Source R code..., it should be Load source R code... unless it can do more than just loading a source from R file. Evgueni Prof Brian Ripley wrote: The first menu item on the `File' menu is called `Source R code' and calls source(). Did you look through the menus? If not, it would be worth familiarizing yourself with them. On Mon, 14 Jun 2004, Evgueni Parilov wrote: Thanks! That was exactly what I wanted. Evgueni Ko-Kang Kevin Wang wrote: Hi, -Original Message- From: [EMAIL PROTECTED] Hi all! I looked through the manual and FAQ, and did not find any information on how to load functions from files (with .R extension) to run them in R GUI under Windows. The only way I know is to create and edit a function inside GUI. But what if I want to edit it in Emacs (do not want to use ESS) and then load into GUI? Any suggestions... Do you mean ?source? i.e. save your function in, say, foo.R then use the source() function to get it in. HTH Kevin __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Thank you for your inquiry (KMM337581I99L0KM)
Dear Thank you for contacting Texas Instruments Incorporated, an educational technology company. Your message has been routed to a TI-Cares Agent and you will receive a solution shortly. For 24/7 customer self-service, please visit our knowledgebase at education.ti.com/support. Have a wonderful day, and thank you for choosing Texas Instruments for your educational needs. Sincerely, TI-Cares Team Texas Instruments Incorporated Education.ti.com -- I have attached your document. +++ Attachment: No Virus found +++ MC-Afee AntiVirus - www.mcafee.com [ Attachment 1 Type: text/plain Name: attachment1.txt] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] fit.mult.impute and quantile regression
roger koenker wrote: Having not tried this, it is dangerous to speculate, but it appears to me that there would be no problem passing rq arguments (crucially, only tau, the specification of the quantile of interest) to fit.mult.impute, since the call to the fitter procedure includes a ... argument. The real question would seem to be: are the assumptions underlying the imputation procedure consistent with the rq fitting, that is are they assuming something stronger than that the tauth conditional quantile function of y is linear in x? There seem to be quite a variety of options for the imputation in transcan, maybe Frank could advise on this? You are right Roger, fit.mult.impute is generic. It just assumes that impute.transcan can find the imputations to insert, to complete the dataframe. Note that transcan is no longer the function to use for multiple imputations. Use aregImpute. It is flexible as long as additivity holds. Frank 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 Jun 15, 2004, at 11:52 AM, [EMAIL PROTECTED] wrote: I have a largish dataset (1025) with around .15 of the data missing at random overall, but more like .25 in the dependent variable. I am interested in modelling the data using quantile regression, but do not know how to do this with multiply imputed data (which is what the dataset seems to need). The original plan was to use qr (or whatever) from the quantreg package as the 'fitter' argument in Design's fit.mult.impute, but it is not clear whether this would work, especially as fit.mult.impute seems only to work with the default settings of its 'fitter' arguments, which rather defeats the purpose of quantile regression. Help!! -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] load function to R GUI
Evgueni Parilov wrote: Yep, shame on me. But on the other hand, this is a good example of a vague menu item. I think that instead of Source R code..., it should be Load source R code... unless it can do more than just loading a source from R file. No. source() does not only load, but also parse()s the code! Also note that load() is completely different from source(). So why do you want to confuse the users? Uwe Ligges Evgueni Prof Brian Ripley wrote: The first menu item on the `File' menu is called `Source R code' and calls source(). Did you look through the menus? If not, it would be worth familiarizing yourself with them. On Mon, 14 Jun 2004, Evgueni Parilov wrote: Thanks! That was exactly what I wanted. Evgueni Ko-Kang Kevin Wang wrote: Hi, -Original Message- From: [EMAIL PROTECTED] Hi all! I looked through the manual and FAQ, and did not find any information on how to load functions from files (with .R extension) to run them in R GUI under Windows. The only way I know is to create and edit a function inside GUI. But what if I want to edit it in Emacs (do not want to use ESS) and then load into GUI? Any suggestions... Do you mean ?source? i.e. save your function in, say, foo.R then use the source() function to get it in. HTH Kevin __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] load function to R GUI
On Tue, 15 Jun 2004 12:50:04 -0400, Evgueni Parilov [EMAIL PROTECTED] wrote : Yep, shame on me. But on the other hand, this is a good example of a vague menu item. I think that instead of Source R code..., it should be Load source R code... unless it can do more than just loading a source from R file. The name will make more sense as you learn more about R: it refers to the source() function, which reads and executes a file full of R code. The load() function doesn't work on source code, it works on saved binary images, so your suggestion isn't really clearer. Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] load function to R GUI
Thanks Uwe! Now I understand how it works and why it was called Source R code rather than Load source R code. I did not really intend to confuse anybody. I just wanted to have full information on a subject. I agree that most of the menu items are self-explained. But some of them may not! Especially, if you are novice for R, like in my case. In future, I will try to check for answer 10 times before posting it to this group. Thanks again, Evgueni Uwe Ligges wrote: Evgueni Parilov wrote: Yep, shame on me. But on the other hand, this is a good example of a vague menu item. I think that instead of Source R code..., it should be Load source R code... unless it can do more than just loading a source from R file. No. source() does not only load, but also parse()s the code! Also note that load() is completely different from source(). So why do you want to confuse the users? Uwe Ligges Evgueni Prof Brian Ripley wrote: The first menu item on the `File' menu is called `Source R code' and calls source(). Did you look through the menus? If not, it would be worth familiarizing yourself with them. On Mon, 14 Jun 2004, Evgueni Parilov wrote: Thanks! That was exactly what I wanted. Evgueni Ko-Kang Kevin Wang wrote: Hi, -Original Message- From: [EMAIL PROTECTED] Hi all! I looked through the manual and FAQ, and did not find any information on how to load functions from files (with .R extension) to run them in R GUI under Windows. The only way I know is to create and edit a function inside GUI. But what if I want to edit it in Emacs (do not want to use ESS) and then load into GUI? Any suggestions... Do you mean ?source? i.e. save your function in, say, foo.R then use the source() function to get it in. HTH Kevin __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Manova question.
Jens Schumacher wrote: knussear wrote: Hi list, I'm attempting to re-create a Repeated Measures Compositional Analysis as described in the work by Aebischer et. al. (Ecology. 1993. 74(5): 1313-1325). In this paper they describe transitions of data into a log ratio difference matrix, from which they obtain two matrices using a monova routine. I am able to produce the second of the two matrices, but I'm having trouble with the first. the difference matrix going in is given here. AnimalScrubBl woodCon wood Grass 10.970-2.380-5.154-9.408 21.217-0.173-4.955-5.521 31.178-0.248-4.0890.338 40.5200.466-4.801-1.946 58.4459.31910.7538.171 68.6549.32710.7328.152 78.4299.35010.8188.141 89.1209.5653.8138.127 99.2279.8823.8137.779 109.4238.0863.8138.539 119.6269.3923.8138.135 129.2348.3023.8138.537 138.6728.9089.8328.416 And the first of the matrices is given here, and is matrix of mean-corrected sums of squares and cross products calculated from the difference matrix. ScrubBl woodCon wood Grass Scrub179.52214.59244.58273.75 Bl wood214.59268.44314.35343.86 Con wood 244.58314.35471.09400.22 Grass273.75343.86400.22477.78 From manova on the data set I can get the diagonal of the matrix, but not the others. manova(y ~ NULL) Terms: Residuals Scrub179.5273 Bl.wood 268.4347 Con.wood 471.0845 Grass477.8014 Deg. of Freedom12 Could anyone offer a suggestion ? Thanks Ken __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Let data.matrixbe the above difference matrix. You obtain the raw sums of squares and cross-products matrix by R2 - t(data.matrix) %*% data.matrix or even R2 - crossprod(data.matrix, data.matrix) or, the preferred form, R2 - crossprod(data.matrix) __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] How avoid coercion to character
Hi R-users! I'd like to know how to avoid automatic coercion of numeric variables passed to array() to character, when there is one categorical variable between others. I have tried I() function, but it is just functional in data.frame. Best Regards! Eduardo Dutra de Armas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] installing my own package - problems with INDEX
YEAH YEAH YEAH!! I got a bunch of functions to install with their help pages and even help.search works!!! The INDEX file is just fine. YEAH YEAH YEAH! This is what I have learned: 1. DO NOT concatenate the *.Rd files. This happens in the installation process. This is probably completely evident to y'all, but since the only working examples one has to look at are already installed packages which have concatenated Rd files...its a wee bit confusing to novices. But NOW, I get it. 2. When one does not concatenate *.Rd files, (and adds a few print lines to R CMD check when messing around to try and figure out what R CMD check is doing...) then the error messages make much more sense and I was able to find errors. And as you suspected there were many more than just a missing bracket. so, now I can mess around with the quality of the package since at least it now EXISTS! ...time for a different subject header. Thank y'all very much. -ph __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Keywords and Concepts - CTFS package
The package I am writing is for the Center for Tropical Forest Science, CTFS. This center is a collaboration of 15+ institutions world wide that are investigating properties of tropical forest dynamics, species diversity, species distributions. The investigation is composed of the same sampling design of the forest: a large 50 hectare plot (usually) in which every tree = 10 mm in diameter has been tagged, mapped and identified. Reenumerations occur very 5 years (mostly). Other information such as topography, canopy structure, seedling traps, etc, etc. are collected to different degrees at different sites. Some sites have more than one plot, some have 2, 25 ha plots, some have 52 hectare, species identification can easily take 10 years and counting, some sites have 1200 species, etc. etc. It is a very large project with 18 pantropical sites, over 3 million trees, 5000+ species with data ranging from first census to 7th census. The people doing the field work and the analysis vary tremendously in their backgrounds and expertise. There are many collaborators who have done little or none of the field work, some haven't even been to the sites. The types of analyses that are done are wide ranging, but clearly cannot be crammed into a standard stats package. The powers that be at CTFS decided to adopt R for analysis and away we went. Four years have gone by and we have an odd collection of functions, few documented even inside the code (programmers hate to document), odd collection of manuals (mostly written by me) of varying complexity and integrity. It became obvious to me this year that we needed to use more of R capacities and quit reinventing the packaging of functions and manuals for running them. So I have taken on the responsibility of being the clearing house for all CTFS functions, checking them for usefulness, function and generality (which is not always necessary) and writing up help files. And now, thanks to you guys, I have managed to start the process of packaging it all together so we can all work from the same function resource base! Now, how to fit our functions into \keywords{} and use \concepts{}. 1. Many functions are CTFS data structure specific: mort.spp.habitat() which computes the mortality for a population of individuals that belong to a single species and occupy a habitat defined in previous analyses and mapped to locations in the plot. 2. Some functions that do most of the work are more generic: mort.calc() which calculates the annual mortality rate of a population and provides confidence limits to the rate through other functions. 3. Some are very generic and just make it simpler to interact with other CTFS programs that could probably be made more generic, but that hasn't happened yet or may take too long to run (we do a lot of randomization and generation of distributions for assigning probabilities for statistical results): split.data() which takes a dataset of census information on trees that is a dataframe and makes a new dataset that is a list of dataframes, 1 dataframe for each species - just restructures the data for ease of use in other programs and for more rapid access of, in this case, species based information. I believe I understand the \concepts{} section of Rd files... Knowing the audience for whom I am writing this package, I have provided a number of values for each function as concepts so that help.search() will dig up related and useful functions. How the CTFS functions relate to each other is a very audience dependent phenomena. I'll try out my ideas on the CTFS users and let them tell me whether they took a long time to find what they needed or not. I now understand that \keywords{} are not in the usual sense and I have viewed KEYWORDS. For function #3 above, I would say this is a type of data manipulation and is used, within CTFS as a file utility, so is the keyword: \keyword{Basics:manip, utilities} For function #2 above, mortality rate is just a piece of arithmetic, the CI assigned as stats, but this isn't a survival analysis, its just defined computation suitable for the uses of the CTFS crowd . so what keyword is appropriate? Function #1 is a form of data manipulation too, but so are all of our R programs. Now, I'm confused. I agree that there is no reason to create a new keyword since the CTFS stuff is so specific, but should I just call nearly everything we write misc? -ph __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Manova question.
On Jun 15, 2004, at 10:11 AM, Douglas Bates wrote: Jens Schumacher wrote: knussear wrote: Hi list, I'm attempting to re-create a Repeated Measures Compositional Analysis as described in the work by Aebischer et. al. (Ecology. 1993. 74(5): 1313-1325). In this paper they describe transitions of data into a log ratio difference matrix, from which they obtain two matrices using a monova routine. I am able to produce the second of the two matrices, but I'm having trouble with the first. the difference matrix going in is given here. AnimalScrubBl woodCon wood Grass 10.970-2.380-5.154-9.408 21.217-0.173-4.955-5.521 31.178-0.248-4.0890.338 40.5200.466-4.801-1.946 58.4459.31910.7538.171 68.6549.32710.7328.152 78.4299.35010.8188.141 89.1209.5653.8138.127 99.2279.8823.8137.779 109.4238.0863.8138.539 119.6269.3923.8138.135 129.2348.3023.8138.537 138.6728.9089.8328.416 And the first of the matrices is given here, and is matrix of mean-corrected sums of squares and cross products calculated from the difference matrix. ScrubBl woodCon wood Grass Scrub179.52214.59244.58273.75 Bl wood214.59268.44314.35343.86 Con wood 244.58314.35471.09400.22 Grass273.75343.86400.22477.78 From manova on the data set I can get the diagonal of the matrix, but not the others. manova(y ~ NULL) Terms: Residuals Scrub179.5273 Bl.wood 268.4347 Con.wood 471.0845 Grass477.8014 Deg. of Freedom12 Could anyone offer a suggestion ? Thanks Ken __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Let data.matrixbe the above difference matrix. You obtain the raw sums of squares and cross-products matrix by R2 - t(data.matrix) %*% data.matrix or even R2 - crossprod(data.matrix, data.matrix) or, the preferred form, R2 - crossprod(data.matrix) Thanks for the help. Neither of those approaches gives the final matrix with 179.5273 in the top left position! Ken __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] installing my own package - problems with INDEX
From: Pamela Hall YEAH YEAH YEAH!! I got a bunch of functions to install with their help pages and even help.search works!!! The INDEX file is just fine. YEAH YEAH YEAH! This is what I have learned: 1. DO NOT concatenate the *.Rd files. This happens in the installation process. This is probably completely evident to y'all, but since the only working examples one has to look at are already installed packages which have concatenated Rd files...its a wee bit confusing to novices. But NOW, I get it. If you had looked at any of the _source_ package on CRAN (.tar.gz) instead of the installed packages, you will see that the Rd files are one topic per file. Andy 2. When one does not concatenate *.Rd files, (and adds a few print lines to R CMD check when messing around to try and figure out what R CMD check is doing...) then the error messages make much more sense and I was able to find errors. And as you suspected there were many more than just a missing bracket. so, now I can mess around with the quality of the package since at least it now EXISTS! ...time for a different subject header. Thank y'all very much. -ph __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] To run or not to run examples, CTFS package
My $0.02... From: Pamela Hall Hi again; I have placed many examples in the CTFS Rd pages because my audience really really likes lots of examples in order to understand the options available in a functions. At this time I have set them all to \dontrun{}. however, this isn't because the example command line with its function and options won't work, but rather that CTFS specific datasets must exist to have the function output mean anything (random number generation is not useful for understanding the function output). The CTFS datasets are quite large...20-40 MB and for some functions many other datasets need to be available. The functions can also take quite a bit of time to run in some cases, performing many simulations. So, my questions are: 1. Does the R CMD check command actually run all of the examples if \dontrun{} isn't in the Rd file? And won't this take a lot of time with real datasets? Yes. It might take a long time, depending on the specifics of your `real data'. 2. Should I consider making short versions of the datasets for the use of \example{} ? This is trivial in some cases, but not in others as the function only makes sense on the entire dataset. however, in those cases it is, so far, with some of the shorter datasets. I would use the minimal amount of data that's sufficient to demonstrate whatever points needed to be made in the example, and no more. 3. Or can I just leave everything as \dontrun{} and if my audience want to actually run a function, then can cut and paste the line out of the man page or just type it in with their versions of the correct datasets attached? One other possibility is to create a package vignette... Cheers, Andy -ph __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Coercing a dataframe column to datetime
Thank you! The next step in the conversion still fails and I can't seem to find any examples in the archives. The result of the function 'as.POSIXct(strptime())' within the 'sapply' comes back as numeric rather than POSIXct as expected: ds - cbind(1:2, c(02/27/92 23:03:20, 02/27/92 22:29:56)); ds [,1] [,2] [1,] 1 02/27/92 23:03:20 [2,] 2 02/27/92 22:29:56 q - sapply(ds[,2], function(x) as.POSIXct(strptime(x,%m/%d/%y %H:%M:%S))) class(q) [1] numeric q 02/27/92 23:03:20 02/27/92 22:29:56 699260600 699258596 --Rich Richard Kittler AMD TDG 408-749-4099 -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 12:05 PM To: Kittler, Richard Cc: [EMAIL PROTECTED] Subject: Re: [R] Coercing a dataframe column to datetime You have forgotten as.POSIXct is needed too. On Mon, 14 Jun 2004 [EMAIL PROTECTED] wrote: I am trying to coerce a data frame column from character to datetime using strptime but keep getting an error because the length of the coerced object is always 9. What am I doing wrong here: . ds - cbind(1:2, c(02/27/92 23:03:20, 02/27/92 22:29:56)); ds [,1] [,2] [1,] 1 02/27/92 23:03:20 [2,] 2 02/27/92 22:29:56 q - strptime(ds[,2], %m/%d/%y %H:%M:%S); q [1] 1992-02-27 23:03:20 1992-02-27 22:29:56 ds[,2] - q Error in [-(`*tmp*`, , 2, value = q) : number of items to replace is not a multiple of replacement length length(q) [1] 9 . --Rich Richard Kittler AMD TDG 408-749-4099 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] S/R/RWeb/ODBC
I'm looking for an optimal approach to access Oracle databases via RWeb applications. I'm new to R but familiar with programming functions and web pages for the S+ Statserver. I'm now going through the motions of migrating S+/Statserver applications to R/RWeb as a feasability exercise. I can access databases using ODBC directly in R or S, and using Statserver, but I have not succeeded at extracting into R in RWebs batch mode. I can 'require RODBC' in .Rprofile with apparent success, but the results of odbcConnect differ from those when the command is typed into the R commands window. Instead of a parameter list I get a -1. Does anyone know the solution to this problem? Also, might anyone know the comparative merits of using some PERL module (like DBD::Oracle) to do the extraction, as opposed to using RODBC (assuming RODBC can be implemented in batch mode)? I'm currently using Apache on Windows XP if relevant, but LINUX may be the final host (we'll compare, but those more Web-wise than I expect LINUX to outperform Windows for our purposes). Mark Fowler Marine Fish Division Bedford Inst of Oceanography Dept Fisheries Oceans Dartmouth NS Canada [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] load function to R GUI
On Tue, 15 Jun 2004, Evgueni Parilov wrote: Yep, shame on me. But on the other hand, this is a good example of a vague menu item. I think that instead of Source R code..., it should be Load source R code... unless it can do more than just loading a source from R file. It is `source' not `load', as you will find if you actually read the R documentation. DO do as the posting guide asks before casting aspersions on the work of others! Prof Brian Ripley wrote: The first menu item on the `File' menu is called `Source R code' and calls source(). Did you look through the menus? If not, it would be worth familiarizing yourself with them. On Mon, 14 Jun 2004, Evgueni Parilov wrote: Thanks! That was exactly what I wanted. Evgueni Ko-Kang Kevin Wang wrote: Hi, -Original Message- From: [EMAIL PROTECTED] Hi all! I looked through the manual and FAQ, and did not find any information on how to load functions from files (with .R extension) to run them in R GUI under Windows. The only way I know is to create and edit a function inside GUI. But what if I want to edit it in Emacs (do not want to use ESS) and then load into GUI? Any suggestions... Do you mean ?source? i.e. save your function in, say, foo.R then use the source() function to get it in. HTH Kevin __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] S/R/RWeb/ODBC
Sounds like a permissions/ownership problem. odbcConnect returnign -1 just means that the ODBC device manager failed. On Tue, 15 Jun 2004, Fowler, Mark wrote: I'm looking for an optimal approach to access Oracle databases via RWeb applications. I'm new to R but familiar with programming functions and web pages for the S+ Statserver. I'm now going through the motions of migrating S+/Statserver applications to R/RWeb as a feasability exercise. I can access databases using ODBC directly in R or S, and using Statserver, but I have not succeeded at extracting into R in RWebs batch mode. I can 'require RODBC' in .Rprofile with apparent success, but the results of odbcConnect differ from those when the command is typed into the R commands window. Instead of a parameter list I get a -1. Does anyone know the solution to this problem? Also, might anyone know the comparative merits of using some PERL module (like DBD::Oracle) to do the extraction, as opposed to using RODBC (assuming RODBC can be implemented in batch mode)? I'm currently using Apache on Windows XP if relevant, but LINUX may be the final host (we'll compare, but those more Web-wise than I expect LINUX to outperform Windows for our purposes). Mark Fowler Marine Fish Division Bedford Inst of Oceanography Dept Fisheries Oceans Dartmouth NS Canada [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] building and installing a package in Windows
I'm trying to install a package in windows. I have a package directory, which contains all the essentials: .Rd in the Man directory, DESCRIPTION file, etc. I copied it to my R\bin directory, where the Rcmd file is located. Then, when I try to run Rcmd build mypackage from that directory in DOS, I get the following error: 'perl' is not recognized as a command... I would appreciate any help on this matter. Thank you very much! -Yevgeniy __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] building and installing a package in Windows
On Tue, 15 Jun 2004, Yev Kirpichevsky wrote: I'm trying to install a package in windows. I have a package directory, which contains all the essentials: .Rd in the Man directory, DESCRIPTION file, etc. I copied it to my R\bin directory, where the Rcmd file is located. Then, when I try to run Rcmd build mypackage from that directory in DOS, I get the following error: 'perl' is not recognized as a command... I would appreciate any help on this matter. Thank you very much! Either you don't have Perl installed on your computer or it isn't in the path, so it isn't being found. -thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] To run or not to run examples, CTFS package
On Tue, 15 Jun 2004, Pamela Hall wrote: Hi again; I have placed many examples in the CTFS Rd pages because my audience really really likes lots of examples in order to understand the options available in a functions. At this time I have set them all to \dontrun{}. however, this isn't because the example command line with its function and options won't work, but rather that CTFS specific datasets must exist to have the function output mean anything (random number generation is not useful for understanding the function output). The CTFS datasets are quite large...20-40 MB and for some functions many other datasets need to be available. The functions can also take quite a bit of time to run in some cases, performing many simulations. So, my questions are: 1. Does the R CMD check command actually run all of the examples if \dontrun{} isn't in the Rd file? And won't this take a lot of time with real datasets? Yes, they are all run. For some packages this takes a long time, for others it doesn't. 2. Should I consider making short versions of the datasets for the use of \example{} ? This is trivial in some cases, but not in others as the function only makes sense on the entire dataset. however, in those cases it is, so far, with some of the shorter datasets. If possible, it would be useful to have short versions for examples. 3. Or can I just leave everything as \dontrun{} and if my audience want to actually run a function, then can cut and paste the line out of the man page or just type it in with their versions of the correct datasets attached? You can leave things as \dontrun{}, but this should be a last resort. The automatic running of examples is really useful for catching bugs. Also, if you want examples of how to perform various tasks it may be more useful to have vignettes than examples. -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Fwd: building and installing a package in Windows
Thanks to everyone who responded to my 'Perl' problem! Indeed, it wasn't in the Path. I now have a different problem and would appreciate any insights: after I run Rcmd build mypackage, I get the following error: 'sh' is not recognized as a command, program, or batch file Thanks in advance, -yevgeniy Date: Tue, 15 Jun 2004 16:04:36 -0400 To: [EMAIL PROTECTED] From: Yev Kirpichevsky [EMAIL PROTECTED] Subject: building and installing a package in Windows I'm trying to install a package in windows. I have a package directory, which contains all the essentials: .Rd in the Man directory, DESCRIPTION file, etc. I copied it to my R\bin directory, where the Rcmd file is located. Then, when I try to run Rcmd build mypackage from that directory in DOS, I get the following error: 'perl' is not recognized as a command... I would appreciate any help on this matter. Thank you very much! -Yevgeniy __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Fwd: building and installing a package in Windows
Please follow the instructions in readme.packages very, very, very, very carefully. Andy From: Yev Kirpichevsky Thanks to everyone who responded to my 'Perl' problem! Indeed, it wasn't in the Path. I now have a different problem and would appreciate any insights: after I run Rcmd build mypackage, I get the following error: 'sh' is not recognized as a command, program, or batch file Thanks in advance, -yevgeniy __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] building R libraries (windows) - R CMD check problems
Hi everyone, I am trying to build a R library called nnNorm but I have some troubles checking and installing it. Here is the setup: If I don't use a inst\doc directory(with the vignettes files) in my source, the install step is working fine: C:\testRCMD INSTALL nnNorm -- Making package nnNorm adding build stamp to DESCRIPTION installing R files installing man source files installing indices installing help Building/Updating help pages for package 'nnNorm' Formats: text html latex example compNorm texthtmllatex example maNormNN texthtmllatex example nnNorm-internal texthtmllatex Building/Updating help pages for package 'nnNorm' Formats: chm adding MD5 sums * DONE I do verify the .html documentation and all looks great. However, by just adding the directory inst\doc containing the nnNorm.Rnw and nnNorm.bib files when I try to install again I receive the following error: -- Making package nnNorm adding build stamp to DESCRIPTION installing R files installing inst files FIND : format incorrect de paramètre make[2]: *** [C:/R/rw1090/library/nnNorm/inst] Error 2 make[1]: *** [all] Error 2 make: *** [pkg-nnNorm] Error 2 *** Installation of nnNorm failed *** The second trouble (perhaps related with this one) is when I perform the RCMD check. -- Making package nnNorm adding build stamp to DESCRIPTION installing R files installing inst files FIND : format incorrect de paramètre make[2]: *** [C:/test/nnNorm.Rcheck/nnNorm/inst] Error 2 make[1]: *** [all] Error 2 make: *** [pkg-nnNorm] Error 2 *** Installation of nnNorm failed *** * checking package directory ... OK * checking for portable file names ... OK * checking DESCRIPTION meta-information ... OK * checking package dependencies ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for syntax errors ... OK * checking R files for library.dynam ... OK * checking S3 generic/method consistency ... OK * checking for replacement functions with final arg not named 'value' ... OK * checking foreign function calls ... OK * checking Rd files ... ERROR Rd files with unbalanced braces: man/compNorm.Rd man/maNormNN.Rd man/nnNorm-internal.Rd Unbalanced braces are Rd syntax errors, and result in incorrect documentation. It points me to unbalanced braces, but there are no such error. I tried using simple .Rd file with like: \name{functionName} \eof but I still get the same error. The .Rwn file is ok because the vignettes creation works smoothly: C:\testRCMD build nnNorm * checking for file 'nnNorm/DESCRIPTION' ... OK * preparing 'nnNorm': * checking whether 'INDEX' is up-to-date ... OK * creating vignettes ... OK * removing junk files * building 'nnNorm_1.0.tar.gz' Has anyone an idea what the problem might be ? I am using Win XP, R 1.9.0. Thanks, Laurentiu Tarca [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] About function unif_rand()
On Tue, 15 Jun 2004 18:17:36 -0400, [EMAIL PROTECTED] wrote: hello, everybody, I met a problem that I want to generate a random uniform number by using function with c interface. What I found is only unif_rand(), but its range is [0,1]. How can I create a uniform random variable by using a function with c interface. Who can tell me what function it is and how to use? It's not clear to me what you are asking for. Do you want it to be uniform on the range (A,B)? Use A + (B-A)*unif_rand() or runif(A,B). These are documented in the Writing R Extensions manual, along with a large collection of other distributions (and instructions on how to initialize them). Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] multiple error strata in aov
I am trying to perform a model 3 ANOVA for a 2 factor (say factor A and factor B) anova in which factor A is fixed and factor B is random. Therefore, the error term for the test of factor A should be the A:B interaction term and the error terms for B and A:B should be the model residual (within) term. I have tried to work out how to specify such error strata using aov, however, I have had little success. Is there a way to specify just the interaction (A:B) as an error term using Error() within aov or provide a list of error strata. Ideally as Error=list(A=A:B,B=Within, A:B=Within) In addition, I have tried using lme to perform this function, but again without much success. Can anyone offer any ideas Ta Murray __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] File was infected with a virus
(BNote: JP stands for Japanese. (B (BALERT!! (BThis e-mail contained one or more virus-infected files and have been rejected. (B(JP:$B%3%s%T%e!<%?%&%#%k%9$rH/8+$7$^$7$?$N$G!"%a!<%k$NAw?.$rCf;_$7$^$7$?!#(J) (B (BThe following attachments were infected: (B(JP:[EMAIL PROTECTED]$N$H$*$j!#(J) (Bfile=,status=deleted,virus-id=37368,[EMAIL PROTECTED] (B (BThank you, (B (BKDDI Corporation [EMAIL PROTECTED] (B (B-- Original message text follows --- (BSubject: Does it matter? (BMessage-ID: [EMAIL PROTECTED] (BDate: 2004/06/16 (BFrom: [EMAIL PROTECTED] (BTo: [EMAIL PROTECTED] (B (B__ (B[EMAIL PROTECTED] mailing list (Bhttps://www.stat.math.ethz.ch/mailman/listinfo/r-help (BPLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] time series object
Hi R People: I have a monthly time series x.ts which runs from 1/1995 through 12/2003. x.ts - ts(x,start=1995,freq=12) str(x.ts) Time-Series [1:108] from 1995 to 2004: -1.638 -0.236 0.830 -0.548 0.363 ... My question: is there a way to print the observations from 1/1999 to 6/1999, please? (other than x.ts[49:54]) Thank you in advance! R version 1.9.0 for Windows Sincerely, Laura mailto: [EMAIL PROTECTED] a trip to NY __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] time series object
?window Date: Tue, 15 Jun 2004 18:43:04 -0500 From: Laura Holt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [R] time series object Hi R People: I have a monthly time series x.ts which runs from 1/1995 through 12/2003. x.ts - ts(x,start=1995,freq=12) str(x.ts) Time-Series [1:108] from 1995 to 2004: -1.638 -0.236 0.830 -0.548 0.363 ... My question: is there a way to print the observations from 1/1999 to 6/1999, please? (other than x.ts[49:54]) Thank you in advance! __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] multiple error strata in aov
Hi Murray I am trying to perform a model 3 ANOVA for a 2 factor (say factor A and factor B) anova in which factor A is fixed and factor B is random. ... In addition, I have tried using lme to perform this function, but again without much success. What did not work? And, did you read Pinheiro Bates? Personally, I find it easier to work with lme and this should be an easy one. What about lme (fixed= Y ~ A, random= ~ 1 | B) or lme (fixed= Y ~ A, random= ~ A | B)? Regards, Lorenz - Lorenz Gygax, Dr. sc. nat. Tel: +41 (0)52 368 33 84 / [EMAIL PROTECTED] Center for proper housing of ruminants and pigs Swiss Veterinary Office agroscope FAT Tänikon, CH-8356 Ettenhausen / Switzerland Fax : +41 (0)52 365 11 90 / Tel: +41 (0)52 368 31 31 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] mixed models question
Hi Chris, I am trying to fit the following linear model to logged per capita fecundity data (ie number of babies per female) for a mouse: RsNRlS - glm(formula = ln.fecundity ~ summer.rainfall + N + lagged.rainfall + season, ) I am using this relationship in a simulation model, and the current statistical model I have fit is unsatisfactory. The problem is I get a global estimate of variance (MSE), but I think it varies across subsets of the data. Specifically, seasons when there is lots of reproduction (e.g. fall) tend to have high variance, while seasons with little reproduction (e.g. summer) have small amounts of variance. I am looking for a method for estimating the coefficients in my linear model, and estimating a separate error for subsets of the data (ie for each of the 4 seasons). The end goal is to take this linear model back into my simulation model to make predictions about fecundity, but with separate variance terms for subsets of the data. Are you using glm because you need a specific distribution family (such like poisson)? If not, you could possibly use gls with the argument weights= varFixed (~ season) With that you estimate your parameters and at the same time you allow for (and estimate) the different variances for the season. If you need the poisson distribution, I am not quite sure what to do. Perhaps glm also accepts this weight argument or perhaps you need to work with a generalised procedure of lme (either from one of the new lme packages or from MASS). Regards, Lorenz - Lorenz Gygax, Dr. sc. nat. Tel: +41 (0)52 368 33 84 / [EMAIL PROTECTED] Center for proper housing of ruminants and pigs Swiss Veterinary Office agroscope FAT Tänikon, CH-8356 Ettenhausen / Switzerland Fax : +41 (0)52 365 11 90 / Tel: +41 (0)52 368 31 31 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html