Re: [R] Why R is 200 times slower than Matlab ?

2008-05-01 Thread Shige Song
Will the use of jit improve performance of use contributed packages such as lme4? Thanks. Shige On Thu, May 1, 2008 at 7:31 AM, Nelson Castillo [EMAIL PROTECTED] wrote: On Wed, Apr 30, 2008 at 6:27 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Aside from optiming your code by making use

Re: [R] efficient code - yet another question

2008-05-01 Thread Prof Brian Ripley
Some comments 1) 'Writing R Extensions' has a chapter about looking into bottlenecks ('profiling'). Had you given a working example, I might have shown you some results. One thing which is clearly suboptimal is to grow components (in your case by cbind) rather than allocate them initially

Re: [R] Use of recordPlot

2008-05-01 Thread Prof Brian Ripley
On Wed, 30 Apr 2008, Greg Snow wrote: My impression of the plot recording in windows was that it was a quick tool to be useful, but not a high priority. Trying to keep track of 50 plots (and using different plot windows) is pushing it beyond its original intention. I expect that he core

[R] Installing Packages in Windows Vista -- YES I tried Run as Administrator

2008-05-01 Thread Scotty Nelson
I'm having trouble installing packages in Windows Vista. It's driving me nuts. I read all the threads and I have tried the following: 1) Right click on R and Run as Administrator 2) Turn off User Account Control 3) Toss machine across room (OK haven't tried this one yet, but I'm close) Here is

Re: [R] Installing Packages in Windows Vista -- YES I tried Run as Administrator

2008-05-01 Thread Prof Brian Ripley
Your issue is a corrupt download. Try another CRAN mirror. In any case, the current version of R includes that version of boot, so you need to update (before posting, as the posting guide asked you to). On Thu, 1 May 2008, Scotty Nelson wrote: I'm having trouble installing packages in

Re: [R] efficient code - yet another question

2008-05-01 Thread Richard . Cotton
I've been trying to find a way to improve (if possible) the efficiency of the code, especially when the number of components to calculate is higher than 100. pca.nipals - function(X, ncomp, iter = 50, toler = sqrt(.Machine$double.eps)) # X...data matrix, ncomp...number of components, #

Re: [R] using the sink() function in a for-look

2008-05-01 Thread Johannes Hüsing
Rolf Turner [EMAIL PROTECTED] [Thu, May 01, 2008 at 06:59:29AM CEST]: On 1/05/2008, at 4:40 PM, Johannes Hüsing wrote: [...] When you do the following: for (i in 1:100) { summary(rnorm(80))} what output do you get? He'd get nothing at all. That's the point.

Re: [R] Why R is 200 times slower than Matlab ?

2008-05-01 Thread Paul Smith
On Thu, May 1, 2008 at 12:31 AM, Nelson Castillo [EMAIL PROTECTED] wrote: Aside from optiming your code by making use of R functions that use C underneath as much as possible the big difference between R and Matlab is Matlab's just-in-time compilation of code. When that was

Re: [R] How to fit parametric survival model using counting process data

2008-05-01 Thread Terry Therneau
I was trying to fit a parametric survival model with Weibull distribution on counting process type of data (NOT interval censor data), but the survreg(Surv(T1,T2,event)~x,data,dist=weibull) did not seem to work. Anyone can help me with that? The survreg function does not support

[R] Anderson-Darling Test for beta distribution

2008-05-01 Thread Evgeniq Petrova
Hello, Is there a package with Anderson-Darling Test, to test if a sample is beta distributed? Thanks in advance Evgeniq __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Lattice book

