Re: [R] Data.frame columns in R console

2007-02-09 Thread Lauri Nikkinen
Thank you for your answer. When I set options(width=250) I still get the same result when I print the data.frame on my Rgui console (R 2.4.1, Windows XP). Colums become underneath each other. I also get an error (?) message [ reached getOption(max.print) -- omitted 3462 rows ]]. For example if I

Re: [R] subset function

2007-02-09 Thread Petr Pikal
Hi works for me zeta tepl tio2 al2o3 iep 1 601 3.5 5.65 2 601 2.0 5.00 3 600 3.5 5.30 4 600 2.0 4.65 5 401 3.5 5.20 6 401 2.0 4.85 7 400 3.5 5.70 8 400 2.0 5.25 fit-lm(iep~al2o3, data=zeta) fit-lm(iep~al2o3, data=zeta,

Re: [R] class package

2007-02-09 Thread Prof Brian Ripley
It is part of the VR bundle and should be in all R installations, as a recommended package. Did you try library(class) ? If that really does not work, please re-install R. On Fri, 9 Feb 2007, XinMeng wrote: Hello sir: Where can I download the package class? What I can find is only:

Re: [R] Data.frame columns in R console

2007-02-09 Thread Prof Brian Ripley
On Fri, 9 Feb 2007, Lauri Nikkinen wrote: Thank you for your answer. When I set options(width=250) I still get the same result when I print the data.frame on my Rgui console (R 2.4.1, Windows XP). Colums become underneath each other. I also get an error (?) message [ reached

Re: [R] Data.frame columns in R console

2007-02-09 Thread Petr Pikal
Hi On 9 Feb 2007 at 10:17, Lauri Nikkinen wrote: Date sent: Fri, 9 Feb 2007 10:17:48 +0200 From: Lauri Nikkinen [EMAIL PROTECTED] To: Prof Brian Ripley [EMAIL PROTECTED] Copies to: r-help@stat.math.ethz.ch Subject:

Re: [R] R vs Matlab {R in Industry}

2007-02-09 Thread Martin Maechler
Ravi == Ravi Varadhan [EMAIL PROTECTED] on Thu, 8 Feb 2007 14:39:41 -0500 writes: Ravi Here is a function to create a Toeplitz matrix of any size, and an example Ravi of a 220 x 220 toeplitz matrix, which was created in almost no time: Thanks Ravi, but note two things -

Re: [R] step in a model with strata

2007-02-09 Thread Pietro Bulian
Henric, thank you very much, you guessed exactly what I want, excuse me for my poor explanations. I tried step with scope argument and all went nice. Before my first posting I read ?step, but I did not understand the meaning and usage of scope. I said manual step, but indeed I did not use

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Martin Maechler
Ravi == Ravi Varadhan [EMAIL PROTECTED] on Thu, 8 Feb 2007 18:41:38 -0500 writes: Ravi Hi, Ravi greaterOf is indeed an interesting function. It is much faster than the Ravi equivalent R function, pmax, because pmax does a lot of checking for Ravi missing data and for

[R] Stop Execution of R for sometime

2007-02-09 Thread Shubha Vishwanath Karanth
Hi R users, My R is getting fatigued by running many codes continuously and give errors...I introduced the Sys.sleep() function now the code works... But I feel that sometimes even after introducing the sleep function I get some errors related to this issue...Is there any other strong function

Re: [R] Data.frame columns in R console

2007-02-09 Thread Lauri Nikkinen
Ok. Thanks for all of you. I have used fix, edit, summary and str for checking my data. Before R I have used SAS and SPSS so I'm used to view my data in spreadsheet. -Lauri 2007/2/9, Petr Pikal [EMAIL PROTECTED]: Hi On 9 Feb 2007 at 10:17, Lauri Nikkinen wrote: Date sent:

Re: [R] How to count the number of NAs in each column of a df?

2007-02-09 Thread Chuck Cleland
Richard M. Heiberger wrote: drop.col.kna - function(mydf, k) mydf[sapply(mydf, function(x) sum(is.na(x))) k] tmp - data.frame(matrix(1:24, 6,4, dimnames=list(letters[1:6], LETTERS[1:4]))) tmp[1:3,1] - NA tmp[2:5,2] - NA tmp[6,3] - NA drop.col.kna(tmp, 0) drop.col.kna(tmp, 1)

[R] persp plot help

2007-02-09 Thread mike Ad.
Dear list, I am trying to make a perspective plot with persp(x, y, z). The problem is that z data set is incomplete, with lots of NA. And I can not get a smooth surface plot. Could any one tell me how to generate a smooth surface with incomplete dataset? (I tried to fill in some values for the

[R] Numerical Recipes in R

2007-02-09 Thread Lorenzo Isella
Dear All, So far I have mainly used R for data analysis and simple numerics (integration of functions, splines etc...). However, I have recently been astonished at finding out that many things I thought were only achievable with Fortran or C can be done e.g. entirely using MatLab. When I try

Re: [R] R in Industry

2007-02-09 Thread Jim Lemon
Ben Fairbank wrote: To those following this thRead: There was a thread on this topic a year or so ago on this list, in which contributors mentioned reasons that corporate powers-that-be were reluctant to commit to R as a corporate statistical platform. (My favorite was There is no one to

Re: [R] Data.frame columns in R console

2007-02-09 Thread Martin Maechler
Petr == Petr Pikal [EMAIL PROTECTED] on Fri, 09 Feb 2007 09:42:13 +0100 writes: Petr Hi Petr On 9 Feb 2007 at 10:17, Lauri Nikkinen wrote: Thank you for your answer. When I set options(width=250) I still get the same result when I print the data.frame on my Rgui console

Re: [R] persp plot help

2007-02-09 Thread Petr Pikal
Hi try to look at function interp from akima package. HTH Petr On 8 Feb 2007 at 3:53, mike Ad. wrote: From: mike Ad. [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Date sent: Thu, 08 Feb 2007 03:53:28 -0500 Subject:[R] persp

Re: [R] problems installing R on Linux

2007-02-09 Thread Rebecca Tagett
Prof Brian Ripley ripley at stats.ox.ac.uk writes: We don't know what 'Linux' is here. What Linux distribution, what are your C and Fortran compilers (in detail, e.g. from gcc --version and g77 --version)? We need to see the tail of tests/Examples/base-Ex.Rout.fail to know what went

[R] as.Date() behaviour when incomplete input string

2007-02-09 Thread Nicolas Prune
Dear all, I would like to know the month on a string formatted as 2004-01, using as.Date (not just stripping the string !) ?as.Date says that in case of an incomplete input string, the answer is system-specific. The following has been tested on R 2.4.1, on Ubuntu Linux and WinXP. mydate -

Re: [R] problems installing R on Linux

2007-02-09 Thread Stefan Grosse
Thank you both Pr. Ripley and Dr. Skyler for taking the time to help. I got your further responses in my email here at work. I really think that Dr. Ripley is correct : The symptoms look like a very old Linux distro and a missing/damaged/incompatible libg2c. # gcc --version 2.96 #

[R] densityplot png in a for loop

2007-02-09 Thread Albert Vilella
Hi all, I am trying to plot a list of densityplots as png files, but when I do it in a for loop, I get empty png files as a result. If I manually run the instructions inside the loop, it works... any hints? library(lattice) names_list = c(alfa,beta,gamma) for (i in 1:length(names_list)) {

Re: [R] densityplot png in a for loop

2007-02-09 Thread Petr Pikal
Hi Most probably see the FAQ 7.22 Why do lattice/trellis graphics not work? HTH Petr On 9 Feb 2007 at 11:28, Albert Vilella wrote: Date sent: Fri, 9 Feb 2007 11:28:07 + From: Albert Vilella [EMAIL PROTECTED] To:

Re: [R] densityplot png in a for loop

2007-02-09 Thread Gabor Grothendieck
Check out: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f On 2/9/07, Albert Vilella [EMAIL PROTECTED] wrote: Hi all, I am trying to plot a list of densityplots as png files, but when I do it in a for loop, I get empty png files as a result.

Re: [R] densityplot png in a for loop

2007-02-09 Thread Prof Brian Ripley
This is FAQ Q7.22 On Fri, 9 Feb 2007, Albert Vilella wrote: Hi all, I am trying to plot a list of densityplots as png files, but when I do it in a for loop, I get empty png files as a result. If I manually run the instructions inside the loop, it works... any hints? library(lattice)

Re: [R] generate Binomial (not Binary) data

2007-02-09 Thread Gregor Gorjanc
Marc Bernard bernarduse1 at yahoo.fr writes: I am looking for an R function or any other reference to generate a series of correlated Binomial (not a Bernoulli) data. The bindata library can do this for the binary not the binomial case. But binomial is just a sum of Bernoulli vars so this

Re: [R] How to protect two jobs running on the same directory at the same time not to corrupt each other results:

2007-02-09 Thread Patrick Burns
You can 'save' the objects produced by each BATCH job in a file whose name relates to the job. With this technique, you can run as many BATCH jobs on the same data as you like. Once the jobs are done, then you can 'load' the files that were saved. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525

Re: [R] Numerical Recipes in R

2007-02-09 Thread Thomas Adams
Lorenzo, You may want to look at Octave, which is a MatLab gnu clone: http://www.gnu.org/software/octave/ Regards, Tom Lorenzo Isella wrote: Dear All, So far I have mainly used R for data analysis and simple numerics (integration of functions, splines etc...). However, I have recently

Re: [R] Data.frame columns in R console

2007-02-09 Thread Lauri Nikkinen
Hi, This still does not solve the issue that when I print in R console I get columns that don't fit in the window underneath each other. Thanks anyway! -Lauri 2007/2/9, Martin Maechler [EMAIL PROTECTED]: Petr == Petr Pikal [EMAIL PROTECTED] on Fri, 09 Feb 2007 09:42:13 +0100 writes:

Re: [R] Point estimate from loess contour plot

2007-02-09 Thread Gavin Simpson
On Thu, 2007-02-08 at 19:09 +, Laura Quinn wrote: Hi, I was wondering if anyone knows of a way by which one can estimate values from a contour plot created by using the loess function? I am hoping to use the loess contour plot as a means of interpolation to identify the loess created

Re: [R] LM Model

2007-02-09 Thread Peter Flom
Simon P. Kempf [EMAIL PROTECTED] 2/9/2007 1:36 am asked But I want to skip the lm function and specify my own regression equation RENT= 15 -0.15*AGE1 and then use the predict.lm function. However, in order to use the predict.lm function I need an object of class lm. Is there any way to do so?

Re: [R] setting a number of values to NA over a data.frame.

2007-02-09 Thread John Kane
--- Petr Pikal [EMAIL PROTECTED] wrote: Hi Strange. It works for me without any problem. The problem is that my dataframe has 1,s in about 50% of the columns and I only want it to apply to a few specified columns. My explanation may not have been clear enough. Using your example,I want all

[R] get.hist.quote problem yahoo

2007-02-09 Thread Daniele Amberti
I have functions using get.hist.quote() from library tseries. It seems that something changed (yahoo) and function get broken. try with a simple get.hist.quote('IBM') and let me kow if for someone it is still working. I get this error: Error in if (!quiet dat[n] != start) cat(format(dat[n],

[R] get.hist.quote problem yahoo

2007-02-09 Thread Daniele Amberti
I have functions using get.hist.quote() from library tseries. It seems that something changed (yahoo) and function get broken. try with a simple get.hist.quote('IBM') and let me kow if for someone it is still working. I get this error: Error in if (!quiet dat[n] != start) cat(format(dat[n],

[R] get.hist.quote problem yahoo

2007-02-09 Thread Daniele Amberti
I have functions using get.hist.quote() from library tseries. It seems that something changed (yahoo) and function get broken. try with a simple get.hist.quote('IBM') and let me kow if for someone it is still working. I get this error: Error in if (!quiet dat[n] != start) cat(format(dat[n],

Re: [R] Problem with factor state when subset()ing a data.frame

2007-02-09 Thread Peter Dalgaard
Roger Leigh wrote: Hi folks, I am running into a problem when calling subset() on a large data.frame. One of the columns contains strings which are used as factors. R seems to automatically factor the column when the data.frame is contstructed, and this appears to not get updated when I

[R] blockwise matrix multiplication

2007-02-09 Thread Robin Hankin
Hi Given an n-by-n matrix A, say n=10 and A - matrix(1:100,10,10) and a vector x of length n where 1 =x[i] = n for i=1..n say x - c(1,1,1,2,4,3,3,3,4,4) and a matrix M of size max(x)-by-max(x), say M - matrix(c(1, 0.1, 0, 0.2, 0.1, 1, 0, 0, 0, 0, 1, 0.2, 0.2, 0, 0.2, 1),4,4) how do I

Re: [R] Data.frame columns in R console

2007-02-09 Thread Martin Maechler
Lauri == Lauri Nikkinen [EMAIL PROTECTED] on Fri, 9 Feb 2007 14:21:26 +0200 writes: Lauri This still does not solve the issue that when I print in R console I get Lauri columns that don't fit in the window underneath each other. Thanks anyway! But Brian did give you all you

Re: [R] setting a number of values to NA over a data.frame.

2007-02-09 Thread Charilaos Skiadas
Once again I forgot to reply to the whole list On Feb 9, 2007, at 8:39 AM, Charilaos Skiadas wrote: On Feb 9, 2007, at 8:13 AM, John Kane wrote: The problem is that my dataframe has 1,s in about 50% of the columns and I only want it to apply to a few specified columns. My explanation may

[R] Help in using multcomp.

2007-02-09 Thread A Ezhil
Hi All, I am trying use 'multcomp' for multiple comparisons after my ANOVA analysis. I have used the following code to do ANOVA: dat - matrix(rnorm(45), nrow=5, ncol=9) f - gl(3,3,9, label=c(C, Tl, T2)) aof - function(x) { m - data.frame(f, x); aov(x ~ f, m) } amod -

Re: [R] Re : Re: setting a number of values to NA over a data.frame.

2007-02-09 Thread John Kane
--- Olivier ETERRADOSSI [EMAIL PROTECTED] wrote: Hi again, Awfully sorry John, I should have been sleeping and did not see your full post here is a way, unless I miss the point again : fake-as.data.frame(cbind(seq(1,10,by=1),c(rep(1,4),rep(0,4),rep(2,2 # from my previous

Re: [R] setting a number of values to NA over a data.frame.

2007-02-09 Thread Petr Pikal
Hi but you can easily extend it to only several columns data[, col.selection] [data[, col.selection]==1]-NA so in my case zeta[,2] [zeta[,2] == 1] - NA shall change only 1 in column 2 to NA (not tested) HTH Petr On 9 Feb 2007 at 8:13, John Kane wrote: Date sent: Fri, 9 Feb

Re: [R] setting a number of values to NA over a data.frame.

2007-02-09 Thread John Kane
--- Jim Lemon [EMAIL PROTECTED] wrote: John Kane wrote: This is probably a simple problem but I don't see a solution. I have a data.frame with a number of columns where I would like 0 - NA Hi John, You might have a look at toNA in the prettyR package. Wait for version

[R] extract submatrix with unique names

2007-02-09 Thread Glazko, Galina
Dear list, I have a table where first 3 columns are identical if the name in the first column is the same, and the number in N4 is slightly different for all identical names, like this: --- 29Mm.1_at 3 +

Re: [R] blockwise matrix multiplication

2007-02-09 Thread Gabor Grothendieck
Try this: A * M[as.matrix(expand.grid(x,x))[,2:1]] On 2/9/07, Robin Hankin [EMAIL PROTECTED] wrote: Hi Given an n-by-n matrix A, say n=10 and A - matrix(1:100,10,10) and a vector x of length n where 1 =x[i] = n for i=1..n say x - c(1,1,1,2,4,3,3,3,4,4) and a matrix M of size

Re: [R] blockwise matrix multiplication

2007-02-09 Thread Robin Hankin
Wow. It generalizes nicely to arbitrary dimensional arrays too. thanks a lot! rksh On 9 Feb 2007, at 14:19, Gabor Grothendieck wrote: Try this: A * M[as.matrix(expand.grid(x,x))[,2:1]] On 2/9/07, Robin Hankin [EMAIL PROTECTED] wrote: Hi Given an n-by-n matrix A, say n=10 and

Re: [R] generate Binomial (not Binary) data

2007-02-09 Thread Duncan Murdoch
On 2/7/2007 8:20 AM, Marc Bernard wrote: Dear All, I am looking for an R function or any other reference to generate a series of correlated Binomial (not a Bernoulli) data. The bindata library can do this for the binary not the binomial case. Ted asked how you want your series

Re: [R] Numerical Recipes in R

2007-02-09 Thread Duncan Murdoch
On 2/9/2007 5:00 AM, Lorenzo Isella wrote: Dear All, So far I have mainly used R for data analysis and simple numerics (integration of functions, splines etc...). However, I have recently been astonished at finding out that many things I thought were only achievable with Fortran or C can be

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Prof Brian Ripley
The other reason why pmin/pmax are preferable to your functions is that they are fully generic. It is not easy to write C code which takes into account that , [, [- and is.na are all generic. That is not to say that it is not worth having faster restricted alternatives, as indeed we do with

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Douglas Bates
On 2/9/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: The other reason why pmin/pmax are preferable to your functions is that they are fully generic. It is not easy to write C code which takes into account that , [, [- and is.na are all generic. That is not to say that it is not worth having

Re: [R] enhanced question / standardized coefficients

2007-02-09 Thread Michael Dewey
At 15:51 07/02/2007, Brian S Cade wrote: There was a nice paper in The American Statistician by Johan Bring (1994. How to standardize regression coefficients. The American Statistician 48(3):209-213) pointing out that comparing ratios of t-test statistic values (for null hypothesis that parameter

[R] cluster non-diet, diet example.

2007-02-09 Thread jia ding
Suppose, we have 3 people called: Francis, Cedric and Nina. Base on what they have eaten, we want to cluster people by diet, non-diet. # original data file, named as filename food.csv. Francis|potato Francis|chocolate Francis|chocolate Francis|milk Cedric|vegetable Cedric|vegetable Cedric|potato

Re: [R] How to count the number of NAs in each column of a df?

2007-02-09 Thread Michael Kubovy
Dear Jim (25 minutes!), Richard (27 minutes!), and Chuck, Thanks to your hints, I have come up with what I hope is a pithy idiom that drops columns of a dataframe (df) in which the number of NAs is (e.g.) 30. tmp - df tmp - tmp[, which(as.numeric(colSums(is.na(tmp))) 30)] df - tmp I

[R] Using variable names in for loops - Generating plots semi-automatically from a series of variables Partly solved

2007-02-09 Thread Anthony Staines
Hi, This code is trying to produce a series of graphics files, with plots of male and female disease rates by age, one plot per disease. The dataframe contains a variable 'Age' and a set of variables called 'Male_CVD, Female_CVD,Male_RTA,Female_RTA, and so on. For each disease, I want to pull out

[R] problem with eigen() function

2007-02-09 Thread Jingqin luo
Dear R-users, Recently, I have come across a weird problem. I run a large number of iterations and at one of the step within each iteration, I calculate the eigen values of a updated covariance matrix. From all my intermediate output, the code freezes after printing out the covariance matrix

[R] Replace individual values in a data frame with NA

2007-02-09 Thread Jason Horn
I'd like to replace a value in a data frame with an NA, but can't figure out how. For example, say you have a-c(1,2,3,4) b-c(5,6,7,8) data-data.frame(a,b) Now, how would you set the third row of the second column ( data [[3,2]] ) to NA? I have tried all types of permutations with is.na,

[R] two perspective plots in in plot

2007-02-09 Thread Roland Rau
Dear all, I would like to put two perspective plots into one plot. The help page for ?persp shows how one can add points and lines but not another perspective plot. data(volcano) z - 2 * volcano# Exaggerate the relief x - 10 * (1:nrow(z)) # 10 meter spacing (S to N) y - 10 *

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Thomas Lumley
On 2/9/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: The other reason why pmin/pmax are preferable to your functions is that they are fully generic. It is not easy to write C code which takes into account that , [, [- and is.na are all generic. That is not to say that it is not worth

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Ravi Varadhan
Hi Profs. Ripley and Bates, I also recollect from a Tom Lumley email that when he profiled an MCMC computation, he found that pmin/pmax was the bottleneck. That is why he suggested the function that I called fast.pmax. I think that it would be nice to have restricted alternative functions

Re: [R] generate Binomial (not Binary) data

2007-02-09 Thread Ted Harding
On 09-Feb-07 Duncan Murdoch wrote: On 2/7/2007 8:20 AM, Marc Bernard wrote: Dear All, I am looking for an R function or any other reference to generate a series of correlated Binomial (not a Bernoulli) data. The bindata library can do this for the binary not the binomial case.

[R] fCalendar Q/.

2007-02-09 Thread Mauricio Arcos
Dear List, i got stuck on this... I've a very big data base with tic by tic $COP/US$ exchange rate and trade volume in millions (obs =3 millions). I´ve been trying around for some time, but I could not find a efficient way to calculate a weighted mean exchange rate using blocks by 5 mins.

Re: [R] Replace individual values in a data frame with NA

2007-02-09 Thread Henrique Dallazuanna
data[3,2]-NA On 09/02/07, Jason Horn [EMAIL PROTECTED] wrote: I'd like to replace a value in a data frame with an NA, but can't figure out how. For example, say you have a-c(1,2,3,4) b-c(5,6,7,8) data-data.frame(a,b) Now, how would you set the third row of the second column ( data

Re: [R] Replace individual values in a data frame with NA

2007-02-09 Thread Michael Kubovy
On Feb 9, 2007, at 11:10 AM, Jason Horn wrote: I'd like to replace a value in a data frame with an NA, but can't figure out how. For example, say you have a-c(1,2,3,4) b-c(5,6,7,8) data-data.frame(a,b) Now, how would you set the third row of the second column ( data [[3,2]] ) to NA?

Re: [R] extract submatrix with unique names

2007-02-09 Thread David Barron
This should do it, assuming you data is in a data frame called dat: sel - unique(dat$V1) ix - match(sel,dat$V1) dat[ix,] On 09/02/07, Glazko, Galina [EMAIL PROTECTED] wrote: Dear list, I have a table where first 3 columns are identical if the name in the first column is the same, and

Re: [R] problem with eigen() function

2007-02-09 Thread Patrick Burns
This problem reminds me of the problem described in: tolstoy.newcastle.edu.au/*R*/devel/03b/1304.html In that case a specific matrix causes 'eigen' to return NaNs in the eigen vectors. But dumping the matrix and reading it back in does not reproduce the problem. That you are getting a hang

Re: [R] LM Model

2007-02-09 Thread Mark Lyman
Simon P. Kempf simon.kempf at web.de writes: [SNIP] But I want to skip the lm function and specify my own regression equation RENT= 15 -0.15*AGE1 and then use the predict.lm function. However, in order to use the predict.lm function I need an object of class lm. Is there any way to do so?

Re: [R] problem with eigen() function

2007-02-09 Thread Patrick Burns
The original address has extraneous asterisks (*) around the R, here is one that works (for me at least): tolstoy.newcastle.edu.au/R/devel/03b/1304.html Patrick Burns wrote: This problem reminds me of the problem described in: tolstoy.newcastle.edu.au/*R*/devel/03b/1304.html In that case a

[R] inquiry

2007-02-09 Thread Jérôme Bouscaut
Dear Mister, I'm a new user of the R programm, and I've got a simple question. I analyse microarray with this programm, I have tranformed my data in a data file, after that, I normalize my data and create a MA list. Il the Excel tab I obtain, there is a column called Coefficent, I wish to know

Re: [R] R in Industry

2007-02-09 Thread Jeremy Miles
I was under the impression that most software has a licence agreement that does not allow you to sue them. If Windows crashes at a crucial moment, and loses me millions of dollars [I can't imagine that happening to me, but it might happen to someone], I don't think I can sue microsoft. A few

[R] RE gap statistic in cluster analysis

2007-02-09 Thread GRAHAM LEASK
Has anyone implemented Tibrishani's gap statistic in R or S plus? If so I would greatly appreciate the relevant script file. Any help will be much appreciated Kind regards Dr Graham Leask Economics and Strategy Group Aston Business School Aston University Aston Triangle Birmingham B4

[R] Error handling with try function

2007-02-09 Thread Serguei Kaniovski
Hi, I apply optim a given input-matrix imat by row in the following way: apply(imat, 1, function(x) try(optim(0.1, gf, method=BFGS, y=x)$par, silent=1)) where gr-function(x,y) is defined upstream. Now, for several rows I get an error message from the optim, so the output matrix get the error

Re: [R] Help in using multcomp.

2007-02-09 Thread Chuck Cleland
A Ezhil wrote: Hi All, I am trying use 'multcomp' for multiple comparisons after my ANOVA analysis. I have used the following code to do ANOVA: dat - matrix(rnorm(45), nrow=5, ncol=9) f - gl(3,3,9, label=c(C, Tl, T2)) aof - function(x) { m - data.frame(f, x); aov(x ~

Re: [R] RE gap statistic in cluster analysis

2007-02-09 Thread Matthias Kohl
there is an implementation in package SLmisc and also in the bioconductor package SAGx. hth Matthias GRAHAM LEASK schrieb: Has anyone implemented Tibrishani's gap statistic in R or S plus? If so I would greatly appreciate the relevant script file. Any help will be much appreciated

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Frank E Harrell Jr
Thomas Lumley wrote: On 2/9/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: The other reason why pmin/pmax are preferable to your functions is that they are fully generic. It is not easy to write C code which takes into account that , [, [- and is.na are all generic. That is not to say that

Re: [R] RE gap statistic in cluster analysis

2007-02-09 Thread Chuck Cleland
GRAHAM LEASK wrote: Has anyone implemented Tibrishani's gap statistic in R or S plus? If so I would greatly appreciate the relevant script file. Any help will be much appreciated RSiteSearch(gap cluster) finds http://finzi.psych.upenn.edu/R/library/SAGx/html/gap.html Kind regards

Re: [R] Using variable names in for loops - Generating plot s semi-automatically from a series of variables Partly solved

2007-02-09 Thread Mark Lyman
Anthony Staines anthony.staines at gmail.com writes: For each disease, I want to pull out the column of data containing the word 'Male' and plot this against age, and then add a line to the plot for the corresponding column containing 'Female'. -- attach(data) Diseases - c(Cardiovascular

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Martin Maechler
TL == Thomas Lumley [EMAIL PROTECTED] on Fri, 9 Feb 2007 08:13:54 -0800 (PST) writes: TL On 2/9/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: The other reason why pmin/pmax are preferable to your functions is that they are fully generic. It is not easy to write C code which

Re: [R] two perspective plots in in plot

2007-02-09 Thread Greg Snow
Probably the easiest way is to use the wireframe function in the lattice package. The second example in the help shows 2 surfaces (you do need to combine the data into a single data frame). If you really want to use the persp function, then you could create the first plot, then call

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Prof Brian Ripley
On Fri, 9 Feb 2007, Frank E Harrell Jr wrote: [...] I looked in all the code for the Hmisc and Design packages and didn't find a single example where pmin or pmax did not have 2 arguments. So I think it is important to have pmin2 and pmax2. Why? Do you have any reason to suppose that

Re: [R] Zeta and Zipf distribution

2007-02-09 Thread Mauro Rossi
Thank you David, I've followed you example and I found the parameters I need. I also write a script using zetaff distribution and also this works well. Thank you again, Mauro David Barron ha scritto: I don't claim to be a huge expert on this, but I think you are mistaken about what you are

[R] TA-Lib and R

2007-02-09 Thread jacinthe
Dear all, does someone know how to use TA-Lib in R (http://ta-lib.org/)? Regards Jaci -- Feel free - 5 GB Mailbox, 50 FreeSMS/Monat ... Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out __ R-help@stat.math.ethz.ch mailing list

Re: [R] get.hist.quote problem yahoo

2007-02-09 Thread Rene Braeckman
I had the same problem some time ago. Below is a function that I picked up on the web somewhere (can't remember where; may have been a newsletter). It's based on the tseries function but the difference is that this function produces a data frame with a column containing the dates of the quotes,

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Prof Brian Ripley
x - rnorm(1) system.time(for(i in 1:1000) pmax(x, 0)) user system elapsed 4.430.054.54 pmax2 - function(k,x) (x+k + abs(x-k))/2 system.time(for(i in 1:1000) pmax2(x, 0)) user system elapsed 0.640.030.67 pm - function(x) {z - x0; x[z] - 0; x}

Re: [R] generate Binomial (not Binary) data

2007-02-09 Thread Adelchi Azzalini
On Fri, 09 Feb 2007 16:21:58 - (GMT), (Ted Harding) wrote: Let i indexes a subject and Y_i = (Y_i1, Y_i2,...,Y_iT) be a vector of binomial variables for subject i such that Y_it ~ Bin(n,p_t) with t = 1,2, T. A simple correlation I would like to have is : corr(Y_ij,

Re: [R] two perspective plots in in plot

2007-02-09 Thread Duncan Murdoch
On 2/9/2007 1:11 PM, Greg Snow wrote: Probably the easiest way is to use the wireframe function in the lattice package. The second example in the help shows 2 surfaces (you do need to combine the data into a single data frame). If you really want to use the persp function, then you could

[R] Local R Users Groups?

2007-02-09 Thread Talbot Katz
Hi. I have only recently become a regular R user, and have already benefited from the R-help list (Thank you!). I have spent many years in the SAS world (insert your own sassy remark here), which has its own very nice users list site (http://listserv.uga.edu/archives/sas-l.html), plus users

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Duncan Murdoch
On 2/9/2007 1:33 PM, Prof Brian Ripley wrote: x - rnorm(1) system.time(for(i in 1:1000) pmax(x, 0)) user system elapsed 4.430.054.54 pmax2 - function(k,x) (x+k + abs(x-k))/2 system.time(for(i in 1:1000) pmax2(x, 0)) user system elapsed 0.640.030.67 pm

[R] heatmap color specification

2007-02-09 Thread Xiaohui
hi, I have a positive integer matrix like: test-matrix(c(1,2,2,2,2,1,1,2,3),3) and based on the distant function I made like this: generateDistMat-function (target) { n - nrow(target) rn - rownames(target) distM - matrix(NA, n, n) diag(distM) - 0 for (i in 1:(n - 1)) for (j

Re: [R] two perspective plots in in plot

2007-02-09 Thread Roland Rau
Thanks Duncan and Greg. My current solution is to use the rgl-package. Is there an easy way to obtain a screenshot in eps- or pdf-Format from such an rgl-window? I saw the rgl.snapshot function but it does not provide this format. So far, I take a snapshot, save it as jpeg and convert it to eps

[R] How to get predicted time from coxph model

2007-02-09 Thread Ru Ding
** Reply Requested When Convenient ** __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

[R] Graphical device questions?

2007-02-09 Thread Sebastien Durand
Dear all, Here is my questions: 1- Under a WINDOWS installation of R-2.4.1, can we change the naming of a new ploting device open by the command windows()?. Instead of the default name e.g.: Device 2 I would like to use something like Density plot or whatever! 2- Under a MAC OS X

[R] dyn.load problem under linux

2007-02-09 Thread Domenico Vistocco
Dear HelpeRs, I am trying to use an thirdy-part library under Linux (the library is developed both for Windows and for Linux). I have tried different solutions (with the library developer) but we are not able to solve the problem. So I try to ask for your help in order to escape from the full

[R] plotting derived values not raw

2007-02-09 Thread James Root
I am trying to plot the mean and standard error of three separate conditions. For various reasons, I do not have access to the raw data from which the mean and error were derived and would like to make error bar plots utilizing only the actual mean and standard error values. Is there a way to do

Re: [R] plotting derived values not raw

2007-02-09 Thread Mark Lyman
James Root jcroot at gmail.com writes: I am trying to plot the mean and standard error of three separate conditions. For various reasons, I do not have access to the raw data from which the mean and error were derived and would like to make error bar plots utilizing only the actual mean

Re: [R] TA-Lib and R

2007-02-09 Thread Douglas Bates
On 2/9/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Does someone know how to use TA-Lib in R (http://ta-lib.org/)? Simple. Read the documentation for TA-Lib, then read the manual Writing R Extensions, then write and test the necessary interface routines.

Re: [R] two perspective plots in in plot

2007-02-09 Thread Greg Snow
The rgl package has an rgl.postscript function that should do that for you (I think there was a bug discovered and fixed recently, so make sure to get the latest version). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111

Re: [R] Confidence intervals of quantiles

2007-02-09 Thread mikewhite . diu
Many thanks for all the contributions to this problem. As inferred by Ted Harding, I was after a distribution-free CIs as a lot of the data I use is not normally distributed. The method provided by Ted for calculating exact CIs gave good results with the limits almost symmetric about the

Re: [R] dyn.load problem under linux

2007-02-09 Thread Patrick Burns
Some additional notes inserted below. Domenico Vistocco wrote: Dear HelpeRs, I am trying to use an thirdy-part library under Linux (the library is developed both for Windows and for Linux). I have tried different solutions (with the library developer) but we are not able to solve the

Re: [R] plotting derived values not raw

2007-02-09 Thread Chuck Cleland
James Root wrote: I am trying to plot the mean and standard error of three separate conditions. For various reasons, I do not have access to the raw data from which the mean and error were derived and would like to make error bar plots utilizing only the actual mean and standard error values.

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Martin Maechler
Duncan == Duncan Murdoch [EMAIL PROTECTED] on Fri, 09 Feb 2007 13:52:25 -0500 writes: Duncan On 2/9/2007 1:33 PM, Prof Brian Ripley wrote: x - rnorm(1) system.time(for(i in 1:1000) pmax(x, 0)) user system elapsed 4.430.054.54 pmax2 - function(k,x)

[R] How to add the variable name to a qqplot or densityplot in the diagonal of an splom?

2007-02-09 Thread Michael Kubovy
splom() doesn't complain here, but writes no names in the diagonal boxes. What am I missing? I believe that I need to add something like grid.text(x, ...) to the diagonal panel, but I don't know how to get it cycle through the column labels. And should varname.col = 'blue', varname.cex

Re: [R] two perspective plots in in plot

2007-02-09 Thread Duncan Murdoch
On 2/9/2007 4:16 PM, Greg Snow wrote: The rgl package has an rgl.postscript function that should do that for you (I think there was a bug discovered and fixed recently, so make sure to get the latest version). Yes, that's right. If you see any other bugs, please let me know. (One known bug

  1   2   >