Re: [R] Special characters in URI
On Tue, 3 May 2005, Gorjanc Gregor wrote: I am crossposting this to R-help and BioC, since it is relevant to both groups. I don't see the relevance to R-help. But the answer to your subject is unambiguous: valid URLs do not contain `special' characters -- they must be encoded. See RFC1738 at e.g. ftp://ftp.funet.fi/pub/doc/rfc/rfc1738.txt At some point (probably 2.2.0) I intend to ensure that the mapping to file:// URLs that is done is a few places is encoded as necessary. This will likely result in a utility function filePathToURL or some such. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] comparing lm(), survreg( ... , dist=gaussian) and survreg( ... , dist=lognormal)
On Mon, 2 May 2005, Charles Annis, P.E. wrote: I have tried everything I can think of and hope not to appear too foolish when my error is pointed out to me. I have some real data (18 points) that look linear on a log-log plot so I used them for a comparison of lm() and survreg. There are no suspensions. survreg.df - data.frame(Cycles=c(2009000, 577000, 145000, 376000, 37000, 979000, 1742, 71065000, 46397000, 70168000, 6912, 68798000, 72615000, 133051000, 38384000, 15204000, 1558000, 14181000), stress=c(90, 100, 110, 90, 100, 80, 70, 60, 56, 62, 62, 59, 56, 53, 59, 70, 90, 70), event=rep(1, 18)) sN.lm- lm(log(Cycles) ~ log10(stress), data=survreg.df) and vvv gaussian.survreg- survreg(formula=Surv(time=log(Cycles), event) ~ log10(stress), dist=gaussian, data=survreg.df) produce identical parameter estimates and differ slightly in the residual standard error and scale, which is accounted for by scale being the MLE and thus biased. Correcting by sqrt(18/16) produces agreement. Using predict() for the lm, and predict.survreg() for the survreg model and correcting for the differences in stdev, produces identical plots of the fit and the upper and lower confidence intervals. All of this is as it should be. I trust you called predict() on both and let R choose the method. And, vv lognormal.survreg- survreg(formula=Surv(time=(Cycles), event) ~ log10(stress), dist=lognormal, data=survreg.df) produces summary() results that are identical to the earlier call to survreg(), except for the call, of course. The parameter estimates and SE are identical. Again this is as I would expect it. But since the call uses Cycles, rather than log(Cycles) predict.survreg() returns $fit in Cycles units, rather than logs, and of course the fits are identical when plotted on a log-log grid and also agree with lm() Here is the fly in the ointment: The upper and lower confidence intervals, based on the $se.fit for the dist=lognormal are quite obviously different from the other two methods, and although I have tried everything I could imagine I cannot reconcile the differences. How did you do this? (BTW, I assume you mean upper and lower confidence limits for the predicted means.) For the predictions and standard errors are (or should be) on the response scale, a non-linear function of the parameters. In that case it is normal to form confidence limits on the linear predictor scale and transform. I believe that the confidence bounds for both models should agree. After all, both calls to survreg() produce identical parameter estimates. They will, if computed on the same basis. On log-scale (to avoid large numbers) pr1 - predict(lognormal.survreg, se.fit=T) log(cbind(pr1$fit - 1.96*pr1$se.fit, pr1$fit + 1.96*pr1$se.fit)) pr2 - predict(gaussian.survreg, se.fit=T) cbind(pr2$fit - 1.96*pr2$se.fit, pr2$fit + 1.96*pr2$se.fit) are really pretty close. The main difference is a slight shift, which comes about because the mean of a log(X) is not log(mean(X)). Note that the second set at the preferred ones. Transforming to log scale before making the confidence limits: cbind(log(pr1$fit) - 1.96*pr1$se.fit/pr1$fit, log(pr1$fit) + 1.96*pr1$se.fit/pr1$fit) does give identical answers. Consider care is needed in interpreting what predict() is actually predicting in non-linear models. For both glm() and survreg() it is closer to the median of the uncertainty in the predictions than to the mean. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] cmdscale: missing dimnames in R 2.1.0
When running the first example of cmdscale I got in R 2.0.1: loc-cmdscale(eurodist) str(loc) num [1:21, 1:2] 2290.3 -825.4 59.2 -82.8 -352.5 ... - attr(*, dimnames)=List of 2 ..$ : chr [1:21] Athens Barcelona Brussels Calais ... ..$ : NULL In R 2.1.0 I get: loc-cmdscale(eurodist) str(loc) num [1:21, 1:2] 2290.3 -825.4 59.2 -82.8 -352.5 ... - attr(*, dimnames)=List of 2 ..$ : NULL ..$ : NULL I miss the names of the cities. What can I do? Thanks - Wolfram __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] eigenvalues of a circulant matrix
Well since I know nothing about this topic I have lurked so far, but here's my two bob's worth. Firstly I tried to make sense of Brian's initial reply. I have got no idea who Bellman is and you have not referenced (his/her) work in a way I can access the issues you refer to. So I assumed that's exactly what Brian was talking about. Secondly. toeplitz(1:4) [,1] [,2] [,3] [,4] [1,]1234 [2,]2123 [3,]3212 [4,]4321 require(magic) circulant(4) [,1] [,2] [,3] [,4] [1,]1234 [2,]4123 [3,]3412 [4,]2341 So they are obviously two different things. Although I think you may have implied (not stated) that the particular combination you were using resulted in both being exactly the same. It does appear as if in this case the (X) matrix is circulant. But then I'm no expert in even such simple things. Then I had no idea where I was going. So I tried the variations in eigen. I ran you code x-scan(h:/t.txt) y-x[c(109:216,1:108)] X-toeplitz(y) and then X[is.na(X)] numeric(0) So I didn't get any NAs t1 - eigen(X)$vectors t2 - eigen(X,symmetric = TRUE)$vectors identical(t1,t2) [1] TRUE Then t2 - eigen(X,symmetric = TRUE,EISPACK = TRUE)$vectors identical(t1,t2) [1] FALSE So there'e obviously more than one way of getting the vectors. Does the second one make more sense to you? I also noticed in the eigen help that there are references to issues such as IEEE 754 arithmetic,(They may also differ between methods and between platforms.) and or Hermitian if complex. All of these are out of my competence but they do signal to me that there are issues which may relate to hardware, digital arithmetic and other things of that ilk. I added the comment about complex because I have a vague idea that they are related to imaginary parts that you refer to. So not coming to any conclusion that makes sense to me, and given that there are often threads about supposed inaccuracies that have answers such as the digits you see are not always what are held by the machine I set my options(digits = 22) and noticed that some of the numbers are still going at the 22 decimal place suggesting that the machine might be incapable of producing perfectly accurate results using digital arithmetic. My other big sphere of ignorance is complex numbers. So I tried X-toeplitz(complex(real = y)) t1 - eigen(X)$vectors t1[1:20] [1] 0.068041577278880341+0i -0.068041577140546913+0i 0.068041576864811659+0i -0.068041576452430155+0i [5] 0.068041575907139579+0i -0.068041575231135451+0i 0.068041574435267163+0i -0.068041573525828514+0i [9] 0.068041572538722991+0i -0.068041571498323253+0i 0.068041570619888622+0i -0.068041570256170081+0i [13] 0.068041568759931989+0i -0.068041566476633147+0i 0.068041563560502477+0i -0.06804156305007+0i [17] 0.06804138765813+0i -0.068041549792984865+0i 0.068041544123969511+0i -0.068041537810956801+0i t2[1:20] [1] 0.068041381743976906 -0.068041381743976850 0.068041381743976781 -0.068041381743976753 0.068041381743976587 [6] -0.068041381743976725 0.068041381743976920 -0.068041381743976836 0.068041381743976892 -0.068041381743976781 [11] 0.068041381743976781 -0.068041381743977392 0.068041381743976725 -0.068041381743976753 0.068041381743976753 [16] -0.068041381743976698 0.068041381743976587 -0.068041381743976642 0.068041381743976698 -0.068041381743976490 Which is again different. I have no idea what I'm doing but you do seem to get slightly different answers depending upon which method you use. I do not know if one is superior to the others or where one draws the line in terms of accuracy. Tom -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Globe Trotter Sent: Tuesday, 3 May 2005 10:51 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] eigenvalues of a circulant matrix OK, here we go: I am submitting two attachments. The first is the datafile called kinv used to create my circulant matrix, using the following commands: x-scan(kinv) y-x[c(109:1,0:108)] X=toeplitz(y) eigen(X) write(X,ncol=216,file=test.dat) reports the following columns full of NaN's: 18, 58, 194, 200. (Note that eigen(X,symmetric=T) makes no difference and I get the same as above). The second attachment contains only the eigenvectors obtained on calling a LAPACK routine directly (from C). The eigenvalues are essentially the same as that obtained using R. Here, I use the LAPACK-recommended double precision routine dspevd() routine for symmetric matrices in packed storage format. Note the absence of the NaN'sI would be happy to send my C programs to whoever is interested. I am using :~ uname -a Linux 2.6.11-1.14_FC3 #1 Thu Apr 7 19:23:49 EDT 2005 i686 i686 i386 GNU/Linux and R.2.0.1. Many thanks and best wishes!
Re: [R] cmdscale: missing dimnames in R 2.1.0
On Tue, 2005-05-03 at 09:05 +0200, Wolfram Fischer - Z I M wrote: When running the first example of cmdscale I got in R 2.0.1: loc-cmdscale(eurodist) str(loc) num [1:21, 1:2] 2290.3 -825.4 59.2 -82.8 -352.5 ... - attr(*, dimnames)=List of 2 ..$ : chr [1:21] Athens Barcelona Brussels Calais ... ..$ : NULL In R 2.1.0 I get: loc-cmdscale(eurodist) str(loc) num [1:21, 1:2] 2290.3 -825.4 59.2 -82.8 -352.5 ... - attr(*, dimnames)=List of 2 ..$ : NULL ..$ : NULL I miss the names of the cities. What can I do? You can use R 2.1.0-patched where this is fixed. cheers, jari oksanen -- Jari Oksanen [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] eigenvalues of a circulant matrix
Hi everyone. The following webpage gives a definition of circulant matrix, which agrees with the definition given in the magic package. http://mathworld.wolfram.com/CirculantMatrix.html best wishes rksh On May 3, 2005, at 08:06 am, Mulholland, Tom wrote: Well since I know nothing about this topic I have lurked so far, but here's my two bob's worth. Firstly I tried to make sense of Brian's initial reply. I have got no idea who Bellman is and you have not referenced (his/her) work in a way I can access the issues you refer to. So I assumed that's exactly what Brian was talking about. Secondly. toeplitz(1:4) [,1] [,2] [,3] [,4] [1,]1234 [2,]2123 [3,]3212 [4,]4321 require(magic) circulant(4) [,1] [,2] [,3] [,4] [1,]1234 [2,]4123 [3,]3412 [4,]2341 So they are obviously two different things. Although I think you may have implied (not stated) that the particular combination you were using resulted in both being exactly the same. It does appear as if in this case the (X) matrix is circulant. But then I'm no expert in even such simple things. Then I had no idea where I was going. So I tried the variations in eigen. I ran you code x-scan(h:/t.txt) y-x[c(109:216,1:108)] X-toeplitz(y) and then X[is.na(X)] numeric(0) So I didn't get any NAs t1 - eigen(X)$vectors t2 - eigen(X,symmetric = TRUE)$vectors identical(t1,t2) [1] TRUE Then t2 - eigen(X,symmetric = TRUE,EISPACK = TRUE)$vectors identical(t1,t2) [1] FALSE So there'e obviously more than one way of getting the vectors. Does the second one make more sense to you? I also noticed in the eigen help that there are references to issues such as IEEE 754 arithmetic,(They may also differ between methods and between platforms.) and or Hermitian if complex. All of these are out of my competence but they do signal to me that there are issues which may relate to hardware, digital arithmetic and other things of that ilk. I added the comment about complex because I have a vague idea that they are related to imaginary parts that you refer to. So not coming to any conclusion that makes sense to me, and given that there are often threads about supposed inaccuracies that have answers such as the digits you see are not always what are held by the machine I set my options(digits = 22) and noticed that some of the numbers are still going at the 22 decimal place suggesting that the machine might be incapable of producing perfectly accurate results using digital arithmetic. My other big sphere of ignorance is complex numbers. So I tried X-toeplitz(complex(real = y)) t1 - eigen(X)$vectors t1[1:20] [1] 0.068041577278880341+0i -0.068041577140546913+0i 0.068041576864811659+0i -0.068041576452430155+0i [5] 0.068041575907139579+0i -0.068041575231135451+0i 0.068041574435267163+0i -0.068041573525828514+0i [9] 0.068041572538722991+0i -0.068041571498323253+0i 0.068041570619888622+0i -0.068041570256170081+0i [13] 0.068041568759931989+0i -0.068041566476633147+0i 0.068041563560502477+0i -0.06804156305007+0i [17] 0.06804138765813+0i -0.068041549792984865+0i 0.068041544123969511+0i -0.068041537810956801+0i t2[1:20] [1] 0.068041381743976906 -0.068041381743976850 0.068041381743976781 -0.068041381743976753 0.068041381743976587 [6] -0.068041381743976725 0.068041381743976920 -0.068041381743976836 0.068041381743976892 -0.068041381743976781 [11] 0.068041381743976781 -0.068041381743977392 0.068041381743976725 -0.068041381743976753 0.068041381743976753 [16] -0.068041381743976698 0.068041381743976587 -0.068041381743976642 0.068041381743976698 -0.068041381743976490 Which is again different. I have no idea what I'm doing but you do seem to get slightly different answers depending upon which method you use. I do not know if one is superior to the others or where one draws the line in terms of accuracy. Tom -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Globe Trotter Sent: Tuesday, 3 May 2005 10:51 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] eigenvalues of a circulant matrix OK, here we go: I am submitting two attachments. The first is the datafile called kinv used to create my circulant matrix, using the following commands: x-scan(kinv) y-x[c(109:1,0:108)] X=toeplitz(y) eigen(X) write(X,ncol=216,file=test.dat) reports the following columns full of NaN's: 18, 58, 194, 200. (Note that eigen(X,symmetric=T) makes no difference and I get the same as above). The second attachment contains only the eigenvectors obtained on calling a LAPACK routine directly (from C). The eigenvalues are essentially the same as that obtained using R. Here, I use the LAPACK-recommended double precision routine dspevd() routine for symmetric matrices in packed storage format. Note the absence of the NaN'sI would be happy to send my C programs to whoever is interested. I am
[R] Survival
Dear list, I made survival analysis using Weibull regression. I got significance in the analysis: anova(m1) Df Deviance Resid. Df-2*LL P(|Chi|) NULL NA NA 2158 4933.109NA tratt -8 577.0669 2150 4356.042 1.988317e-119 and summary(m1) Call: survreg(formula = Surv(tempo, sensore) ~ tratt) Value Std. Error zp (Intercept) 3.615 9.01e-02 40.12195 0.00e+00 tratti 9.610 1.07e+03 0.00898 9.93e-01 trattma 0.692 1.92e-01 3.60420 3.13e-04 trattme 0.505 1.67e-01 3.03168 2.43e-03 tratts -0.211 1.11e-01 -1.90080 5.73e-02 trattt -0.916 9.85e-02 -9.29575 1.46e-20 trattte 0.132 1.31e-01 1.01251 3.11e-01 trattth -0.688 9.97e-02 -6.90145 5.15e-12 trattv -0.192 1.12e-01 -1.71203 8.69e-02 Log(scale) -0.674 3.54e-02 -19.04990 6.58e-81 Scale= 0.51 but I do not know how to check if the treatments are different from each other: shall I group them? Thank you for your attention, Marco ==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§== Marco Tasin Chemical Ecology Group Current Address: Swedish University of Agricultural Sciences Dep. of Crop Sciences Tel. +46 40 415306 Secretary +46 40 415301 Box 44 S-230 53 Alnarp Sweden ==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§==§== [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Ich bin's, was zum lachen ;)
- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] RMySQL installation: libz missing
Hi I run suse linux 9.1 and I installed MySQL server, client, devel, bench. DBI is installed, when I try to install RMySQL I get an error saying, that libz is missing. (paths to libs were set:export PKG_CPPFLAGS=-I/usr/include/mysql/ export PKG_LIBS=-L/usr/lib/mysql/ -lmysqlclient) so my question: where do I get the libz files (are these mysql files? if yes, why were they not installed at least by mysql-devel?) thanks for your kind help christoph __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Trying to understand kpss.test() in tseries package
On Mon, 02 May 2005 14:43:02 -0700 Waichler, Scott R wrote: I'm trying to understand how to use kpss.test() properly. If I have a level stationary series like rnorm() in the help page, shouldn't I get a small p-value with the null hypothesis set to Trend? No, every level stationary series is also trend stationary (with a zero trend). Hence, the test statistic is even smaller for null = Trend because first the trend is removed (which is not exactly zero due to random variation). Z The (condensed) output from kpss.test() for the two possible null hypotheses is given below. I don't see any significant difference between these results. x - rnorm(1000) # is level stationary kpss.test(x, null=Level) KPSS Test for Level Stationarity KPSS Level = 0.0638, Truncation lag parameter = 7, p-value = 0.1 Warning: p-value greater than printed p-value kpss.test(x, null=Trend) KPSS Test for Trend Stationarity KPSS Trend = 0.0275, Truncation lag parameter = 7, p-value = 0.1 Warning: p-value greater than printed p-value I can't get the original reference easily. Scott Waichler Pacific Northwest National Laboratory [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Lattice dotplot with symbols sized and colored
Apologies if this is a naive beginners question. I am trying to create a dotplot with the lattice dotplot function in which my dots are colored differently depending on if positive or negative and sized by sp.nc.bdrs.data$mwZ I have tried... dotplot(sporder ~ cvarorder | direct, data=sp.nc.bdrs.data, cex=abs(sp.nc.bdrs.data$mwZ * 0.05), xlab=climate variables, ylab=species,col= sp.nc.bdrs.data$mysign, scales = list(y = list(labels = as.character(spname),at = 1:12, cex = 0.5), x = list(labels = as.character(my.ylabel), at = 1:66, rot=90, cex = 0.5), alternating = 3)) This sizes my symbols correctly but colors all four conditional plots (direct = 'e', 'n', 's' 'w') using the colors defined for the first direct condition (i.e. 'e'). I have also tried using 'groups' to set the colors, however, whenever I do this I cannot get cex to then size the symbols - I get open circles that do not scale. This problem also happens when I try setting up a panel function. Many Thanks -- David M. Kidd Research Assistant School of Biology Room 210, Sir Harold Mitchell Building University of St. Andrews St. Andrews, Fife KY16 9TH UK http://www.st-and.ac.uk/~bugs/dave/dave.htm Tel: +44 (0)1334 463348 Fax: +44 (0)1334 463600 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] RMySQL installation: libz missing
hi christoph i had the same problem recently, i ended up finding that the following linux packages were missing (or at least one of them). php4-mysql php5-mysql php5-mysqli maybe that helps, sebastian On Tuesday 03 May 2005 12:54, Christoph Lehmann wrote: Hi I run suse linux 9.1 and I installed MySQL server, client, devel, bench. DBI is installed, when I try to install RMySQL I get an error saying, that libz is missing. (paths to libs were set:export PKG_CPPFLAGS=-I/usr/include/mysql/ export PKG_LIBS=-L/usr/lib/mysql/ -lmysqlclient) so my question: where do I get the libz files (are these mysql files? if yes, why were they not installed at least by mysql-devel?) thanks for your kind help christoph __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Sebastian Leuzinger Institute of Botany, University of Basel Schönbeinstr. 6 CH-4056 Basel ph0041 (0) 61 2673511 fax 0041 (0) 61 2673504 email [EMAIL PROTECTED] web http://pages.unibas.ch/botschoen/leuzinger __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R on Mac OS X: odd errors when doing install.packages()
Should I be worried? The installation seems to go through fine and apparently nothing is broken. The errors I repeatedly get are like this: g++ -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/ local/include -DUNIX -DOPTIM -DNONR -fno-common -g -O2 -c unif.cpp -o unif.o g++ -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o rgenoud.so c hange_order.o eval.o evaluate.o frange_ran.o genoud.o gradient.o math.o multiply .o numerics.o operators.o print_format.o rgenoud.o unif.o -lcc_dynamic -framewo rk R ld: warning multiple definitions of symbol _xerbla_ /Library/Frameworks/R.framework/R(print.lo) definition of _xerbla_ /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fra mework/Versions/A/libBLAS.dylib(single module) definition of _xerbla_ ld: warning multiple definitions of symbol _BC /Library/Frameworks/R.framework/Versions/2.1.0/Resources/lib/libreadline.5.0.dyl ib(terminal.so) definition of _BC /usr/lib/libncurses.5.dylib(lib_termcap.o) definition of _BC ld: warning multiple definitions of symbol _UP /Library/Frameworks/R.framework/Versions/2.1.0/Resources/lib/libreadline.5.0.dyl ib(terminal.so) definition of _UP /usr/lib/libncurses.5.dylib(lib_termcap.o) definition of _UP ld: warning multiple definitions of symbol _PC /Library/Frameworks/R.framework/Versions/2.1.0/Resources/lib/libreadline.5.0.dyl ib(terminal.so) definition of _PC /usr/lib/libncurses.5.dylib(lib_tputs.o) definition of _PC ** R ** help Building/Updating help pages for package 'rgenoud' Formats: text html latex example genoudtexthtmllatex example ** building package indices ... * DONE (rgenoud) -- Ajay Shah Consultant [EMAIL PROTECTED] Department of Economic Affairs http://www.mayin.org/ajayshah Ministry of Finance, New Delhi __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Locale settings on Debian
Hello! I have a problem with locales in R (debian package r-base) 2.1.0-1. I get the following error: $ R R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.0 (2005-04-18), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. R plot(1:10) Error in X11() : could not find any X11 fonts Check that the Font Path is correct. In addition: Warning messages: 1: locale not supported by Xlib: some X ops will operate in C locale 2: X cannot set locale modifiers # In R I have the following locales, which are a mixture of mine setting # (look at the end of this mail) and R settings i.e. some my locales # settings were overriden by R and some added R Sys.getlocale() [1]LC_CTYPE=en_US.utf8;LC_NUMERIC=C;LC_TIME=en_US.utf8;LC_COLLATE=en_US.utf8; LC_MONETARY=en_US.utf8;LC_MESSAGES=en_US.utf8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C; LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C # and new internationalization functions say that everything should be OK R l10n_info() $MBCS [1] TRUE $UTF-8 [1] TRUE # and It afcourse works fine if I set R Sys.setlocale(LC_CTYPE, C) # If I echo LC variables in terminal I have $ echo $LC $LC_ALL $LC_MEASUREMENT $LC_PAPER$LC_TIME $ echo $LC_PAPER a4 $ echo $LC_TIME en_US $ echo $LC_MEASUREMENT metric $ echo $LC_ALL en_US.utf8 $ echo $LAN $LANG $LANGUAGE $ echo $LANG en_US.utf8 $ echo $LANGUAGE en_US.utf8 # I use en_US.utf8 since I need possibility to display also non-ascii # characters in terminal. Does anyone have any suggestions what should I do? --- Lep pozdrav / With regards, Gregor Gorjanc -- University of Ljubljana Biotechnical FacultyURI: http://www.bfro.uni-lj.si/MR/ggorjan Zootechnical Department mail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzale fax: +386 (0)1 72 17 888 Slovenia, Europe -- One must learn by doing the thing; for though you think you know it, you have no certainty until you try. Sophocles ~ 450 B.C. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Lattice dotplot with symbols sized and colored
David Kidd wrote on 5/3/2005 3:08 AM: Apologies if this is a naive beginners question. I am trying to create a dotplot with the lattice dotplot function in which my dots are colored differently depending on if positive or negative and sized by sp.nc.bdrs.data$mwZ I have tried... dotplot(sporder ~ cvarorder | direct, data=sp.nc.bdrs.data, cex=abs(sp.nc.bdrs.data$mwZ * 0.05), xlab=climate variables, ylab=species,col= sp.nc.bdrs.data$mysign, scales = list(y = list(labels = as.character(spname),at = 1:12, cex = 0.5), x = list(labels = as.character(my.ylabel), at = 1:66, rot=90, cex = 0.5), alternating = 3)) This sizes my symbols correctly but colors all four conditional plots (direct = 'e', 'n', 's' 'w') using the colors defined for the first direct condition (i.e. 'e'). I have also tried using 'groups' to set the colors, however, whenever I do this I cannot get cex to then size the symbols - I get open circles that do not scale. This problem also happens when I try setting up a panel function. Many Thanks Hi David, I think you're on the right track using groups. However, you just have to set the trellis arguments correctly. For example, library(lattice) my.theme - function() { theme - col.whitebg() symb - theme$superpose.symbol symb$cex - seq(0.5, 1.5, length = length(symb$cex)) # symb$pch is c(1, 3, 6, 0, 5, 16, 17) by default for col.whitebg theme$superpose.symbol - symb theme } trellis.par.set(theme = my.theme()) # from ?dotplot dotplot(variety ~ yield | year, data = barley, groups = site) It's not necessary to create a theme. You can accomplish the same just using trellis.par.get and trellis.par.set. The above is just my personal preference. HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] General Question on learning R...
In the process of learning R, with a specific interest on financial time series. While I continue to get through the documents I am more a fan of learning by example and then looking up how each function is used. Any websites which post sample code for R? Thanks in advance. -- Jonathan [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Special characters in URI
Prof Brian Ripley wrote: On Tue, 3 May 2005, Gorjanc Gregor wrote: I am crossposting this to R-help and BioC, since it is relevant to both groups. I don't see the relevance to R-help. But the answer to your subject is Is it more rellevant for R-devel? unambiguous: valid URLs do not contain `special' characters -- they must be encoded. See RFC1738 at e.g. ftp://ftp.funet.fi/pub/doc/rfc/rfc1738.txt Yes, I understand that completely and I just wanted to know how other handle or have solved this issue. Having this in mind I am looking forward to your 'filePathToURL' function. Do you have any scratches of it already? What do you think about this scratch, which afcourse doesn't solve all special characters: fixURLchar - function(URL, from = c( , \, ,, #), to = c(%20, %22, %2c, %23)) { ## Checks if (length(from) != length(to)) stop(Length of 'from' and 'to' must be the same) ## Core for (i in seq(along=from)) { URL - gsub(pattern=from[i], replacement=to[i], x=URL) } return(URL) } At some point (probably 2.2.0) I intend to ensure that the mapping to file:// URLs that is done is a few places is encoded as necessary. This will likely result in a utility function filePathToURL or some such. -- Lep pozdrav / With regards, Gregor Gorjanc -- University of Ljubljana Biotechnical FacultyURI: http://www.bfro.uni-lj.si/MR/ggorjan Zootechnical Department mail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzale fax: +386 (0)1 72 17 888 Slovenia, Europe -- One must learn by doing the thing; for though you think you know it, you have no certainty until you try. Sophocles ~ 450 B.C. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] General Question on learning R...
On May 3, 2005, at 6:46 AM, Jonathan Q. wrote: In the process of learning R, with a specific interest on financial time series. While I continue to get through the documents I am more a fan of learning by example and then looking up how each function is used. Any websites which post sample code for R? The largest source of example code is R itself. If you have a command in which you are interested, you can often just type the command and the code will be shown to you. Try typing: ls() Then: ls It will show you the code used to produce the result. Also, each command has its own example(s) in the help. Sean __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Special characters in URI
Gregor GORJANC wrote: Prof Brian Ripley wrote: On Tue, 3 May 2005, Gorjanc Gregor wrote: I am crossposting this to R-help and BioC, since it is relevant to both groups. I don't see the relevance to R-help. But the answer to your subject is Is it more rellevant for R-devel? unambiguous: valid URLs do not contain `special' characters -- they must be encoded. See RFC1738 at e.g. ftp://ftp.funet.fi/pub/doc/rfc/rfc1738.txt Yes, I understand that completely and I just wanted to know how other handle or have solved this issue. Having this in mind I am looking forward to your 'filePathToURL' function. Do you have any scratches of it already? What do you think about this scratch, which afcourse doesn't solve all special characters: fixURLchar - function(URL, from = c( , \, ,, #), to = c(%20, %22, %2c, %23)) Just a comment. It is much safer/easier to use named vectors for mapping, e.g. map - c( =%20, \=%22, ,=%2c, #=%23) /Henrik { ## Checks if (length(from) != length(to)) stop(Length of 'from' and 'to' must be the same) ## Core for (i in seq(along=from)) { URL - gsub(pattern=from[i], replacement=to[i], x=URL) } return(URL) } At some point (probably 2.2.0) I intend to ensure that the mapping to file:// URLs that is done is a few places is encoded as necessary. This will likely result in a utility function filePathToURL or some such. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Lattice dotplot with symbols sized and colored
Sundar suggested setting up a theme which I have done... my.theme - function() { theme - col.whitebg() symb - theme$superpose.symbol symb$col= c(red,blue,green,yellow,orange,black,purple) #symb$pch is c(1,3,6,0,5,16,17) by default for col.whitebg theme$superpose.symbol - symb theme } trellis.par.set(theme = my.theme()) # from ?dotplot dotplot(sporder ~ cvarorder | direct, data=sp.nc.bdrs.data, groups = sp.nc.bdrs.data$mysign, cex=abs(sp.nc.bdrs.data$mwZ * 0.05), xlab=climate variables, ylab=species, scales = list(y = list(labels = as.character(spname),at = 1:12, cex = 0.5), x = list(labels = as.character(my.ylabel), at = 1:66, rot=90, cex = 0.5), alternating = 3)) Now if I am understanding lattice correctly setting symb$cex sets the size multiplier for symbols within each group but does not support the differential sizing of symbols for each record independently within each group. Hence I have tried to use a 'global' cex (after the groups statement), however, this has no effect on the displayed symbol size. Do I need to change the pch or another parameter to draw sized filled circles as is the default symbol for dotplot? Thanks Dave -- David M. Kidd Research Assistant School of Biology Room 210, Sir Harold Mitchell Building University of St. Andrews St. Andrews, Fife KY16 9TH UK http://www.st-and.ac.uk/~bugs/dave/dave.htm Tel: +44 (0)1334 463348 Fax: +44 (0)1334 463600 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: Fwd: Re: [R] eigenvalues of a circulant matrix
I think we need to make clear that eigen() by default relies on LAPACK routines and they in turn rely on BLAS routines. We have seen several instances in which LAPACK/BLAS return NaNs when they should not, but all that I am aware of are when (broken) external libraries were used. So the occurrence of NaNs should lead you to question other aspects of your computational environment. If you have such a broken environment, calling eigen(EISPACK=TRUE) may be a palliative, but it is better to track the problem down. On Tue, 3 May 2005 [EMAIL PROTECTED] wrote: I think the statement of the problem and the questions asked need clarifying. Some aspects puzzleme. See below. On 03-May-05 Globe Trotter wrote: Looks like the files did not go through again. In any case, here is the kinv: please cut and paste and save to a file: [data snipped] --- Globe Trotter [EMAIL PROTECTED] wrote: Date: Mon, 2 May 2005 19:51:24 -0700 (PDT) From: Globe Trotter [EMAIL PROTECTED] Subject: Re: [R] eigenvalues of a circulant matrix To: r-help@stat.math.ethz.ch OK, here we go: I am submitting two attachments. The first is the datafile called kinv used to create my circulant matrix, using the following commands: x-scan(kinv) y-x[c(109:1,0:108)] X=toeplitz(y) eigen(X) write(X,ncol=216,file=test.dat) Having cutpasted from the data placed in the body of the message (omitted here) I get 216 numbers. Having put these in a vector x (in my own way): length(x) ##[1] 216 Question 1: === Is this correct? Or has there been a problem with your posting of the data? If it is correct, given that you seem to only use x[1:109], was there some point in giving the rest? Question 2: === Next, using your command: y-x[c(109:1,0:108)] I now get length(y) ##[1] 217 (as expected). The 0 in 0:108 seems to have been ignored (again as expected), so this is equivalent to y-x[c(109:1,1:108)] Is this as intended? If so, why use 0:108 instead of 1:108? Check: y[1]##[1] 19.4495 x[109] ##[1] 19.4495 y[109] ##[1] -0.00116801 x[1]##[1] -0.00116801 y[110] ##[1] -0.00116801 x[1]##[1] -0.00116801 y[217] ##[1] -6.28085 x[108] ##[1] -6.28085 Can you confirm that this is as intended? Comment 3: == You next command X=toeplitz(y): No apparent problems, it gives a symmetric result: which(X != t(X)) ## numeric(0) with 217 rows and columns: dim(X) ##[1] 217 217 and looks circulant: X[(1:5),(1:5)] [,1] [,2] [,3] [,4] [,5] [1,] 19.449500 -6.280850 -0.486405 -0.826079 -0.167792 [2,] -6.280850 19.449500 -6.280850 -0.486405 -0.826079 [3,] -0.486405 -6.280850 19.449500 -6.280850 -0.486405 [4,] -0.826079 -0.486405 -6.280850 19.449500 -6.280850 [5,] -0.167792 -0.826079 -0.486405 -6.280850 19.449500 Question 4: === Your next command, eigen(X), would simply output the results to screen and does not assign to anything. Your next command write(X,ncol=216,file=test.dat) as it stands will write the toeplitz matrix X, constructed by your command X-toeplitz(y) to file, but with 216 columns instead of 217. However, the result consists simply of numbers, and there is nothing like NA or NaN in the file which I get. Nor are there any NAs or NaNs in X itself, of course. But, when you yourself did write(X,ncol=216,file=test.dat), perhaps the X in this command was different from the X which is the toeplitz matrix. So, was it the result of an assignment from eigen(X) and, if so, which component or components? Question/Comment 5: === So I have tried Z-eigen(X). First of all, I get no problems with NAs or NaNs: which(is.na(Z$values))##numeric(0) which(is.nan(Z$values)) ##numeric(0) which(is.na(Z$vectors)) ##numeric(0) which(is.nan(Z$vectors)) ##numeric(0) Next, trying various options for wirting to file: write(Z,ncol=216,file=test.dat) simply does not work (not a writable structure), while write(Z$values,ncol=216,file=test.dat) produces simply a set of numbers, no NAs of NaNs, and likewise write(Z$vectors,ncol=216,file=test.dat) (the only occurrences of non-numeric characters are e, as in e-05). reports the following columns full of NaN's: 18, 58, 194, 200. (Note that eigen(X,symmetric=T) makes no difference and I get the same as above). Therefore I find myself completely unable to reproduce your problem. However, for the various reasons stated in detail above, I am not at all sure that what you wrote as the statement of what you did in fact corresponds to what you really did! I even wonder whether Question 6: === Was the file test.dat the result of your write command? Or was it left over from a previous activity, the write from this session having failed to execute for some reason? (In which case the NaNs would have nothing to do with the results of eigen(X)). The second attachment contains only the eigenvectors obtained on calling a LAPACK routine directly (from C). The eigenvalues are essentially the same as that obtained using R. Here, I use the
[R] memory error message using MASS and GLMMGibbs
Hello, I was just testing the MASS code examples for chapter 10 (Random and Mixed Effects) and I have pasted the following code in an R session (2.1.0 in windows 2000 professional; I have also Xemacs + ESS installed, but I was not using them at that time; my machine has quite a lot of RAM): library(MASS) library(lattice) library(nlme) library(GLMMGibbs) # declare a random intercept for each subject epil$subject - Ra(data = factor(epil$subject)) glmm(y ~ lbase*trt + lage + V4 + subject, family = poisson, data = epil, keep = 10, thin = 100) and then an Application Error appears: The instruction at 0x1001edc9 referenced memory at 0x0008. The memory could not be written. It does not take long for this message to appear (less than 1s after I type Enter). Any help is welcome Jordi The information contained herein is confidential and is inte...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Step wise regression
Dear Fellows, How can I do to proced a step wise regression in R, if it´s possible ? Thanks, Walmir __ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - É grátis! http://antipopup.uol.com.br/ [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Special characters in URI
Henrik Bengtsson wrote: Gregor GORJANC wrote: ... What do you think about this scratch, which afcourse doesn't solve all special characters: fixURLchar - function(URL, from = c( , \, ,, #), to = c(%20, %22, %2c, %23)) Just a comment. It is much safer/easier to use named vectors for mapping, e.g. map - c( =%20, \=%22, ,=%2c, #=%23) ... Henrik, thanks. So you suggest something like for (i in seq(along=map)) { URL - gsub(pattern=names(map)[i], replacement=map[i], x=URL) } -- Lep pozdrav / With regards, Gregor Gorjanc -- University of Ljubljana Biotechnical FacultyURI: http://www.bfro.uni-lj.si/MR/ggorjan Zootechnical Department mail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzale fax: +386 (0)1 72 17 888 Slovenia, Europe -- One must learn by doing the thing; for though you think you know it, you have no certainty until you try. Sophocles ~ 450 B.C. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Step wise regression
Le 03.05.2005 14:53, walmir-rodrigues a écrit : Dear Fellows, How can I do to proced a step wise regression in R, if it´s possible ? Thanks, Walmir ?step ?stepAIC -- ~ ~~ Romain FRANCOIS - http://addictedtor.free.fr ~~ Etudiant ISUP - CS3 - Industrie et Services ~~http://www.isup.cicrp.jussieu.fr/ ~~ Stagiaire INRIA Futurs - Equipe SELECT ~~ http://www.inria.fr/recherche/equipes/select.fr.html~~ ~ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] RMySQL installation: libz missing SOLVED
it seemed to be a problem with the rpm for suse 9.1.. I installed and compiled R2.1 using the sources, then installation of RMySQL succeeded mmmh .. Christoph Christoph Lehmann wrote: Hi I run suse linux 9.1 and I installed MySQL server, client, devel, bench. DBI is installed, when I try to install RMySQL I get an error saying, that libz is missing. (paths to libs were set:export PKG_CPPFLAGS=-I/usr/include/mysql/ export PKG_LIBS=-L/usr/lib/mysql/ -lmysqlclient) so my question: where do I get the libz files (are these mysql files? if yes, why were they not installed at least by mysql-devel?) thanks for your kind help christoph __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: Fwd: Re: [R] eigenvalues of a circulant matrix
Thanks for looking into this! Sure, I will try and provide more info, but sorry I seem to be doing really badly with posting Having cutpasted from the data placed in the body of the message (omitted here) I get 216 numbers. Having put these in a vector x (in my own way): length(x) ##[1] 216 Question 1: === Is this correct? Or has there been a problem with your posting of the data? Yes, this is correct: it is supposed to be such that the circulant matrix is symmetric and so Toeplitz. I am just ignoring the rest (which are pretty close to x[107:1]. If it is correct, given that you seem to only use x[1:109], was there some point in giving the rest? No, I should have deleted it -- sorry. Question 2: === Next, using your command: y-x[c(109:1,0:108)] I now get length(y) ##[1] 217 My mistake: that should be 1 instead of 0. I sincerely apologize! (as expected). The 0 in 0:108 seems to have been ignored (again as expected), so this is equivalent to y-x[c(109:1,1:108)] Is this as intended? If so, why use 0:108 instead of 1:108? Check: y[1]##[1] 19.4495 x[109] ##[1] 19.4495 y[109] ##[1] -0.00116801 x[1]##[1] -0.00116801 y[110] ##[1] -0.00116801 x[1]##[1] -0.00116801 y[217] ##[1] -6.28085 x[108] ##[1] -6.28085 Can you confirm that this is as intended? Comment 3: == You next command X=toeplitz(y): No apparent problems, it gives a symmetric result: which(X != t(X)) ## numeric(0) with 217 rows and columns: dim(X) ##[1] 217 217 and looks circulant: X[(1:5),(1:5)] [,1] [,2] [,3] [,4] [,5] [1,] 19.449500 -6.280850 -0.486405 -0.826079 -0.167792 [2,] -6.280850 19.449500 -6.280850 -0.486405 -0.826079 [3,] -0.486405 -6.280850 19.449500 -6.280850 -0.486405 [4,] -0.826079 -0.486405 -6.280850 19.449500 -6.280850 [5,] -0.167792 -0.826079 -0.486405 -6.280850 19.449500 Question 4: === Your next command, eigen(X), would simply output the results to screen and does not assign to anything. true. But in my case, eigen(X)$vectors indicates the four columns to be NaN. Your next command write(X,ncol=216,file=test.dat) as it stands will write the toeplitz matrix X, constructed by your command X-toeplitz(y) to file, but with 216 columns instead of 217. However, the result consists simply of numbers, and there is nothing like NA or NaN in the file which I get. I made a mistake in typing -- it is 1:108, instead of 0. The file test.dat contains the symmetric circulant matrix on which I run the eigendecomposition using LAPACK. Nor are there any NAs or NaNs in X itself, of course. No, there are none. But, when you yourself did write(X,ncol=216,file=test.dat), perhaps the X in this command was different from the X which is the toeplitz matrix. So, was it the result of an assignment from eigen(X) and, if so, which component or components? No, no, X was the Toeplitz matrix and all the confusion stems from my typo (extremely sorry again!) Question/Comment 5: === So I have tried Z-eigen(X). First of all, I get no problems with NAs or NaNs: which(is.na(Z$values))##numeric(0) which(is.nan(Z$values)) ##numeric(0) which(is.na(Z$vectors)) ##numeric(0) which(is.nan(Z$vectors)) ##numeric(0) Next, trying various options for wirting to file: write(Z,ncol=216,file=test.dat) simply does not work (not a writable structure), while write(Z$values,ncol=216,file=test.dat) produces simply a set of numbers, no NAs of NaNs, and likewise write(Z$vectors,ncol=216,file=test.dat) (the only occurrences of non-numeric characters are e, as in e-05). reports the following columns full of NaN's: 18, 58, 194, 200. (Note that eigen(X,symmetric=T) makes no difference and I get the same as above). Question 6: === Was the file test.dat the result of your write command? Or was it left over from a previous activity, the write from this session having failed to execute for some reason? (In which case the NaNs would have nothing to do with the results of eigen(X)). The second attachment contains only the eigenvectors obtained on calling a LAPACK routine directly (from C). The eigenvalues are essentially the same as that obtained using R. Here, I use the LAPACK-recommended double precision routine dspevd() routine for symmetric matrices in packed storage format. Note the absence of the NaN'sI would be happy to send my C programs to whoever is interested. Well, I didn't get any NaNs in R either -- quite consistent with your C program! Please clarify according to the questions above. Best wishes, Ted. I am very sorry for all the errors and extra extra work that my typo caused you.I should have been more careful. I apologize again! Many thanks and best wishes!
Re: [R] Step wise regression
walmir-rodrigues wrote: Dear Fellows, How can I do to proced a step wise regression in R, if it´s possible ? Thanks, Walmir Here is an easy approach that will yield results only slightly less valid than one actually using the response variable: x - data.frame(x1,x2,x3,x4,..., other potential predictors) x[,sample(ncol(x))] :-) -Frank -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Special characters in URI
Gregor GORJANC wrote: Henrik Bengtsson wrote: Gregor GORJANC wrote: ... What do you think about this scratch, which afcourse doesn't solve all special characters: fixURLchar - function(URL, from = c( , \, ,, #), to = c(%20, %22, %2c, %23)) Just a comment. It is much safer/easier to use named vectors for mapping, e.g. map - c( =%20, \=%22, ,=%2c, #=%23) ... Henrik, thanks. So you suggest something like for (i in seq(along=map)) { URL - gsub(pattern=names(map)[i], replacement=map[i], x=URL) } Yes, something like that. To optimize, you might want to do patterns - names(map); for (i in seq(along=map)) { URL - gsub(pattern=patterns[i], replacement=map[i], x=URL) } More important is that you treat a standard % different from a % used in encoding, e.g. how do you want to convert the string 100% %20? You probably have to utilize more fancy regular expressions to detect a standard %. Maybe %[^0-9a-fA-F] will do. There should be much more details in the document Brian Ripley refered you to. In other words, you have to be careful and try to think through all cases you function may be called. A good test is to call it twice, once on your original string and the on the escaped on; you should get the same result. It depends how complete you want your function to be. Good luck Henrik __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: Fwd: Re: [R] eigenvalues of a circulant matrix
--- Prof Brian Ripley [EMAIL PROTECTED] wrote: I think we need to make clear that eigen() by default relies on LAPACK routines and they in turn rely on BLAS routines. We have seen several instances in which LAPACK/BLAS return NaNs when they should not, but all that I am aware of are when (broken) external libraries were used. So the occurrence of NaNs should lead you to question other aspects of your computational environment. If you have such a broken environment, calling eigen(EISPACK=TRUE) may be a palliative, but it is better to track the problem down. Dear Professor Ripley, Very interesting! eigen(EISPACK=TRUE) indeed does not return NaN's. So, you think my system is broken? How would anyone figure this out? However, why does my C program work fine, using the same LAPACK? (I must say that LAPACK was broken for a while on Fedora Core 3 -- when it was released, as documented on bugzilla, but a recompile with a fortran option supposedly took care of it.) Many thanks and best wishes! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Lattice dotplot with symbols sized and colored
On Tuesday 03 May 2005 06:39, David Kidd wrote: Sundar suggested setting up a theme which I have done... my.theme - function() { theme - col.whitebg() symb - theme$superpose.symbol symb$col= c(red,blue,green,yellow,orange,black,purple) #symb$pch is c(1,3,6,0,5,16,17) by default for col.whitebg theme$superpose.symbol - symb theme } trellis.par.set(theme = my.theme()) # from ?dotplot dotplot(sporder ~ cvarorder | direct, data=sp.nc.bdrs.data, groups = sp.nc.bdrs.data$mysign, cex=abs(sp.nc.bdrs.data$mwZ * 0.05), xlab=climate variables, ylab=species, scales = list(y = list(labels = as.character(spname),at = 1:12, cex = 0.5), x = list(labels = as.character(my.ylabel), at = 1:66, rot=90, cex = 0.5), alternating = 3)) Now if I am understanding lattice correctly setting symb$cex sets the size multiplier for symbols within each group but does not support the differential sizing of symbols for each record independently within each group. Hence I have tried to use a 'global' cex (after the groups statement), however, this has no effect on the displayed symbol size. Do I need to change the pch or another parameter to draw sized filled circles as is the default symbol for dotplot? Yes, canned features of lattice are not enough for this. Here's something that should work: with(sp.nc.bdrs.data, dotplot(sporder ~ cvarorder | direct, col.var = factor(mysign), cex.var = abs(mwZ), col = c('green', 'red'), panel = function(x, y, cex, col, cex.var, col.var, subscripts, ...) { panel.dotplot(x, y, col = col[col.var[subscripts]], cex = cex.var[subscripts] * 0.05, ...) })) Here's a version with the barley data (not a very good example, though): with(barley, dotplot(site ~ yield, col.var = factor(year), cex.var = yield, col = c('green', 'red'), panel = function(x, y, cex, col, cex.var, col.var, subscripts, ...) { panel.dotplot(x, y, col = col[col.var[subscripts]], cex = cex.var[subscripts] * 0.03, ...) })) Deepayan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] RMySQL installation: libz missing SOLVED
Hi, do you have zlib installed on your system? (rpm -q zlib tells you if or not) You can also try rpm -q --whatprovides libz . zlib provides libz. If not installed, the manual compilation of R uses its own version of zlib, if I understand it correctly. So, not really a problem with the rpm. Detlef On Tue, 03 May 2005 16:25:12 +0200 Christoph Lehmann [EMAIL PROTECTED] wrote: it seemed to be a problem with the rpm for suse 9.1.. I installed and compiled R2.1 using the sources, then installation of RMySQL succeeded mmmh .. Christoph __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Special characters in URI
Henrik Bengtsson wrote: ... Henrik, thanks. So you suggest something like for (i in seq(along=map)) { URL - gsub(pattern=names(map)[i], replacement=map[i], x=URL) } Yes, something like that. To optimize, you might want to do patterns - names(map); for (i in seq(along=map)) { URL - gsub(pattern=patterns[i], replacement=map[i], x=URL) } Do I gain anything more than readability by this optimization? More important is that you treat a standard % different from a % used in encoding, e.g. how do you want to convert the string 100% %20? You probably have to utilize more fancy regular expressions to detect a standard %. Maybe %[^0-9a-fA-F] will do. There should be much more details in the document Brian Ripley refered you to. In other words, you have to be careful and try to think through all cases you function may be called. A good test is to call it twice, once on your original string and the on the escaped on; you should get the same result. It depends how complete you want your function to be. Thanks again. -- Lep pozdrav / With regards, Gregor Gorjanc -- University of Ljubljana Biotechnical FacultyURI: http://www.bfro.uni-lj.si/MR/ggorjan Zootechnical Department mail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzale fax: +386 (0)1 72 17 888 Slovenia, Europe -- One must learn by doing the thing; for though you think you know it, you have no certainty until you try. Sophocles ~ 450 B.C. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Lattice dotplot with symbols sized and colored
Thank you very much Deepayan your code produces a beautiful plot. -- David M. Kidd Research Assistant School of Biology Room 210, Sir Harold Mitchell Building University of St. Andrews St. Andrews, Fife KY16 9TH UK http://www.st-and.ac.uk/~bugs/dave/dave.htm Tel: +44 (0)1334 463348 Fax: +44 (0)1334 463600 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Converting pc files to unix
Hello R users, I have R script files writen in my pc laptop. I encountered problems when I run those files in R in Mac OS X (10.3.5). Are there any ways in R that can make .R files executable? Thanks in advance Kevin __ [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Special characters in URI
Gregor GORJANC wrote: Henrik Bengtsson wrote: ... Henrik, thanks. So you suggest something like for (i in seq(along=map)) { URL - gsub(pattern=names(map)[i], replacement=map[i], x=URL) } Yes, something like that. To optimize, you might want to do patterns - names(map); for (i in seq(along=map)) { URL - gsub(pattern=patterns[i], replacement=map[i], x=URL) } Do I gain anything more than readability by this optimization? Yes, names() is only called once and not length(map) times. You won't probably notice it, but it is a good custom to do the above. Sometimes you're dealing with much larger vectors and then it will pay off. /Henrik More important is that you treat a standard % different from a % used in encoding, e.g. how do you want to convert the string 100% %20? You probably have to utilize more fancy regular expressions to detect a standard %. Maybe %[^0-9a-fA-F] will do. There should be much more details in the document Brian Ripley refered you to. In other words, you have to be careful and try to think through all cases you function may be called. A good test is to call it twice, once on your original string and the on the escaped on; you should get the same result. It depends how complete you want your function to be. Thanks again. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] grid and ps device (bg-color)
Hi! grid.rect(width=2, height=2, gp=gpar(fill=ps.options()$bg.color)) Yes, it works (more or less), but the best is to use grid.rect(width=unit(1,npc)+unit(0.5,inches),...) as postscript device leaves a 0.25-inch frame around the page. BTW wouldn't you fix a bug with the determination of strwidth in the code like this: l-c(1,23,456,7890) unit(1,strwidth,l) The last command calculates the width of the first element of l, which is not the thing one would like to have. The best would be the calculation of maximum length of vector's elements (a simple for-cycle in unit.c). It also solves the problems with t-grid.text(l,y=c(0.9,0.8,0.7,0.6)) unit(1,grobwidth,t) where the desired answer should be the length of the longest string in l (in R-2.0.1 this returns the length of the l[[0]] too). I have fixed it in my R installation but the patch is obvious. Thank you. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] eigenvalues of a circulant matrix
How was your R 2.0.1 built? Which Lapack did it link to, and which one does it load? Which BLAS? Is the BLAS threaded? Does it link to the optimized pthreads library? Etc. (I'm not a Fedora Core 3 user so I'm not sure what the default setup is, and of course I don't know if that's what you have.) As I pointed out in my previous post, in eigen() the matrix is inspected for symmetry so symmetric=TRUE is the same as not specifying this at all. You could try symmetric=FALSE... Reid Huntsinger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Globe Trotter Sent: Monday, May 02, 2005 10:51 PM To: r-help@stat.math.ethz.ch Subject: Re: [R] eigenvalues of a circulant matrix OK, here we go: I am submitting two attachments. The first is the datafile called kinv used to create my circulant matrix, using the following commands: x-scan(kinv) y-x[c(109:1,0:108)] X=toeplitz(y) eigen(X) write(X,ncol=216,file=test.dat) reports the following columns full of NaN's: 18, 58, 194, 200. (Note that eigen(X,symmetric=T) makes no difference and I get the same as above). The second attachment contains only the eigenvectors obtained on calling a LAPACK routine directly (from C). The eigenvalues are essentially the same as that obtained using R. Here, I use the LAPACK-recommended double precision routine dspevd() routine for symmetric matrices in packed storage format. Note the absence of the NaN'sI would be happy to send my C programs to whoever is interested. I am using :~ uname -a Linux 2.6.11-1.14_FC3 #1 Thu Apr 7 19:23:49 EDT 2005 i686 i686 i386 GNU/Linux and R.2.0.1. Many thanks and best wishes! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Nonparametric Tukey-type multiple comparisons Nemenyi test
I am trying to do a Nonparametric Tukey-type multiple comparison post-hoc test to determine which groups are significantly different. the manual page to `oneway_test' (in package `coin') has an example of the Nemenyi-Damico-Wolfe-Dunn test taken from Hollander Wolfe (1999). Best, Torsten I have read the dialogue on this topic from the R-help, and am still not clear why no statistical packages include this test as an option? Is it not an appropriate test to conduct on non-normally distributed data? Is the only option to calculate it by hand using the (Zar 1996) formula? Thank you in advance for your help. -- Rikki Grober- Dunsmore National Marine Fisheries Service National Marine Protected Areas Center 110 Shaffer Rd. Santa Cruz, CA 95060 831-420-3991 Unless someone like you, Cares a whole awful lot, Nothing is going to get better, It's not. - The Lorax, by Dr. Seuss, 1971 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Step wise regression
On 03-May-05 Frank E Harrell Jr wrote: walmir-rodrigues wrote: Dear Fellows, How can I do to proced a step wise regression in R, if it´s possible ? Thanks, Walmir Here is an easy approach that will yield results only slightly less valid than one actually using the response variable: x - data.frame(x1,x2,x3,x4,..., other potential predictors) x[,sample(ncol(x))] :-) -Frank Frank, you are a sneaky subversive! But you have given me a technical clue for a project long near to my heart (with Andy's important random parsimony refinement). This is to implement software-driven Clinical Trials articles, for submission to standard peer-reviewed journals. The underlying engine would be the dada-engine. For samples of what this can generate, visit http://www.elsewhere.org/cgi-bin/postmodern repeatedly (or click on the To generate another essay, follow this link link you will find just below the article generated; repeat ad libitum). Also at the foot of the page, you will find links to explanations of how it works. See also http://dev.null.org/dadaengine/ The basis is that articles of certain kinds have a predictable structure, and utilise terminology, phrases, sentence-structures and substantive elements drawn from typical usage, and are such that the real thing is indistiguishable from the results of sampling these elements at random, under the control of a rulebased recursive transition network automaton. Tailor-made for Clinical Trials, methinks. (Mind you, someone once did a lot of work setting up the rulebase for the PostModern Lit Crit genre which is what you get in the above samples). Best wishes, Ted. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Re: [BioC] Special characters in URI
There are safe ways of encoding URLs that contain funny characters: (space) %20 [ %5B ] %5D so your url would be: URL-'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc%20g%5Bau%5D' That makes your snippet work just fine. http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_14143 has the list. Francois On Mon, 2005-05-02 at 19:46, Gorjanc Gregor wrote: Hello! I am crossposting this to R-help and BioC, since it is relevant to both groups. I wrote a wrapper for Entrez search utility (link for this is provided bellow), which can add some new search functionality to existing code in Bioconductor's package 'annotate'*. http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html Entrez search utuility returns a XML document but I have a problem to use URI to retrieve that file, since URI can also contain characters, which should not be there according to http://www.faqs.org/rfcs/rfc2396.html I encountered problems with [ and ] as well as with space characters. However there might also be a problem with others i.e. reserved characters in URI syntax. My R example is: R library(annotate) Loading required package: Biobase Loading required package: tools Welcome to Bioconductor Vignettes contain introductory material. To view, simply type: openVignette() For details on reading vignettes, see the openVignette help page. R library(XML) R tmp$term - gorjanc g[au] R tmp$URL - http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc g[au] R tmp $term [1] gorjanc g[au] $URL [1] http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc g[au] R xmlTreeParse(tmp$URL, isURL=TRUE, handlers=NULL, asTree=TRUE) Error in xmlTreeParse(tmp$URL, isURL = TRUE, handlers = NULL, asTree = TRUE) : error in creating parser for http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc g[au] # so I have a problem with space and [ and ] # let's reduce a problem to just space or [] to be sure R tmp$URL - http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc g R xmlTreeParse(tmp$URL, isURL=TRUE, handlers=NULL, asTree=TRUE) Error in xmlTreeParse(tmp$URL, isURL = TRUE, handlers = NULL, asTree = TRUE) : error in creating parser for http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc g R tmp$URL - http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc[au]; R xmlTreeParse(tmp$URL, isURL=TRUE, handlers=NULL, asTree=TRUE) Error in xmlTreeParse(tmp$URL, isURL = TRUE, handlers = NULL, asTree = TRUE) : error in creating parser for http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc[au] # now show that it works fine without special chars R tmp$URL - http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc; R xmlTreeParse(tmp$URL, isURL=TRUE, handlers=NULL, asTree=TRUE) $doc $file [1] http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc; $version [1] 1.0 $children ... # now show a workaround for space tmp$URL - http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc%20g; xmlTreeParse(tmp$URL, isURL=TRUE, handlers=NULL, asTree=TRUE) R tmp$URL - http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc%20g; R xmlTreeParse(tmp$URL, isURL=TRUE, handlers=NULL, asTree=TRUE) $doc $file [1] http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?term=gorjanc%20g; $version [1] 1.0 $children ... As can be seen from above there is a possibility to handle this special characters and I wonder if this has already been done somewhere? If not I thought on a function fixURLchar, which would replace reserved characters with ther escaped sequences. Any comments, pointers, ... ? from = c( , \, ,, #), to = c(%20, %22, %2c, %23)) *When I'll solve problem I will send my code to 'annotate' maintainer and he can include it at his will in a package. Lep pozdrav / With regards, Gregor Gorjanc -- University of Ljubljana Biotechnical FacultyURI: http://www.bfro.uni-lj.si/MR/ggorjan Zootechnical Department mail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzale fax: +386 (0)1 72 17 888 Slovenia, Europe -- One must learn by doing the thing; for though you think you know it, you have no certainty until you try. Sophocles ~ 450 B.C. ___ Bioconductor mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/bioconductor __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the
Re: [R] Step wise regression
(Ted Harding) wrote: On 03-May-05 Frank E Harrell Jr wrote: walmir-rodrigues wrote: Dear Fellows, How can I do to proced a step wise regression in R, if it´s possible ? Thanks, Walmir Here is an easy approach that will yield results only slightly less valid than one actually using the response variable: x - data.frame(x1,x2,x3,x4,..., other potential predictors) x[,sample(ncol(x))] :-) -Frank Frank, you are a sneaky subversive! But you have given me a technical clue for a project long near to my heart (with Andy's important random parsimony refinement). Now I get Andy's comment - missed before that we need to randomly set parsimony level then sample without replacement. This is to implement software-driven Clinical Trials articles, for submission to standard peer-reviewed journals. The underlying engine would be the dada-engine. For samples of what this can generate, visit http://www.elsewhere.org/cgi-bin/postmodern What a great site! repeatedly (or click on the To generate another essay, follow this link link you will find just below the article generated; repeat ad libitum). Also at the foot of the page, you will find links to explanations of how it works. See also http://dev.null.org/dadaengine/ The basis is that articles of certain kinds have a predictable structure, and utilise terminology, phrases, sentence-structures and substantive elements drawn from typical usage, and are such that the real thing is indistiguishable from the results of sampling these elements at random, under the control of a rulebased recursive transition network automaton. Tailor-made for Clinical Trials, methinks. (Mind you, someone once did a lot of work setting up the rulebase for the PostModern Lit Crit genre which is what you get in the above samples). Great idea!! Frank Best wishes, Ted. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Problem: R lsst sich nicht starten
Ich habe schon lange mein Deutsch nicht geübt... also aus diesem gleichen Grund habe ich nicht geupgradet (das Wort fehlt mir). Ich glaube aber, dass das Problem liegt mit R.app und nicht R(framework)...ich hatte ähnliche Probleme beim Upgrade ... R im Terminal funktionierte, doch R.app startete nicht. Hast du das neuste Build von R.app? Sorry I can't be of more help, but I think some bugs simply need to be worked out with R.app. You'll probably just have to be patient...unless you want to use R from the terminal, which seems to work okay. As far as I know they're still doing nightly builds of R.app, so check back every day to see if it works. --Jake Clemens Augenstein wrote: Hallo, ich schreibe einfach mal deutsch, und hoffe dass Du das auch verstehst (if not write me back in English). OS X 10.3.9 Ich habe R 2.1.0 installiert, und das Programm hat auch funktioniert. Will wenig später wieder mit R arbeiten, es lässt sich aber nicht mehr starten. Das Programm R wurde unerwartet beendet, während ich versuche es durch Doppelklicken auf das R.app-symbol zum laufen zu bringen. Lösche alles was mit R zu tun hat (.app und die frameworks) und versuche es mit Version 2.0.1. Das lässt sich aber von Anfang an nicht starten (gleiches Syndrom wie die 2.1.0 Version). Installiere wieder 2.1.0, und oh wunder, es funktioniert. Aber nur bis ich versuche ein Histogramm abzuspeichern, dann R wurde wieder unerwartet (von mir schon ein bischen erwartet) beendet. Starte R von Neuem, versuche wieder ein Histo ab zu speichern, wieder das gleiche. Von nun an lässt sich R wieder gar nicht mehr starten. Ich habe hier noch die Fehlermeldung angehängt, die mir mein System angeboten hat an Apple zu schicken. Mit schönen Grüssen Clemens Date/Time: 2005-05-03 16:14:00 +0200 OS Version: 10.3.9 (Build 7W98) Report Version: 2 Command: R Path:/Applications/R.app/Contents/MacOS/R Version: 1.10 (1.10) PID: 533 Thread: 0 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x4080d006 Thread 0 Crashed: 0 com.apple.CoreFoundation 0x901c0f74 CFRetain + 0x20 1 com.apple.CoreFoundation 0x901dcc74 CFArrayCreate + 0x144 2 com.apple.Foundation 0x90a6c60c -[NSArray initWithObjects:] + 0xbc 3 org.R-project.R 0x3034 -[RController init] + 0x174 4 com.apple.AppKit 0x92f6bd80 -[NSCustomObject nibInstantiate] + 0x10c 5 com.apple.AppKit 0x92e9af38 -[NSIBObjectData instantiateObject:] + 0xbc 6 com.apple.AppKit 0x92ea1f64 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 0x88 7 com.apple.AppKit 0x92f93d04 loadNib + 0xfc 8 com.apple.AppKit 0x92eeaf28 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 0x2e8 9 com.apple.AppKit 0x92f69e00 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 0x9c 10 com.apple.AppKit 0x92f7b5f4 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 0x174 11 com.apple.AppKit 0x92f69c68 NSApplicationMain + 0x174 12 org.R-project.R 0x28f0 _start + 0x188 (crt.c:267) 13 dyld 0x8fe1a278 _dyld_start + 0x64 PPC Thread State: srr0: 0x901c0f74 srr1: 0xf030vrsave: 0x cr: 0x22000248 xer: 0x0018 lr: 0x901c0f6c ctr: 0x901c5acc r0: 0x901dcc74 r1: 0xb5f0 r2: 0x22000248 r3: 0x4080d000 r4: 0x4080d000 r5: 0x004033aa r6: 0x004033aa r7: 0x004033aa r8: 0x004033aa r9: 0x000e r10: 0x r11: 0x0001 r12: 0x901c5acc r13: 0x r14: 0x r15: 0x r16: 0x00330160 r17: 0xa2eaac40 r18: 0xa2e9ac40 r19: 0xa2eaac40 r20: 0xa2eaac40 r21: 0x00038dd4 r22: 0x r23: 0x000f r24: 0xb738 r25: 0xb73c r26: 0x0039d388 r27: 0xa01c2e94 r28: 0x000f r29: 0x0039d340 r30: 0x0039d384 r31: 0x901c0f6c Binary Images Description: 0x1000 -0x35fff org.R-project.R 1.10/Applications/R.app/Contents/MacOS/R 0x205000 - 0x226fff libreadline.5.0.dylib /Library/Frameworks/R.framework/Resources/lib/libreadline.5.0.dylib 0x1008000 - 0x1194fff libR.dylib /Library/Frameworks/R.framework/Resources/lib/libR.dylib 0x806c - 0x806e9fff libxslt.1.dylib /usr/lib/libxslt.1.dylib 0x8083 - 0x8090efff libxml2.2.dylib /usr/lib/libxml2.2.dylib 0x8dcb - 0x8dcb2fff com.apple.ExceptionHandling 1.2 (???)/System/Library/Frameworks/ExceptionHandling.framework/Versions/A/ExceptionHandling 0x8fe0 - 0x8fe4 dyld /usr/lib/dyld 0x9000 - 0x9014 libSystem.B.dylib /usr/lib/libSystem.B.dylib 0x901c - 0x9026dfff com.apple.CoreFoundation 6.3.7 (299.35)/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x902b - 0x90529fff com.apple.CoreServices.CarbonCore 10.3.7
[R] Using |
Dear all, I have a rodent dataset that I am reanalyzing. The set consists of several variables (#Microtus captured, Grass stems/m^2, etc), among which is a Grid factor variable c(North,South). I have evidence that there are significant differences in vegetation and rodent populations between the two locations (from chi-square tests) and would like to run separate analyses along North/South lines on the rest of my data. For example, I type: plot(Microtus.T~Grass | Grid) However, I get the following: Error in plot.window(xlim, ylim, log, asp, ...) : need finite xlim values In addition: Warning messages: 1: | not meaningful for factors in: Ops.factor(Grass, Grid) 2: no finite arguments to min; returning Inf 3: no finite arguments to max; returning -Inf Other than adding xlim arguments, what else can I do, especially in light of warning message 1? Thank you in advance. Sincerely, Jim Milks Graduate Student Environmental Sciences Ph.D. Program Wright State University 3640 Colonel Glenn Hwy Dayton, OH 45435 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Course***R/S-plus Fundamentals and Programming Techniques In New York
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce 2-day R/S-plus Fundamentals and Programming Techniques in New York: www.xlsolutions-corp.com/training.htm New York, NY -- May 26th - 27th,2005 Reserve your seat now at the early bird rates! Payment due AFTER the class Course Description: This two-day beginner to intermediate R/S-plus course focuses on a broad spectrum of topics, from reading raw data to a comparison of R and S. We will learn the essentials of data manipulation, graphical visualization and R/S-plus programming. We will explore statistical data analysis tools,including graphics with data sets. How to enhance your plots, build your own packages (librairies) and connect via ODBC,etc. We will perform some statistical modeling and fit linear regression models. Participants are encouraged to bring data for interactive sessions With the following outline: - An Overview of R and S - Data Manipulation and Graphics - Using Lattice Graphics - A Comparison of R and S-Plus - How can R Complement SAS? - Writing Functions - Avoiding Loops - Vectorization - Statistical Modeling - Project Management - Techniques for Effective use of R and S - Enhancing Plots - Using High-level Plotting Functions - Building and Distributing Packages (libraries) - Connecting; ODBC, Rweb, Orca via sockets and via Rjava Email us for group discounts. Email Sue Turner: [EMAIL PROTECTED] Phone: 206-686-1578 Visit us: www.xlsolutions-corp.com/training.htm Please let us know if you and your colleagues are interested in this classto take advantage of group discount. Register now to secure your seat! Interested in R/Splus Advanced course? email us. Cheers, Elvis Miller, PhD Manager Training. XLSolutions Corporation 206 686 1578 www.xlsolutions-corp.com [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Combining numeric vs numeric numeric vs factor graphs into one ps/pdf file
Dear R community, My previous email was incomplete because I used html format. Here it is again and sorry for any inconvenience: xyplot (lattice) has been great in displaying tons of data for my research. I have used the following two xyplot commands (with example dataframe) to create two separate postscript/pdf files with respect to the variable acft and subset status: test.df - data.frame(acft=factor(c(A,B,C,D)), status=factor(c(fail,pass,fail,pass)), site=factor(c(E1,E1,E2,E2)), CD=as.numeric(c(1,1,3,3)), H=as.numeric(c(80,NA,60,NA))) xyplot(H ~ CD | acft, data=test.df, subset=status==fail, layout=c(1,1) ) xyplot(site ~ CD | acft, data=test.df, subset=status==pass, layout=c(1,1) ) I would like to combine all graphs into one file in alphabetical order of variable acft. The graphs would be one per page where in fact I use layout=c(1,1) for the nice and easily seen strip labels for acft. The problem I am having is combining x-y plots that are numeric vs numeric numeric vs factor. I have search the R-help archives and R-project references for an example to no avail. I am thinking I may have to use something (lattice or not) like ... if any(test.df$Status==fail) plot(H ~ CD) else plot(site ~ CD) with for in the beginning to loop through all data with respect to acft. I need a hint on how to further this along. I am using R.2.1.0 via Windows XP. Thank you for any help, D. Arenas [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] General Question on learning R...
I'm looking at the same thing. A good source for this is to 'install.packages(c(fBasics, fCalendar, fExtremes, fMultivar, fOptions, fPotfolio, fractdiff, fSeries, its, lme4, zoo))', then 'update.packages()'. These will install subdirectories or folders with the indicated names fBasics, etc., in library with your R installation. For example, in my Windows installation, I have D:\Program files\R\rw2010pat\library, which contains many subfolders including ones named fSeries. These all contain files *.R, which provide sample code. spencer graves Sean Davis wrote: On May 3, 2005, at 6:46 AM, Jonathan Q. wrote: In the process of learning R, with a specific interest on financial time series. While I continue to get through the documents I am more a fan of learning by example and then looking up how each function is used. Any websites which post sample code for R? The largest source of example code is R itself. If you have a command in which you are interested, you can often just type the command and the code will be shown to you. Try typing: ls() Then: ls It will show you the code used to produce the result. Also, each command has its own example(s) in the help. Sean __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Step wise regression
Frank E Harrell Jr a écrit : walmir-rodrigues wrote: Dear Fellows, How can I do to proced a step wise regression in R, if it´s possible ? Thanks, Walmir Here is an easy approach that will yield results only slightly less valid than one actually using the response variable: x - data.frame(x1,x2,x3,x4,..., other potential predictors) x[,sample(ncol(x))] :-) -Frank competing for the fortune award ?... ;-) Renaud -- Dr Renaud Lancelot, vétérinaire C/0 Ambassade de France - SCAC BP 834 Antananarivo 101 - Madagascar e-mail: [EMAIL PROTECTED] tel.: +261 32 40 165 53 (cell) +261 20 22 665 36 ext. 225 (work) +261 20 22 494 37 (home) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Using |
Jim Milks wrote on 5/3/2005 8:34 AM: Dear all, I have a rodent dataset that I am reanalyzing. The set consists of several variables (#Microtus captured, Grass stems/m^2, etc), among which is a Grid factor variable c(North,South). I have evidence that there are significant differences in vegetation and rodent populations between the two locations (from chi-square tests) and would like to run separate analyses along North/South lines on the rest of my data. For example, I type: plot(Microtus.T~Grass | Grid) However, I get the following: Error in plot.window(xlim, ylim, log, asp, ...) : need finite xlim values In addition: Warning messages: 1: | not meaningful for factors in: Ops.factor(Grass, Grid) 2: no finite arguments to min; returning Inf 3: no finite arguments to max; returning -Inf Other than adding xlim arguments, what else can I do, especially in light of warning message 1? Thank you in advance. Sincerely, Jim Milks Are you confusing plot.formula with lattice:xyplot? Your example should work if you use: library(lattice) xyplot(Microtus.T ~ Grass | Grid) HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] eigenvalues of a circulant matrix
Good point: the Bellman reference is a book: Introduction to Matrix Analysis by Bellman (1960). McGraw-Hill Series in Matrix Theory. --- Robin Hankin [EMAIL PROTECTED] wrote: Hi everyone. The following webpage gives a definition of circulant matrix, which agrees with the definition given in the magic package. http://mathworld.wolfram.com/CirculantMatrix.html best wishes rksh On May 3, 2005, at 08:06 am, Mulholland, Tom wrote: Well since I know nothing about this topic I have lurked so far, but here's my two bob's worth. Firstly I tried to make sense of Brian's initial reply. I have got no idea who Bellman is and you have not referenced (his/her) work in a way I can access the issues you refer to. So I assumed that's exactly what Brian was talking about. Secondly. toeplitz(1:4) [,1] [,2] [,3] [,4] [1,]1234 [2,]2123 [3,]3212 [4,]4321 require(magic) circulant(4) [,1] [,2] [,3] [,4] [1,]1234 [2,]4123 [3,]3412 [4,]2341 So they are obviously two different things. Although I think you may have implied (not stated) that the particular combination you were using resulted in both being exactly the same. It does appear as if in this case the (X) matrix is circulant. But then I'm no expert in even such simple things. Then I had no idea where I was going. So I tried the variations in eigen. I ran you code x-scan(h:/t.txt) y-x[c(109:216,1:108)] X-toeplitz(y) and then X[is.na(X)] numeric(0) So I didn't get any NAs t1 - eigen(X)$vectors t2 - eigen(X,symmetric = TRUE)$vectors identical(t1,t2) [1] TRUE Then t2 - eigen(X,symmetric = TRUE,EISPACK = TRUE)$vectors identical(t1,t2) [1] FALSE So there'e obviously more than one way of getting the vectors. Does the second one make more sense to you? I also noticed in the eigen help that there are references to issues such as IEEE 754 arithmetic,(They may also differ between methods and between platforms.) and or Hermitian if complex. All of these are out of my competence but they do signal to me that there are issues which may relate to hardware, digital arithmetic and other things of that ilk. I added the comment about complex because I have a vague idea that they are related to imaginary parts that you refer to. So not coming to any conclusion that makes sense to me, and given that there are often threads about supposed inaccuracies that have answers such as the digits you see are not always what are held by the machine I set my options(digits = 22) and noticed that some of the numbers are still going at the 22 decimal place suggesting that the machine might be incapable of producing perfectly accurate results using digital arithmetic. My other big sphere of ignorance is complex numbers. So I tried X-toeplitz(complex(real = y)) t1 - eigen(X)$vectors t1[1:20] [1] 0.068041577278880341+0i -0.068041577140546913+0i 0.068041576864811659+0i -0.068041576452430155+0i [5] 0.068041575907139579+0i -0.068041575231135451+0i 0.068041574435267163+0i -0.068041573525828514+0i [9] 0.068041572538722991+0i -0.068041571498323253+0i 0.068041570619888622+0i -0.068041570256170081+0i [13] 0.068041568759931989+0i -0.068041566476633147+0i 0.068041563560502477+0i -0.06804156305007+0i [17] 0.06804138765813+0i -0.068041549792984865+0i 0.068041544123969511+0i -0.068041537810956801+0i t2[1:20] [1] 0.068041381743976906 -0.068041381743976850 0.068041381743976781 -0.068041381743976753 0.068041381743976587 [6] -0.068041381743976725 0.068041381743976920 -0.068041381743976836 0.068041381743976892 -0.068041381743976781 [11] 0.068041381743976781 -0.068041381743977392 0.068041381743976725 -0.068041381743976753 0.068041381743976753 [16] -0.068041381743976698 0.068041381743976587 -0.068041381743976642 0.068041381743976698 -0.068041381743976490 Which is again different. I have no idea what I'm doing but you do seem to get slightly different answers depending upon which method you use. I do not know if one is superior to the others or where one draws the line in terms of accuracy. Tom -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Globe Trotter Sent: Tuesday, 3 May 2005 10:51 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] eigenvalues of a circulant matrix OK, here we go: I am submitting two attachments. The first is the datafile called kinv used to create my circulant matrix, using the following commands: x-scan(kinv) y-x[c(109:1,0:108)] X=toeplitz(y) eigen(X) write(X,ncol=216,file=test.dat) reports the following columns full of NaN's: 18, 58, 194, 200. (Note that
Re: [R] Combining numeric vs numeric numeric vs factor graphs into one ps/pdf file
Hi David You probably want to write your own panel function and pass it into xyplot(). Something like mypanel - function (x,y, groups, subscripts) { if (status[subscripts] == pass) { panel.xyplot(H,CD) } else { panel.xyplot(site, CD) } } Check out the groups and subscripts arguments to xyplot. cheers Dave On 03/05/05, Arenas, David R. CIV NAVAIR DEPT [EMAIL PROTECTED] wrote: Dear R community, My previous email was incomplete because I used html format. Here it is again and sorry for any inconvenience: xyplot (lattice) has been great in displaying tons of data for my research. I have used the following two xyplot commands (with example dataframe) to create two separate postscript/pdf files with respect to the variable acft and subset status: test.df - data.frame(acft=factor(c(A,B,C,D)), status=factor(c(fail,pass,fail,pass)), site=factor(c(E1,E1,E2,E2)), CD=as.numeric(c(1,1,3,3)), H=as.numeric(c(80,NA,60,NA))) xyplot(H ~ CD | acft, data=test.df, subset=status==fail, layout=c(1,1) ) xyplot(site ~ CD | acft, data=test.df, subset=status==pass, layout=c(1,1) ) I would like to combine all graphs into one file in alphabetical order of variable acft. The graphs would be one per page where in fact I use layout=c(1,1) for the nice and easily seen strip labels for acft. The problem I am having is combining x-y plots that are numeric vs numeric numeric vs factor. I have search the R-help archives and R-project references for an example to no avail. I am thinking I may have to use something (lattice or not) like ... if any(test.df$Status==fail) plot(H ~ CD) else plot(site ~ CD) with for in the beginning to loop through all data with respect to acft. I need a hint on how to further this along. I am using R.2.1.0 via Windows XP. Thank you for any help, D. Arenas [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
Hi I'm a postgraduate student and I am currently busy with EVT. I am a new user to R and have been making use of the fExtremes package. Could you please tell me how to assign blocks by months? Your help will be greatly appreciated. Thanking you Abdullah Gierdien __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] eigenvalues of a circulant matrix
Under Linux run ldd on the binary to see what shared libraries the binary has been linked against and will attempt to load. The command you run is a shell script which sets and exports LD_LIBRARY_PATH and then runs R, so to be sure first start R and execute system(echo $LD_LIBRARY_PATH) and then using this value for LD_LIBRARY_PATH do $ export LD_LIBRARY_PATH=R's value for this $ ldd `R RHOME`/bin/exec/R which will list the shared libraries R will try to load to resolve links to shared libraries. Having said that, I have tried your example on several platforms with several configurations, and I get NaNs only when R is calling the Lapack routine dsyevr (R's builtin Lapack) with an external (optimized) blas (either Goto or ATLAS's blas) but not R's builtin blas. Moreover even with the optimized blas, if I use dysev instead of dsyevr, (eigen() executes a .Call(La_rs,x,only.values,dsyevr,PACKAGE=base), I execute this from R with dsyev in place of dsyevr) I get no NaNs. So it looks like a problem with a blas routine used by dsyevr but not dsyev, but I have yet to confirm. I note that your C program does not use either of these lapack routines. Reid Huntsinger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Globe Trotter Sent: Tuesday, May 03, 2005 12:21 PM To: Huntsinger, Reid; r-help@stat.math.ethz.ch Subject: RE: [R] eigenvalues of a circulant matrix Hi, The R was downloaded in binary form (Fedora Core 3 RPM) from a CRAN mirror. I do not know which LAPACK it links to, but the only LAPACK on my machine is lapack-3.0-28 (RPM installation). How does one figure out which BLAS or whether it is threaded? Many thanks and best wishes! --- Huntsinger, Reid [EMAIL PROTECTED] wrote: How was your R 2.0.1 built? Which Lapack did it link to, and which one does it load? Which BLAS? Is the BLAS threaded? Does it link to the optimized pthreads library? Etc. (I'm not a Fedora Core 3 user so I'm not sure what the default setup is, and of course I don't know if that's what you have.) As I pointed out in my previous post, in eigen() the matrix is inspected for symmetry so symmetric=TRUE is the same as not specifying this at all. You could try symmetric=FALSE... Reid Huntsinger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Globe Trotter Sent: Monday, May 02, 2005 10:51 PM To: r-help@stat.math.ethz.ch Subject: Re: [R] eigenvalues of a circulant matrix OK, here we go: I am submitting two attachments. The first is the datafile called kinv used to create my circulant matrix, using the following commands: x-scan(kinv) y-x[c(109:1,0:108)] X=toeplitz(y) eigen(X) write(X,ncol=216,file=test.dat) reports the following columns full of NaN's: 18, 58, 194, 200. (Note that eigen(X,symmetric=T) makes no difference and I get the same as above). The second attachment contains only the eigenvectors obtained on calling a LAPACK routine directly (from C). The eigenvalues are essentially the same as that obtained using R. Here, I use the LAPACK-recommended double precision routine dspevd() routine for symmetric matrices in packed storage format. Note the absence of the NaN'sI would be happy to send my C programs to whoever is interested. I am using :~ uname -a Linux 2.6.11-1.14_FC3 #1 Thu Apr 7 19:23:49 EDT 2005 i686 i686 i386 GNU/Linux and R.2.0.1. Many thanks and best wishes! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Notice: This e-mail message, together with any attachment...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Re: nlme: Deficient rank in gls_loglik when creating corAR1()
Is this a bug? Should I attach a test case? D On 03/05/05, David Hugh-Jones [EMAIL PROTECTED] wrote: I have a bunch of data which is structured by year and US state, so I have created a nlme groupedData object for it: formula(gd2) DEPVAR ~ YEAR | ABREV Now I am trying to run a gls regression on it. I want the error correlation structure to be AR1 with a different rho for each state, so I do mdyn.1.1 = gls(model = DEPVAR ~ BLAH + BLAH, data=gd2, corr=corAR1(form= ~ YEAR | ABREV),na.action=na.omit) YEAR and ABREV are always present; DEPVAR is absent for one state. I get the following error message: Error in logLik.glsStruct(glsSt, glsPars) : Deficient rank in gls_loglik Can anyone enlighten me? The error message goes away if I just do corAR1(form = ~1), but this is not meaningful for my data. Cheers David __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] General Question on learning R...
assuming one has these installed already, you just look in the demo folder under each? i.e., fBasics\demo ??? On 5/3/05, Spencer Graves [EMAIL PROTECTED] wrote: I'm looking at the same thing. A good source for this is to 'install.packages(c(fBasics, fCalendar, fExtremes, fMultivar, fOptions, fPotfolio, fractdiff, fSeries, its, lme4, zoo))', then 'update.packages()'. These will install subdirectories or folders with the indicated names fBasics, etc., in library with your R installation. For example, in my Windows installation, I have D:\Program files\R\rw2010pat\library, which contains many subfolders including ones named fSeries. These all contain files *.R, which provide sample code. spencer graves Sean Davis wrote: On May 3, 2005, at 6:46 AM, Jonathan Q. wrote: In the process of learning R, with a specific interest on financial time series. While I continue to get through the documents I am more a fan of learning by example and then looking up how each function is used. Any websites which post sample code for R? The largest source of example code is R itself. If you have a command in which you are interested, you can often just type the command and the code will be shown to you. Try typing: ls() Then: ls It will show you the code used to produce the result. Also, each command has its own example(s) in the help. Sean __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Jonathan [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Rd.sty error
I had written a vignette and included a \usepackage{Rd} command to make it possible to include latex'ed Rd files in the vignette. However, when loading Rd.sty texShop produces the following error: l. 180 ...d}[1]{\ifmmode\bm{#1}\else\textbf{#1}\fi} This is on Max OS X 3.9 and R 2.0.1 Has anyone seen this before and/or is it problematic? I'm not sure whether the output suffers from this but it does create a problem with R CMD check because tex produces a warning/error there. any hints are welcome, ingmar -- Ingmar Visser Department of Psychology, University of Amsterdam Roetersstraat 15, 1018 WB Amsterdam The Netherlands http://users.fmg.uva.nl/ivisser/ tel: +31-20-5256735 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] General Question on learning R...
Yes. Thanks for the elaboration. What differences might one expect between the contents of \demo and \R-ex? (I found \R-ex with all the packages I named, but not all had \demo.) spencer graves There seem to be different Jonathan Q. wrote: assuming one has these installed already, you just look in the demo folder under each? i.e., fBasics\demo ??? On 5/3/05, Spencer Graves [EMAIL PROTECTED] wrote: I'm looking at the same thing. A good source for this is to 'install.packages(c(fBasics, fCalendar, fExtremes, fMultivar, fOptions, fPotfolio, fractdiff, fSeries, its, lme4, zoo))', then 'update.packages()'. These will install subdirectories or folders with the indicated names fBasics, etc., in library with your R installation. For example, in my Windows installation, I have D:\Program files\R\rw2010pat\library, which contains many subfolders including ones named fSeries. These all contain files *.R, which provide sample code. spencer graves Sean Davis wrote: On May 3, 2005, at 6:46 AM, Jonathan Q. wrote: In the process of learning R, with a specific interest on financial time series. While I continue to get through the documents I am more a fan of learning by example and then looking up how each function is used. Any websites which post sample code for R? The largest source of example code is R itself. If you have a command in which you are interested, you can often just type the command and the code will be shown to you. Try typing: ls() Then: ls It will show you the code used to produce the result. Also, each command has its own example(s) in the help. Sean __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Classes and methods
Hi R people: I would like to learn about classes, methods, S3 and S4. Which book would be the most helpful for this info, please: the green one or the white(and blue) one? Or is there something that would be even better, please? Thanks in advance. Sincerely, Laura Holt mailto: [EMAIL PROTECTED] R 2.1.0 Windows. trying to learn __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Rd.sty error
I don't see an error message here. And what is `texShop'? I think we need (a lot) more details of what you actually are doing. On Tue, 3 May 2005, Ingmar Visser wrote: I had written a vignette and included a \usepackage{Rd} command to make it possible to include latex'ed Rd files in the vignette. However, when loading Rd.sty texShop produces the following error: l. 180 ...d}[1]{\ifmmode\bm{#1}\else\textbf{#1}\fi} This is on Max OS X 3.9 and R 2.0.1 Has anyone seen this before and/or is it problematic? I'm not sure whether the output suffers from this but it does create a problem with R CMD check because tex produces a warning/error there. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Classes and methods
On 5/3/05, Laura Holt [EMAIL PROTECTED] wrote: Hi R people: I would like to learn about classes, methods, S3 and S4. Which book would be the most helpful for this info, please: the green one or the white(and blue) one? Or is there something that would be even better, please? Reading the source of a few packages: R2HTML (S3), zoo (S3) and its (S4) would get you up to speed quickly. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] General Question on learning R...
On Tue, 03 May 2005 11:40:12 -0700 Spencer Graves wrote: Yes. Thanks for the elaboration. What differences might one expect between the contents of \demo and \R-ex? (I found \R-ex with all the packages I named, but not all had \demo.) `R-ex' contains the examples from the `man' pages and demo contains the `demo' files. Whereas man pages are necessary to pass R CMD check, demo files are not, so this is part of the reason while much more packages have examples but not demos. You can conveniently look at both, using examples() and demo() from within R. Z spencer graves There seem to be different Jonathan Q. wrote: assuming one has these installed already, you just look in the demo folder under each? i.e., fBasics\demo ??? On 5/3/05, Spencer Graves [EMAIL PROTECTED] wrote: I'm looking at the same thing. A good source for this is to'install.packages(c(fBasics, fCalendar, fExtremes, fMultivar,fOptions, fPotfolio, fractdiff, fSeries, its, lme4,zoo))', then 'update.packages()'. These will install subdirectoriesor folders with the indicated names fBasics, etc., in library withyour R installation. For example, in my Windows installation, I haveD:\Program files\R\rw2010pat\library, which contains many subfoldersincluding ones named fSeries. These all contain files *.R, whichprovide sample code. spencer graves Sean Davis wrote: On May 3, 2005, at 6:46 AM, Jonathan Q. wrote: In the process of learning R, with a specific interest on financialtime series. While I continue to get through the documents I am morea fan of learning by example and then looking up how each function isused. Any websites which post sample code for R? The largest source of example code is R itself. If you have a commandin which you are interested, you can often just type the command and thecode will be shown to you. Try typing: ls() Then: ls It will show you the code used to produce the result. Also, each command has its own example(s) in the help. Sean __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] memory error message using MASS and GLMMGibbs
This works for me (after quite a while) using the pre-compiled binary from CRAN on Windows XP. It is random, so try a different seed. If you consult the rw-FAQ you will see how to get a more usable error message. On Tue, 3 May 2005, Molins, Jordi wrote: Hello, I was just testing the MASS code examples for chapter 10 (Random and Mixed Effects) and I have pasted the following code in an R session (2.1.0 in windows 2000 professional; I have also Xemacs + ESS installed, but I was not using them at that time; my machine has quite a lot of RAM): library(MASS) library(lattice) library(nlme) library(GLMMGibbs) # declare a random intercept for each subject epil$subject - Ra(data = factor(epil$subject)) glmm(y ~ lbase*trt + lage + V4 + subject, family = poisson, data = epil, keep = 10, thin = 100) and then an Application Error appears: The instruction at 0x1001edc9 referenced memory at 0x0008. The memory could not be written. It does not take long for this message to appear (less than 1s after I type Enter). Any help is welcome Jordi The information contained herein is confidential and is inte...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Classes and methods
I **Highly** recommend VR's S PROGRAMMING. AFAIK, the R (or S-Plus) implementation of S4 classes is not exactly as given by the Green book, which is the authorative reference, however. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Laura Holt Sent: Tuesday, May 03, 2005 11:47 AM To: r-help@stat.math.ethz.ch Subject: [R] Classes and methods Hi R people: I would like to learn about classes, methods, S3 and S4. Which book would be the most helpful for this info, please: the green one or the white(and blue) one? Or is there something that would be even better, please? Thanks in advance. Sincerely, Laura Holt mailto: [EMAIL PROTECTED] R 2.1.0 Windows. trying to learn __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Classes and methods
On May 3, 2005, at 2:53 PM, Gabor Grothendieck wrote: On 5/3/05, Laura Holt [EMAIL PROTECTED] wrote: Hi R people: I would like to learn about classes, methods, S3 and S4. Which book would be the most helpful for this info, please: the green one or the white(and blue) one? Or is there something that would be even better, please? Reading the source of a few packages: R2HTML (S3), zoo (S3) and its (S4) would get you up to speed quickly. I just did some of this learning myself. Here are a couple of links that I found useful: http://www.stat.auckland.ac.nz/S-Workshop/Gentleman/S4Objects.pdf http://eeyore.ucdavis.edu/stat250/OOP.html I found the first particularly easy reading and it got me going quickly with S4 methods, which it seems to me are the way to go in most cases. Sean __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
Does anybory knows any work comparing R with other (charged) statistical softwares (like Minitab, SPSS, SAS)? I work in a brasilian government bureau and I intend to use R as our preferable statistical software, but I have to show it's as good as the others. I also intend to use Weka, and for this one I have the same problem. Can anyone help me? Thanks René M. Raupp e-mail: [EMAIL PROTECTED] [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] numerical integration of x,y data
Hi, I was looking for a routine that would do numerical integration using x,y data rather than integrating a function. Searching CRAN showed me the sfsmisc package, which contains integrate.xy. However the documentation mentions that its not good for noisy data and plans to implement the Romberg method. Is this the package that is generally used to perform this type of integration or are there other routines available? Thanks, --- Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE --- Say it with flowers - give her a triffid __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Command to add two vectors
Dear All Is there some command to add two vectors? Thanks in advance, Paul __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Command to add two vectors
On 5/3/05, Josef Eschgfaeller [EMAIL PROTECTED] wrote: Is there some command to add two vectors? x+y Thanks a lot, Josef. Paul __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] grid and ps device (bg-color)
Hi mkondrin wrote: Hi! grid.rect(width=2, height=2, gp=gpar(fill=ps.options()$bg.color)) Yes, it works (more or less), but the best is to use grid.rect(width=unit(1,npc)+unit(0.5,inches),...) as postscript device leaves a 0.25-inch frame around the page. BTW wouldn't you fix a bug with the determination of strwidth in the code like this: l-c(1,23,456,7890) unit(1,strwidth,l) The last command calculates the width of the first element of l, which is not the thing one would like to have. The best would be the calculation of maximum length of vector's elements (a simple for-cycle in unit.c). It also solves the problems with t-grid.text(l,y=c(0.9,0.8,0.7,0.6)) unit(1,grobwidth,t) where the desired answer should be the length of the longest string in l (in R-2.0.1 this returns the length of the l[[0]] too). I have fixed it in my R installation but the patch is obvious. This is fixed (different) in R 2.1.0. If there are several strings, the width is taken from the bounding box of the strings. For example grid.rect(width=grobWidth(grid.text(c(different, bits of, text, with the longest, not the first), x=.5, y=1:5/6))) Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Classes and methods
Sean Davis wrote: I just did some of this learning myself. Here are a couple of links that I found useful: http://www.stat.auckland.ac.nz/S-Workshop/Gentleman/S4Objects.pdf http://eeyore.ucdavis.edu/stat250/OOP.html I found the first particularly easy reading and it got me going quickly with S4 methods, which it seems to me are the way to go in most cases. If you want to simultaneously handcuff yourself, strap yourself into a strait jacket, and tie yourself in knots, and moreover write code which is incomprehensible to the human mind, then S4 methods are indeed the way to go. cheers, Rolf Turner [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Installing GO 1.7.0
Hi, is the announced solution for the GO 1.7.0 installation already publicly available? I am running into the same trouble as described in below, using 2.0.1 under Ubuntu Hoary. Thanks, Christian Seth Falcon wrote: Hi Tom, I'm cc'ing to Bioconductor as that is probably a better place for the discussion. Tom 'spot' Callaway [EMAIL PROTECTED] writes: I'm in the process of packaging R (and R modules) for future inclusion in Fedora Extras, and I've managed to get several hundred modules installed without issue, however, the GO metadata package is refusing to comply. ERROR: installing package indices failed I let this run for over 6 hours, and it didn't seem to complete (or make any changes). We have a solution for this and will send or make available an updated GO package shortly. With the updated GO package you should be able to R CMD INSTALL without it taking much time. Best, + seth __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html I'm in the process of packaging R (and R modules) for future inclusion in Fedora Extras, and I've managed to get several hundred modules installed without issue, however, the GO metadata package is refusing to comply. Since I'm packaging this in rpm format, I can't use any of the automated functions for build, I've got to do it locally through R. The following steps work for other metadata packages (directory names changing, obviously), but not for GO: With the GO tarball unpacked into R-GO-1.7.0/GO... cd R-GO-1.7.0/ rm -rf /var/tmp/R-GO-1.7.0-1-root-root mkdir -p /var/tmp/R-GO-1.7.0-1-root-root/usr/lib/R/library export R_LIBS=/var/tmp/R-GO-1.7.0-1-root-root/usr/lib/R/library /usr/bin/R CMD INSTALL \ -l /var/tmp/R-GO-1.7.0-1-root-root/usr/lib/R/library GO I get the following output: * Installing *source* package 'GO' ... ** R ** data ** preparing package for lazy loading ** help Building/Updating help pages for package 'GO' Formats: text html latex example GOtexthtmllatex GOALLLOCUSID texthtmllatex example GOBPANCESTOR texthtmllatex example GOBPCHILDREN texthtmllatex example GOBPOFFSPRING texthtmllatex example GOBPPARENTS texthtmllatex example GOCCANCESTOR texthtmllatex example GOCCCHILDREN texthtmllatex example GOCCOFFSPRING texthtmllatex example GOCCPARENTS texthtmllatex example GOLOCUSID texthtmllatex example GOLOCUSID2ALLGO texthtmllatex example GOLOCUSID2GO texthtmllatex example GOMFANCESTOR texthtmllatex example GOMFCHILDREN texthtmllatex example GOMFOFFSPRING texthtmllatex example GOMFPARENTS texthtmllatex example GOQC texthtmllatex GOTERMtexthtmllatex example But I never get the * DONE (GO) that I'm expecting. Instead, all of the memory on the machine allocates (512MB), it starts to swap out, and never completes. When I look at the output from ps, I see: 8290 pts/5S+ 0:00 /bin/sh /usr/lib/R/bin/INSTALL -l /var/tmp/R-GO-1.7.0-1-root-root/us 8364 ?S 0:00 8421 pts/5D+ 1:11 /usr/lib/R/bin/exec/R --vanilla When I kill the 8421 process, I get: /usr/lib/R/bin/INSTALL: line 381: 8088 Doneecho invisible(.libPaths(c(\${lib}\, .libPaths(; tools:::.install_package_indices(\.\, \${R_PACKAGE_DIR}\) 8089 Killed | R_DEFAULT_PACKAGES=NULL LANG=C ${R_EXE} --vanilla /dev/null ERROR: installing package indices failed I let this run for over 6 hours, and it didn't seem to complete (or make any changes). Unfortunately, lots of Bioconductor seems to depend on GO... so any help on getting this to install is appreciated. Thanks, ~spot -- Tom spot Callaway: Red Hat Sales Engineer || GPG Fingerprint: 93054260 Fedora Extras Steering Committee Member (RPM Standards and Practices) Aurora Linux Project Leader: http://auroralinux.org Lemurs, llamas, and sparcs, oh my! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] multivariate Shapiro Wilks test
Hello, I have a question about multivariate Shapiro-Wilks test. I tried to analyze if the data I have are multivariate normal, or how far they are from being multivariate normal. However, any time I did mshapiro.test(mydata) I get the message: Error in solve.default(R %*% t(R), tol = 1e-18) : system is computationally singular: reciprocal condition number = 5.38814e-021 I tried also to generate some multivariate normal data and to see how the test would be working on it. So I did: a - mvrnorm(1000, c(1,2,3,4,5), diag(5)) mshapiro.test(a) But any time I get: Error in solve.default(R %*% t(R), tol = 1e-18) : system is computationally singular: reciprocal condition number = small number Could somebody help me what is wrong with this example? Thank you very much in advance! Anna __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] multivariate Shapiro Wilks test
Anna, It looks like the mshapiro.test wants its data in the row format, that is, for a k-variate sample of size n you need the data in a k-by-n matrix. Try a - t(mvrnorm(1000, c(1,2,3,4,5), diag(5))) mshapiro.test(a) and it should work fine. Cheers, Andy __ Andy Jaworski 518-1-01 Process Laboratory 3M Corporate Research Laboratory - E-mail: [EMAIL PROTECTED] Tel: (651) 733-6092 Fax: (651) 736-3122 Anna Oganyan [EMAIL PROTECTED] g To Sent by: r-help@stat.math.ethz.ch [EMAIL PROTECTED] cc at.math.ethz.ch Subject [R] multivariate Shapiro Wilks test 05/03/2005 04:29 AM Hello, I have a question about multivariate Shapiro-Wilks test. I tried to analyze if the data I have are multivariate normal, or how far they are from being multivariate normal. However, any time I did mshapiro.test(mydata) I get the message: Error in solve.default(R %*% t(R), tol = 1e-18) : system is computationally singular: reciprocal condition number = 5.38814e-021 I tried also to generate some multivariate normal data and to see how the test would be working on it. So I did: a - mvrnorm(1000, c(1,2,3,4,5), diag(5)) mshapiro.test(a) But any time I get: Error in solve.default(R %*% t(R), tol = 1e-18) : system is computationally singular: reciprocal condition number = small number Could somebody help me what is wrong with this example? Thank you very much in advance! Anna __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Rd.sty error
Dear Prof Ripley, The problem is this: I create a package with a vignette which also includes some of the help files from the package. These are \input'ed into the vignette (after generating them with Rdconv -t=latex. After running sweave, I get the package-manual.tex file which runs succesfully through my tex application (texshop is a mac os x tex gui that uses tetex), albeit with \batchmode on to catch the error described below. The package successfully passes R CMD check. However, when I subsequently R CMD build the package I get the following message: * creating vignettes ... ERROR /Library/Frameworks/R.framework/Resources/bin/texi2dvi: pdflatex exited with bad status, quitting. /Library/Frameworks/R.framework/Resources/bin/texi2dvi: see depmix-manual.log for errors. Error in texi2dvi(file = bft, pdf = TRUE, clean = FALSE, quiet = quiet) : running texi2dvi on depmix-manual.tex failed Execution halted version _ platform powerpc-apple-darwin6.8 arch powerpc os darwin6.8 system powerpc, darwin6.8 status major2 minor0.1 year 2004 month11 day 15 language R The error I described earlier appears after this line: /usr/local/teTeX/share/texmf.tetex/tex/latex/url/url.sty This error does not occur when I comment out \usepackage{Rd}, although then of course many other errors occur such as \code and \pkg being undefined. Any hints as to where to go from here are very welcome! best, ingmar The depmix-manual.log reads as follows: This is pdfeTeX, Version 3.141592-1.20a-2.2 (Web2C 7.5.3) (format=pdflatex 2004.11.26) 3 MAY 2005 17:17 entering extended mode **\nonstopmode \input /Users/ivisser/Documents/Projects/HMM/depmixprog/depmix/i nst/doc/depmix-manual.tex (/Users/ivisser/Documents/Projects/HMM/depmixprog/depmix/inst/doc/depmix-man ual .tex (/usr/local/teTeX/share/texmf.tetex/tex/latex/base/report.cls Document Class: report 2004/02/16 v1.4f Standard LaTeX document class (/usr/local/teTeX/share/texmf.tetex/tex/latex/base/size10.clo File: size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option) ) [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (/usr/local/teTeX/share/texmf.tetex/tex/latex/amsmath/amsmath.sty Package: amsmath 2000/07/18 v2.13 AMS math features [EMAIL PROTECTED] For additional information on amsmath, use the `?' option. (/usr/local/teTeX/share/texmf.tetex/tex/latex/amsmath/amstext.sty Package: amstext 2000/06/29 v2.01 (/usr/local/teTeX/share/texmf.tetex/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 [EMAIL PROTECTED] [EMAIL PROTECTED] )) (/usr/local/teTeX/share/texmf.tetex/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d [EMAIL PROTECTED] ) (/usr/local/teTeX/share/texmf.tetex/tex/latex/amsmath/amsopn.sty Package: amsopn 1999/12/14 v2.01 operator names ) [EMAIL PROTECTED] LaTeX Info: Redefining \frac on input line 211. [EMAIL PROTECTED] [EMAIL PROTECTED] LaTeX Info: Redefining \overline on input line 307. [EMAIL PROTECTED] [EMAIL PROTECTED] LaTeX Info: Redefining \ldots on input line 379. LaTeX Info: Redefining \dots on input line 382. LaTeX Info: Redefining \cdots on input line 467. [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] LaTeX Font Info:Redeclaring font encoding OML on input line 567. LaTeX Font Info:Redeclaring font encoding OMS on input line 568. [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] \multlinegap=\skip44 \multlinetaggap=\skip45 [EMAIL PROTECTED] LaTeX Info: Redefining \[ on input line 2666. LaTeX Info: Redefining \] on input line 2667. ) (/usr/local/teTeX/share/texmf.tetex/tex/latex/amsfonts/amsfonts.sty Package: amsfonts 2001/10/25 v2.2f \symAMSa=\mathgroup4 \symAMSb=\mathgroup5 LaTeX Font Info:Overwriting math alphabet `\mathfrak' in version `bold' (Font) U/euf/m/n -- U/euf/b/n on input line 132. ) (/usr/local/teTeX/share/texmf.tetex/tex/latex/amscls/amsthm.sty Package: amsthm 2004/08/06 v2.20 [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] ) (/Library/Frameworks/R.framework/Resources/share/texmf/Sweave.sty (/usr/local/t eTeX/share/texmf.tetex/tex/latex/base/fontenc.sty Package: fontenc 2004/02/22 v1.99f Standard LaTeX package (/usr/local/teTeX/share/texmf.tetex/tex/latex/base/t1enc.def File: t1enc.def 2004/02/22 v1.99f Standard LaTeX file LaTeX Font Info:Redeclaring font encoding T1 on input line 43. ))
Re: [R] Re: nlme: Deficient rank in gls_loglik when creating corAR1()
David Hugh-Jones wrote: Is this a bug? Should I attach a test case? Try setting verbose=TRUE in the call to gls first and see if that gives you any insight into what is happening. D On 03/05/05, David Hugh-Jones [EMAIL PROTECTED] wrote: I have a bunch of data which is structured by year and US state, so I have created a nlme groupedData object for it: formula(gd2) DEPVAR ~ YEAR | ABREV Now I am trying to run a gls regression on it. I want the error correlation structure to be AR1 with a different rho for each state, so I do mdyn.1.1 = gls(model = DEPVAR ~ BLAH + BLAH, data=gd2, corr=corAR1(form= ~ YEAR | ABREV),na.action=na.omit) YEAR and ABREV are always present; DEPVAR is absent for one state. I get the following error message: Error in logLik.glsStruct(glsSt, glsPars) : Deficient rank in gls_loglik Can anyone enlighten me? The error message goes away if I just do corAR1(form = ~1), but this is not meaningful for my data. Cheers David __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] polr function, Error in if (all(pr 0)) -sum(wt * log(pr)) else Inf
I am trying to run a proportional odds model with the code: reg22-polr(as.factor(dp29)~subid+cohort+wave+sex+ses_nc+age+educ_pc+mstat_pc+famsize+salary+employ+wiscraw+age1_pc+cc61+intern2+extern2+tcbcl+sv1a0+sv3a0+sv7a0+dp1+dp5+dp7+dp26+dp27+dp31+dp34+hg106+hg113+hg55+hg54+hg123+hg126+hg129+hg20+hg120+sr2a1+sb23+minorviolfem+sevviolfem+minorviolman+sevviolman+minabuse+sevabuse+crime, data=misdat4, start=st) Some of my models run, others (like the code above) get an error indicating that the starting values are infinite. Someone suggested I try putting in the starting values myself. I created a vector which has length 47 (45 predictors plus (3 levels of depvar) - 1 ). This now gets the message: Error in if (all(pr 0)) -sum(wt * log(pr)) else Inf : missing value where TRUE/FALSE needed Can anyone help me to understand what this means and how I might fix it? Thanks! Clif Emery __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] maximization help :
Have you considered something like the following: multilogit - function(p){ k - length(p) z - log(p) (z[-k]-z[k]) } inv.multilogit - function(z){ k1 - length(z) p. - exp(z) p.i - (1+sum(p.)) (c(p., 1)/p.i) } multilogit(c(.1,.2,.7)) inv.multilogit(multilogit(c(.1,.2,.7))) inv.multilogit(1:2) multilogit(inv.multilogit(1:2)) prodSum - function(x, A, log.=TRUE, trace.=FALSE, neg=TRUE){ p - inv.multilogit(x) if(trace.)cat(p =, p, ;) logP - sum(log(A%*%p)) {if(log.){ if(neg) return(-logP) else return(logP) } else return(exp(logP)) } } prodSum(1:2, diag(3), trace.=T) sum(log(inv.multilogit(1:2))) prodSum(0:1, diag(3), trace.=T) sum(log(inv.multilogit(0:1))) optim(c(0,0), fn=prodSum, hessian=TRUE, A=diag(3), method=CG, control=list(trace=999)) optim(1:2, fn=prodSum, hessian=TRUE, A=diag(3), method=CG, control=list(trace=999)) A - array(c(1,1,1,0), dim=c(2,2)) optim(1, fn=prodSum, hessian=TRUE, A=A, method=CG, control=list(trace=999)) A - array(c(1,1,0, 0, 1, 1), dim=c(3,2)) optim(1, fn=prodSum, hessian=TRUE, A=A, method=CG, control=list(trace=999)) There may be a more elegant solution based on singular values of A, but I don't see it. hope this helps. spencer graves mingan yang wrote: Given a vector : pvec=(p1,p2, p J) with sum(pvec)=1, all the elements are non-negative, that is, they are probabilities a matrix A ( N* J ), with the elements alpha(ij) are 0 or 1 I want to MAXIMIZE THE RESULT RESULT= product( i=1, to N [ sum ( alpha(ij)* pj , j =1,to J ) ] ) thus, I need to get pvec. how should I do ? for example say, A= 0 1 0 0 11 0 0 1 0 0 0 0 0 1 0 1 00 1 0 00 1 that is A is a matrix 6* 4thus pvec=(p1,p2,p3,p4) I want to get values of pvec such that , they can maximize p2 * ( p1 + p2 ) * p1 * p3 * (p1+p4) * p4 thanks __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Calculate median from counts and values
I am tangled with a syntax question. I want to calculate basic statistics for a large dataset provided in weights and values and I can't figure out an elegant way to expand the data. For example here are the counts: counts n4 n3 n2 n1 p0 p1 p2 p3 p4 1 0 0 0 1 1 3 16 55 24 2 0 0 0 0 2 8 28 47 15 3 1 17 17 13 4 5 12 24 8 ... and the values: values n4 n3 n2 n1 p0 p1 p2p3 p4 [1,] 16 8 4 2 1 0.5 0.25 0.125 0.0625 What I want for each row is something like this (shown for row 1): c( rep(16, 0), rep(8, 0), rep(4, 0), rep(2, 1), rep(1, 1), rep(0.5, 3), rep(0.25, 16), rep(0.125, 55), rep(0.0625, 24)) I am sure that this is a one-liner for an R-master, but I can't figure it out without a set of nested for loops iterating over each row in counts. David -- David Finlayson Marine Geology Geophysics School of Oceanography Box 357940 University of Washington Seattle, WA 98195-7940 USA Office: Marine Sciences Building, Room 112 Phone: (206) 616-9407 Web: http://students.washington.edu/dfinlays/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] eigenvalues of a circulant matrix
Globe Trotter wrote: Good point: the Bellman reference is a book: Introduction to Matrix Analysis by Bellman (1960). McGraw-Hill Series in Matrix Theory. --- and republished much later by SIAM. Kjetil --- Robin Hankin [EMAIL PROTECTED] wrote: Hi everyone. The following webpage gives a definition of circulant matrix, which agrees with the definition given in the magic package. http://mathworld.wolfram.com/CirculantMatrix.html best wishes rksh On May 3, 2005, at 08:06 am, Mulholland, Tom wrote: Well since I know nothing about this topic I have lurked so far, but here's my two bob's worth. Firstly I tried to make sense of Brian's initial reply. I have got no idea who Bellman is and you have not referenced (his/her) work in a way I can access the issues you refer to. So I assumed that's exactly what Brian was talking about. Secondly. toeplitz(1:4) [,1] [,2] [,3] [,4] [1,]1234 [2,]2123 [3,]3212 [4,]4321 require(magic) circulant(4) [,1] [,2] [,3] [,4] [1,]1234 [2,]4123 [3,]3412 [4,]2341 So they are obviously two different things. Although I think you may have implied (not stated) that the particular combination you were using resulted in both being exactly the same. It does appear as if in this case the (X) matrix is circulant. But then I'm no expert in even such simple things. Then I had no idea where I was going. So I tried the variations in eigen. I ran you code x-scan(h:/t.txt) y-x[c(109:216,1:108)] X-toeplitz(y) and then X[is.na(X)] numeric(0) So I didn't get any NAs t1 - eigen(X)$vectors t2 - eigen(X,symmetric = TRUE)$vectors identical(t1,t2) [1] TRUE Then t2 - eigen(X,symmetric = TRUE,EISPACK = TRUE)$vectors identical(t1,t2) [1] FALSE So there'e obviously more than one way of getting the vectors. Does the second one make more sense to you? I also noticed in the eigen help that there are references to issues such as IEEE 754 arithmetic,(They may also differ between methods and between platforms.) and or Hermitian if complex. All of these are out of my competence but they do signal to me that there are issues which may relate to hardware, digital arithmetic and other things of that ilk. I added the comment about complex because I have a vague idea that they are related to imaginary parts that you refer to. So not coming to any conclusion that makes sense to me, and given that there are often threads about supposed inaccuracies that have answers such as the digits you see are not always what are held by the machine I set my options(digits = 22) and noticed that some of the numbers are still going at the 22 decimal place suggesting that the machine might be incapable of producing perfectly accurate results using digital arithmetic. My other big sphere of ignorance is complex numbers. So I tried X-toeplitz(complex(real = y)) t1 - eigen(X)$vectors t1[1:20] [1] 0.068041577278880341+0i -0.068041577140546913+0i 0.068041576864811659+0i -0.068041576452430155+0i [5] 0.068041575907139579+0i -0.068041575231135451+0i 0.068041574435267163+0i -0.068041573525828514+0i [9] 0.068041572538722991+0i -0.068041571498323253+0i 0.068041570619888622+0i -0.068041570256170081+0i [13] 0.068041568759931989+0i -0.068041566476633147+0i 0.068041563560502477+0i -0.06804156305007+0i [17] 0.06804138765813+0i -0.068041549792984865+0i 0.068041544123969511+0i -0.068041537810956801+0i t2[1:20] [1] 0.068041381743976906 -0.068041381743976850 0.068041381743976781 -0.068041381743976753 0.068041381743976587 [6] -0.068041381743976725 0.068041381743976920 -0.068041381743976836 0.068041381743976892 -0.068041381743976781 [11] 0.068041381743976781 -0.068041381743977392 0.068041381743976725 -0.068041381743976753 0.068041381743976753 [16] -0.068041381743976698 0.068041381743976587 -0.068041381743976642 0.068041381743976698 -0.068041381743976490 Which is again different. I have no idea what I'm doing but you do seem to get slightly different answers depending upon which method you use. I do not know if one is superior to the others or where one draws the line in terms of accuracy. Tom -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Globe Trotter Sent: Tuesday, 3 May 2005 10:51 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] eigenvalues of a circulant matrix OK, here we go: I am submitting two attachments. The first is the datafile called kinv used to create my circulant matrix, using the following commands: x-scan(kinv) y-x[c(109:1,0:108)] X=toeplitz(y) eigen(X) write(X,ncol=216,file=test.dat) reports the following columns full of NaN's: 18, 58, 194, 200. (Note that eigen(X,symmetric=T) makes no difference and I get the same as above). The second attachment contains only the eigenvectors obtained
Re: [R] How to prove R as good (Was: (no subject))
rene.raupp wrote: Does anybory knows any work comparing R with other (charged) statistical softwares (like Minitab, SPSS, SAS)? I work in a brasilian government bureau and I intend to use R as our preferable statistical software, but I have to show it's as good as the others. Sorry. That will be difficult. Could'nt it do to prove it is better? Kjetil I also intend to use Weka, and for this one I have the same problem. Can anyone help me? Thanks René M. Raupp e-mail: [EMAIL PROTECTED] [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra -- Internal Virus Database is out-of-date. Checked by AVG Anti-Virus. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Calculate median from counts and values
On 5/3/05, David Finlayson [EMAIL PROTECTED] wrote: I am tangled with a syntax question. I want to calculate basic statistics for a large dataset provided in weights and values and I can't figure out an elegant way to expand the data. For example here are the counts: counts n4 n3 n2 n1 p0 p1 p2 p3 p4 1 0 0 0 1 1 3 16 55 24 2 0 0 0 0 2 8 28 47 15 3 1 17 17 13 4 5 12 24 8 ... and the values: values n4 n3 n2 n1 p0 p1 p2p3 p4 [1,] 16 8 4 2 1 0.5 0.25 0.125 0.0625 What I want for each row is something like this (shown for row 1): c( rep(16, 0), rep(8, 0), rep(4, 0), rep(2, 1), rep(1, 1), rep(0.5, 3), rep(0.25, 16), rep(0.125, 55), rep(0.0625, 24)) I am sure that this is a one-liner for an R-master, but I can't figure it out without a set of nested for loops iterating over each row in counts. Is there supposed to be one row of values that apply to all rows of counts or is there to be different rows of values for different rows of counts? Also in your example row 3 has a different total than 1 or 2. Is that right? At any rate, I will assume that there is only one row of values and many rows of counts and that its not necessarily true that counts sum to the same number in each row. Then noting that c(rep(4,1), rep(5,2), rep(6,3)) is the same as rep(4:6, 1:3) is the same as, we have: lapply(as.data.frame(t(counts)), rep, x = unlist(values)) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] General Question on learning R...
For an installed package (rather than source), the R-ex/ directory contains the code in the Example section of help pages; e.g., if you run example(somefun), the code in somefun-ex.R is source()'ed. Stuff in the demo/ directory are executed by the demo() function, and it's optional: Most packages do not have demo code. Andy From: Spencer Graves Yes. Thanks for the elaboration. What differences might one expect between the contents of \demo and \R-ex? (I found \R-ex with all the packages I named, but not all had \demo.) spencer graves There seem to be different Jonathan Q. wrote: assuming one has these installed already, you just look in the demo folder under each? i.e., fBasics\demo ??? On 5/3/05, Spencer Graves [EMAIL PROTECTED] wrote: I'm looking at the same thing. A good source for this is to 'install.packages(c(fBasics, fCalendar, fExtremes, fMultivar, fOptions, fPotfolio, fractdiff, fSeries, its, lme4, zoo))', then 'update.packages()'. These will install subdirectories or folders with the indicated names fBasics, etc., in library with your R installation. For example, in my Windows installation, I have D:\Program files\R\rw2010pat\library, which contains many subfolders including ones named fSeries. These all contain files *.R, which provide sample code. spencer graves Sean Davis wrote: On May 3, 2005, at 6:46 AM, Jonathan Q. wrote: In the process of learning R, with a specific interest on financial time series. While I continue to get through the documents I am more a fan of learning by example and then looking up how each function is used. Any websites which post sample code for R? The largest source of example code is R itself. If you have a command in which you are interested, you can often just type the command and the code will be shown to you. Try typing: ls() Then: ls It will show you the code used to produce the result. Also, each command has its own example(s) in the help. Sean __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to prove R as good (Was: (no subject))
Did you try to Google for R vs. your favorite alternative? I just got 740 hits from Google for R vs. SAS and 82 from www.r-project.org - search - R site search. This has been discussed on this list several times, and many benchmarks have been published. If you don't find what you want fairly quickly, read the posting guide and ask a more specific question. The benchmarks I've seen have rated R quite high. Each commercial package may be able to claim that it is better for some particular purpose, e.g., SAS and the latest release of S-Plus with large data bases. Minitab, SPSS, JMP and others may have an easier to use graphical user interface for naive users, although even that superiority is being challenged. R has been changing and improving so fast that it is difficult for any of the commercial alternatives to keep up. There are several reasons for this. First, R is easily extended. Second, the R Foundatation for Statistical Computing has provided a supportive organizational framework that makes it easy for people to share. Third, there are hundreds and perhaps thousands of competent professionals the world over who have been frustrated in the past by the steep price of commercial software for many things, and R provides a shockingly easy and open alternative that helps people share their latest developments with the entire world in a way that replaces that frustration with the pride of contributing to something incredibly useful. Best Wishes, spencer graves Kjetil Brinchmann Halvorsen wrote: rene.raupp wrote: Does anybory knows any work comparing R with other (charged) statistical softwares (like Minitab, SPSS, SAS)? I work in a brasilian government bureau and I intend to use R as our preferable statistical software, but I have to show it's as good as the others. Sorry. That will be difficult. Could'nt it do to prove it is better? Kjetil I also intend to use Weka, and for this one I have the same problem. Can anyone help me? Thanks René M. Raupp e-mail: [EMAIL PROTECTED] [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Calculate median from counts and values
Thanks Gabor and Phil. That did it. I've used R for years for plotting and run-of-the-mill data analysis (the only kind I do). But the syntax of this language has just never clicked for me. I can't seem to advance beyond the mostly harmless stage. Python is roting my brain I guess. Again, thanks for the tips David On 5/3/05, Gabor Grothendieck [EMAIL PROTECTED] wrote: On 5/3/05, David Finlayson [EMAIL PROTECTED] wrote: I am tangled with a syntax question. I want to calculate basic statistics for a large dataset provided in weights and values and I can't figure out an elegant way to expand the data. For example here are the counts: counts n4 n3 n2 n1 p0 p1 p2 p3 p4 1 0 0 0 1 1 3 16 55 24 2 0 0 0 0 2 8 28 47 15 3 1 17 17 13 4 5 12 24 8 ... and the values: values n4 n3 n2 n1 p0 p1 p2p3 p4 [1,] 16 8 4 2 1 0.5 0.25 0.125 0.0625 What I want for each row is something like this (shown for row 1): c( rep(16, 0), rep(8, 0), rep(4, 0), rep(2, 1), rep(1, 1), rep(0.5, 3), rep(0.25, 16), rep(0.125, 55), rep(0.0625, 24)) I am sure that this is a one-liner for an R-master, but I can't figure it out without a set of nested for loops iterating over each row in counts. Is there supposed to be one row of values that apply to all rows of counts or is there to be different rows of values for different rows of counts? Also in your example row 3 has a different total than 1 or 2. Is that right? At any rate, I will assume that there is only one row of values and many rows of counts and that its not necessarily true that counts sum to the same number in each row. Then noting that c(rep(4,1), rep(5,2), rep(6,3)) is the same as rep(4:6, 1:3) is the same as, we have: lapply(as.data.frame(t(counts)), rep, x = unlist(values)) -- David Finlayson Marine Geology Geophysics School of Oceanography Box 357940 University of Washington Seattle, WA 98195-7940 USA Office: Marine Sciences Building, Room 112 Phone: (206) 616-9407 Web: http://students.washington.edu/dfinlays __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Combining numeric vs numeric numeric vs factor graphs into one ps/pdf file
On Tuesday 03 May 2005 10:44, Arenas, David R. CIV NAVAIR DEPT wrote: Dear R community, My previous email was incomplete because I used html format. Here it is again and sorry for any inconvenience: xyplot (lattice) has been great in displaying tons of data for my research. I have used the following two xyplot commands (with example dataframe) to create two separate postscript/pdf files with respect to the variable acft and subset status: test.df - data.frame(acft=factor(c(A,B,C,D)), status=factor(c(fail,pass,fail,pass)), site=factor(c(E1,E1,E2,E2)), CD=as.numeric(c(1,1,3,3)), H=as.numeric(c(80,NA,60,NA))) xyplot(H ~ CD | acft, data=test.df, subset=status==fail, layout=c(1,1) ) xyplot(site ~ CD | acft, data=test.df, subset=status==pass, layout=c(1,1) ) I would like to combine all graphs into one file in alphabetical order of variable acft. The graphs would be one per page where in fact I use layout=c(1,1) for the nice and easily seen strip labels for acft. The problem I am having is combining x-y plots that are numeric vs numeric numeric vs factor. I have search the R-help archives and R-project references for an example to no avail. I am thinking I may have to use something (lattice or not) like ... if any(test.df$Status==fail) plot(H ~ CD) else plot(site ~ CD) with for in the beginning to loop through all data with respect to acft. I need a hint on how to further this along. I am using R.2.1.0 via Windows XP. I can't think of a clean way to do this. You could of course do xyplot(ifelse(status == pass, as.numeric(site), H) ~ CD| acft, data=test.df, scales = free, layout=c(1,1) ) but this wouldn't give very nice axis labels for the factor (unless you specify them manually, which could be done). Deepayan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Hershey Fontsize Decrease When Sent To Printer
Hi, I am running R 2.0.1 on Windows XP Version 5.1. I called demo(Hershey) but when I used any network printer to print the output in R Graphics Device the font size of the Hershey characters were reduced so that they were printed as dots. Is this a bug in R? Or is it a problem with the Windows, say the printers need to have the Hershey fonts loaded, that my technical staff may address? Thanks Ron Webster __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] eigenvalues of a circulant matrix
--- Huntsinger, Reid [EMAIL PROTECTED] wrote: Under Linux run ldd on the binary to see what shared libraries the binary has been linked against and will attempt to load. The command you run is a shell script which sets and exports LD_LIBRARY_PATH and then runs R, so to be sure first start R and execute system(echo $LD_LIBRARY_PATH) /usr/lib/R/lib:/usr/local/lib:/usr/X11R6/lib:/usr/local/lib and then using this value for LD_LIBRARY_PATH do $ export LD_LIBRARY_PATH=R's value for this I use tcsh, so had to switch to bash to use export $ ldd `R RHOME`/bin/exec/R libblas.so.3 = /usr/lib/libblas.so.3 (0x00995000) libg2c.so.0 = /usr/lib/libg2c.so.0 (0x0068f000) libm.so.6 = /lib/tls/libm.so.6 (0x00664000) libgcc_s.so.1 = /lib/libgcc_s.so.1 (0x00dd1000) libreadline.so.4 = /usr/lib/libreadline.so.4 (0x00d3d000) libncurses.so.5 = /usr/lib/libncurses.so.5 (0x03d2f000) libdl.so.2 = /lib/libdl.so.2 (0x00689000) libc.so.6 = /lib/tls/libc.so.6 (0x00538000) /lib/ld-linux.so.2 (0x0051e000) which will list the shared libraries R will try to load to resolve links to shared libraries. Having said that, I have tried your example on several platforms with several configurations, and I get NaNs only when R is calling the Lapack routine dsyevr (R's builtin Lapack) with an external (optimized) blas (either Goto or ATLAS's blas) but not R's builtin blas. Moreover even with the optimized blas, if I use dysev instead of dsyevr, (eigen() executes a .Call(La_rs,x,only.values,dsyevr,PACKAGE=base), I execute this from R with dsyev in place of dsyevr) I get no NaNs. So it looks like a problem with a blas routine used by dsyevr but not dsyev, but I have yet to confirm. Well, I have now written a test function in C to call dsyevr, but it goes through fine -- no NaN's. (I can send the test function). I wonder if there is an issue with workspace allocation in R: dsyevr has an optimal way of doing that, and that is obtained by a call with iwork=-1. Many thanks and best wishes! I note that your C program does not use either of these lapack routines. Reid Huntsinger __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] contributed package source codes
Is there a way for me to get the source code ( C/C++ or FORTRAN) for a specific R package ? thanks __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html