2008-05-01 Thread Karl Ove Hufthammer
Charilaos Skiadas: Congratulations Deepayan, the book gave me exactly the kind of lattice knowledge I needed, and then some. The graphics are really impressive and good illustrations of what lattice can do, All the figures from the book are also available online (and with three different

[R] Optimal knot locations for splines

2008-05-01 Thread Mike Dugas
Suppose I have two variables, x and y. For a fixed number of knots, I want to create a spline transformation of x such that a loss function is minimized. Presumably, this loss function would be least squares, i.e. sum (f(x)-y)^2. The spline transformations would be linear, quadratic or cubic.

Re: [R] resolution (dpi) problem

2008-05-01 Thread David Winsemius
(Ted Harding) [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Certainly for Windows users, the suggested change could be wise, since Windows (for reasons best known to someone who should have known better) conceals the extension from the user, unless the user submits to cruel and unusual

Re: [R] ordering a factor in boxplot output

2008-05-01 Thread S Ellison
The factor order defaults to alphabetical, and boxplot follows that. Re-ordering the factor to the order of interest is probably the best way of handling it. However, if you don;t want to do that, you could perhaps also use the at= parameter in boxplot. For example x-rnorm(50)

Re: [R] Why R is 200 times slower than Matlab ?

2008-05-01 Thread Douglas Bates
On 5/1/08, Shige Song [EMAIL PROTECTED] wrote: Will the use of jit improve performance of use contributed packages such as lme4? Thanks. A technology like a byte-compiler or a just-in-time compiler will change the performance of interpreted code. It will not change the performance of compiled

Re: [R] Optimal knot locations for splines

2008-05-01 Thread Spencer Graves
RSiteSearch('free knot splines', 'fun') produced 5 hits, the first of which is curfit.free.knot {DierckxSpline}. RSiteSearch('estimate knots', 'fun') produced 54 hits, but I don't know if any of those would help you. Spencer Graves Mike Dugas wrote: Suppose I have two

[R] how to not sort factors when plotting

2008-05-01 Thread Lydia N. Slobodian
Hello, When making a graph, plot and boxplot automatically sort my factor levels (y axis) into alphabetical order. Is there a way to make it NOT do this? I've tried: sort.by=none, sorted=FALSE, sort=FALSE, reorder=FALSE. Thank you. __

Re: [R] how to not sort factors when plotting

2008-05-01 Thread Prof Brian Ripley
The short answer is 'they don't'. They use the order of the levels of the factor that you supply, and the answer is for you to create the factor with the levels in the order you want -- otherwise factor creation uses alphabetical order. See ?factor. On Thu, 1 May 2008, Lydia N. Slobodian

Re: [R] Why R is 200 times slower than Matlab ?

2008-05-01 Thread Zhandong Liu
Great. Thanks a lot. ZD On Wed, Apr 30, 2008 at 7:31 PM, Nelson Castillo [EMAIL PROTECTED] wrote: On Wed, Apr 30, 2008 at 6:27 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Aside from optiming your code by making use of R functions that use C underneath as much as possible the big

[R] Making a map in R?

2008-05-01 Thread stephen sefick
Does anyone know of a package to make a map from GIS data, and/or would it be easier in one of the free GIS programs. I would like to make a map of the savannah river area with our sampling locations. thanks stephen -- Let's not spend our time and resources thinking about things that are so

[R] How to count the overlapped in two vectors

2008-05-01 Thread ss
Dear list, If I have two vector, t1 and t2, of different lengths. Is there an easy way to count the number of the overlapped in two vectors and show the result in the graph? Thanks much, Alex [[alternative HTML version deleted]] __

Re: [R] Aggregate() questions

2008-05-01 Thread Chip Barnaby
Henrique, thanks for the response. As a new user, I was unaware of with() and ave(), those are both very helpful. However, I don't think your method is quite right. I for all rows in each Key, I want the mean( IAC) where ProfA = 0. To simplify the problem, I have made a subset dataframe

Re: [R] Forecasting observations in ARFIMA

2008-05-01 Thread Giovanni Petris
Do you really need the 'F' in ARFIMA(2,1,0)? Date: Wed, 30 Apr 2008 20:45:44 -0700 (PDT) From: Jill Elizabeth [EMAIL PROTECTED] Sender: [EMAIL PROTECTED] Precedence: list DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; I would like to compute the next 15

Re: [R] error with lme within a loop

2008-05-01 Thread Tomas Goicoa
Done it! It solves my problem. Thank you very much At 22:12 30/4/2008, Andrew Robinson wrote: Tomas, I suggest that you use try() Andrew On Wed, Apr 30, 2008 at 05:30:05PM +0200, Tomas Goicoa wrote: Dear R users, I want to conduct a small simulation study and I have to use the lme

[R] forecasting with frequency greater than 24

2008-05-01 Thread rjzacher
I would like to generate a forecast using ets or hw using a time series with a weekly frequency of 52.? When I run this I get an error that the frequency is too high.? Is there a way to generate a forecast using ets and a frequency of 52, (currently the restriction appears to be a max of 24)?

[R] elseif syntax

2008-05-01 Thread Hyunchul Kim
Hi, all How to use elseif ? For example, like following short python examples. * x = 1 if x == 1: print 'same' *elif* x 1: print 'bigger' else: print 'smaller' * Thanks in advance, Hyunchul Kim [[alternative HTML version deleted]]

Re: [R] ordering a factor in boxplot output

2008-05-01 Thread Tubin
Thank you, that gives me exactly what I need. One option is to set the order in newfile: newfile$ApptCategory - factor(newfile$ApptCategory, levels=c('New','Established')) Of course, this will then affect the order for other things associated with ApptCategory, but that is probably what you

Re: [R] How to count the overlapped in two vectors

2008-05-01 Thread Erik Iverson
Not quite sure what you want your graphic to look like. Do ?intersect and ?length help at all? ss wrote: Dear list, If I have two vector, t1 and t2, of different lengths. Is there an easy way to count the number of the overlapped in two vectors and show the result in the graph? Thanks much,

[R] elseif syntax

2008-05-01 Thread Hyunchul Kim
Hi, all How to use elseif ? For example, like following short python examples. * x = 1 if x == 1: print 'same' *elif* x 1: print 'bigger' else: print 'smaller' * Thanks in advance, Hyunchul Kim [[alternative HTML version deleted]]

Re: [R] ggplot2: labels and breaks order does not match and I can't usescale_fill_identity

2008-05-01 Thread Mikhail Spivakov
Thanks Xavier, Hadley, and Thierry! The problem was indeed unsolvable in a previous version of ggplot, but in the latest one sorting by levels has worked. Best wishes Mikhail [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] R_PROFILE problem (UNIX)

2008-05-01 Thread David Bickel
R does not seem to recognize my R_PROFILE: $ cat $HOME/etc/Rprofile.site a - 3 $ cat $R_PROFILE a - 3 $ R a Error: object a not found version _ platform sparc-sun-solaris2.10 arch sparc os

Re: [R] Making a map in R?

2008-05-01 Thread Kingsford Jones
There are many ways to do this, depending on what type of spatial data you are working with and what you want your maps to look like. The sp package provides S4 classes and methods for working with GIS data. Two likely candidates for importing data are the rgdal and maptools packages. See the

Re: [R] elseif syntax

2008-05-01 Thread jim holtman
Is this what you want: x - 1 if (x ==1){ print('same') } else if (x 1){ print('bigger') } else { print('smaller') } On Thu, May 1, 2008 at 10:52 AM, Hyunchul Kim [EMAIL PROTECTED] wrote: Hi, all How to use elseif ? For example, like following short python examples. *

Re: [R] Making a map in R?

2008-05-01 Thread Kingsford Jones
I sent the wrong link for the spatial Task View. Here it is http://cran.r-project.org/web/views/Spatial.html On Thu, May 1, 2008 at 8:21 AM, Kingsford Jones [EMAIL PROTECTED] wrote: There are many ways to do this, depending on what type of spatial data you are working with and what you want

Re: [R] elseif syntax

2008-05-01 Thread Christos Hatzis
Another option in R is to use the vectorized version 'ifelse', which has an advantage if x is a vector: x - -1:4 x [1] -1 0 1 2 3 4 ifelse(x == 1, 'same', ifelse(x 1, 'bigger', 'smaller')) [1] smaller smaller samebigger bigger bigger -Christos -Original Message- From:

[R] Matlab user: Octave, scilab or R-project?

2008-05-01 Thread schoappied
Hi, Is actually not a question for myself but for my sister. See uses Matlab for her study movement sciences. See likes to try free software, what is a good alternative for matlab? Regards, Dirk __ R-help@r-project.org mailing list

[R] need help on ICC for a questionnaire

2008-05-01 Thread Smita Pakhale
Dear All, I am trying to get ICC (Intra class correlation coefficient) for a questionnaire. The questionnaire has about 25 questions and was administered to 50 subjects on two occasions. I want to calculate the reproducibility of the questionnaire administered to the same group of subjects on two

[R] need help on ICC for a questionnaire

2008-05-01 Thread Smita Pakhale
Dear All, I am trying to get ICC (Intra class correlation coefficient) for a questionnaire. The questionnaire has about 25 questions and was administered to 50 subjects on two occasions. I want to calculate the reproducibility of the questionnaire administered to the same group of subjects on two

Re: [R] If(cond) statement

2008-05-01 Thread Greg Snow
This is for the same reason that: 3 +4 Does not give 7. R is optimized for interactive use, so if a statement can be considered complete, it evaluates it instead of waiting for more. In your case: if(mxxmxy) mxy=mxx Is a complete statement and is evaluated without waiting to see if there is

[R] Tab-delimited AOV summaries

2008-05-01 Thread Chris Sims
Hello, I am trying to print out ANOVA summaries --- as returned by summary (aov(...))--- in tab-delimited format, either to a file or to the console, but so far I haven't been able to figure out a solution. My particular ANOVA has repeated measures, so it is an instance of class aovlist.

[R] regular expression question

2008-05-01 Thread markleeds
I have strings of the form TICKER.GGG.XX.dat but GGG is not always three characters so I can't use substr to pull it out of the string. Could someone tell me how to use sub to pull out the GGG but more generally the string between the dot after the R in TICKER and the next dot. I still

Re: [R] Making a map in R?

2008-05-01 Thread stephen sefick
black and white graph with points at rivermiles- publication quality. thanks for all of the help! On Thu, May 1, 2008 at 12:09 PM, Ruben Roa Ureta [EMAIL PROTECTED] wrote: Does anyone know of a package to make a map from GIS data, and/or would it be easier in one of the free GIS

Re: [R] How to count the overlapped in two vectors

2008-05-01 Thread Julian Burgos
See ?match ss wrote: Dear list, If I have two vector, t1 and t2, of different lengths. Is there an easy way to count the number of the overlapped in two vectors and show the result in the graph? Thanks much, Alex [[alternative HTML version deleted]]

Re: [R] Matlab user: Octave, scilab or R-project?

2008-05-01 Thread Johannes Hüsing
schoappied [EMAIL PROTECTED] [Thu, May 01, 2008 at 06:00:51PM CEST]: what is a good alternative for matlab? Octave is generally said to be the alternative. -- Johannes Hüsing There is something fascinating about science. One gets such wholesale

Re: [R] How to plot wind direction and strength field

2008-05-01 Thread Greg Snow
Does the following do what you want (or at least move in that direction)? u - array(NA,c(5,8)) t - seq(from=0.5, to=0.11,length=15) t2 - seq(from=(-0.7),to=(-0.1),length=25) u[1:15] - t u[16:40] - t2 v - array(NA,c(5,8)) y - seq(from=(-0.9), to=(-0.01),length=40) v[1:40] - y

Re: [R] regular expression question

2008-05-01 Thread Bert Gunter
1. Yes. strsplit(yourstring,\\.)[[1:2]] works if the format is as specified below. 2. In Jim Holtman's regex, the PERL=TRUE argument is not needed. sub(TICKER\\.([^.]+).*,\\1,x) works just fine. -- Bert Gunter Genentech, Inc. -Original Message- From: [EMAIL PROTECTED]

Re: [R] Optimal knot locations for splines

2008-05-01 Thread Mike Dugas
Thanks for the help. I tried out the one promising lead, curfit.free.knot, and it doesn't work for linear or quadratic splines. The documentation says it should, but when I specify a linear spline, it returns a cubic. On 5/1/08, Spencer Graves [EMAIL PROTECTED] wrote: RSiteSearch('free

[R] customization of pairwise comparison plots

2008-05-01 Thread Levi Waldron
I am wondering how to customize a pairwise comparisons plot of a factorial ANOVA, without doing a lot of manual manipulation of a TukeyHSD object. The customizations I'd like are: 1. The aov used log-transformed response data, but I'd like to plot the intervals on their original, untransformed

Re: [R] How to stop buffering of cat

2008-05-01 Thread Greg Snow
In addition to what others have pointed to regaurding buffering and cat, there are also a couple of new functions in R 2.7.0 that help with showing the progress of computations. They are winProgressBar (windows only) and TkProgressBar (in the tcltk package). You can use these to create and

[R] Data manipulation for random intercept GLMM

2008-05-01 Thread Giovanni Petris
Hello, I am working on some examples of GLMM for my students but I am afraid that my way of preparing a dataframe to pass to lmer will make them think that R is a very difficult and un-natural language. Here is for example a simple data set about approval ratings on two different surveys for a

[R] Locale problem with umlauts in factor levels in 2.7.0 (patched) from grid or lattice

2008-05-01 Thread Dieter Menne
With 2.7.0 patched (not tested with 2.0.0), I get an error message in a program that ran correctly in R 2.6.2 when the grouping factor of a stripplot contains an Umlaut: I am aware that there are a few locale-changes in R 2.7.0, but I could not easily locate who's at fault Dieter

[R] Error while making R package

2008-05-01 Thread Vidhu Choudhary
Hi All, I am trying to make R package using R 2.6.2 And I am getting following error. When I give R CMD check t1\ -- Making package t1 adding build stamp to DESCRIPTION making DLL ... making CGHseg_rewrite.d from CGHseg_rewrite.c making rowMedians.d from rowMedians.c

Re: [R] Installing Packages in Windows Vista -- YES I tried Run as Administrator

2008-05-01 Thread Mark Difford
Hi Scotty, Can't give an answer from what you've provided, but one temp. work-around that might work is to get onto CRAN -- packages and download the packages you need from your web browser as zip files, then do an Install package(s) from local zip files... from the Packages menu. HTH, Mark.

[R] howto import .xls and .ods

2008-05-01 Thread Jonas Stein
Hi, i want to import data from .ods and .xls files in R on a linux system. Seems it was a faq in the past, but i found only solutions for Windows. Is there a handy solution for linux? The best would be something like mytab -read.ods(...) Any hints? Thanks a lot for reading so far, -- Jonas

[R] A plot of factor data?

2008-05-01 Thread Sang Chul Choi
Hi, I am wondering if there is a way to plot proportions of factors. I tried to find plot functions for those but in vain. For example, I have a data like this where column a has 10 of 0s and 15 of 1s, and column b has 5 and 20. x - data .frame

Re: [R] Lattice book

2008-05-01 Thread Deepayan Sarkar
On 4/30/08, Charilaos Skiadas [EMAIL PROTECTED] wrote: Actually it's been out for a couple of weeks now at least. Yes, it's been out since March 12, actually. I just finished my first reading of it, and I must say it was spectacular. Congratulations Deepayan, the book gave me exactly the

Re: [R] A plot of factor data?

2008-05-01 Thread Bert Gunter
?mosaicplot -- Bert Gunter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sang Chul Choi Sent: Thursday, May 01, 2008 4:09 PM To: r-help@r-project.org Subject: [R] A plot of factor data? Hi, I am wondering if there is a way to plot proportions of

Re: [R] howto import .xls and .ods

2008-05-01 Thread Abhijit Dasgupta
I've written a little python script that converts ods and xls to csv, and a wrapper in R that imports a sheet of the ods and/or xls into a data.frame in R. If this is a FAQ and there is an existing solution, great. Actually, for xls, the library gdata has a read.xls function that uses a perl

Re: [R] howto import .xls and .ods

2008-05-01 Thread Gabor Grothendieck
read.xls in the gdata package can read xls files. It uses a perl program and does not require Windows. There is also the related xls2csv in the same package. On Thu, May 1, 2008 at 5:00 PM, Jonas Stein [EMAIL PROTECTED] wrote: Hi, i want to import data from .ods and .xls files in R on a

[R] 2d cross-correlation / convolution

2008-05-01 Thread H. Paul Benton
Dear all, I'm trying to get a 2D matrix correlated with a reference matrix. I've been told I need to do this with convolution. I have the convolution down but now i have a complex number that I don't know how to convert back to a real number. Also How can I get the correlation coefficient

[R] Speedups with Ra and jit

2008-05-01 Thread Bill.Venables
The topic of Ra and jit has come up on this list recently (see http://www.milbo.users.sonic.net/ra/index.html) so I thought people might be interested in this little demo. For it I used my machine, a 3-year old laptop with 2Gb memory running Windows XP, and the good old convolution example, the

[R] axis 1 and axis 2 margin

2008-05-01 Thread chih chu
Hi, I am using axis() to plot axis 1 and axis 2. but now when I used axis(side=1,) and axis(side=2,.), there's a big margin between these two axis. does anybody have any idea about how to shrink the margin between these two axis. basically, I want to move axis 1 left so that when I plot

Re: [R] axis 1 and axis 2 margin

2008-05-01 Thread Peter Alspach
Chih Chu I'm not sure what you mean. The following shows the axes evenly spaced for me (R 2.7.0 on Windows device): plot(1:10, axes=F) axis(1) axis(2) axis(3) axis(4) axis(1, c(1,10), c('',''), tck=0) axis(2, c(1,10), c('',''), tck=0) axis(3, c(1,10), c('',''), tck=0) axis(4, c(1,10), c('',''),

[R] to extract particular date/data

2008-05-01 Thread Roslina Zakaria
Hi R-expert, If I have this daily rainfall data, how do call a particular day? Year,Month,Day,Amount 1900,12,22,1.3 1900,12,23,0 1900,12,24,0 1900,12,25,0 1900,12,26,0 1900,12,27,0 1900,12,28,0 1900,12,29,4.8 1900,12,30,0.3 1900,12,31,0.5 1901,1,1,0 1901,1,2,3 1901,1,3,0 1901,1,4,0.5 1901,1,5,0