Re: [R] running R-code outside of R

2008-06-24 Thread Jim Porzak
The user of your R script sees only the outputs you create. The R source is hidden. HTH, Jim Porzak Responsys, Inc. San Francisco, CA http://www.linkedin.com/in/jimporzak On Tue, Jun 24, 2008 at 9:33 PM, Esmail Bonakdarian <[EMAIL PROTECTED]> wrote: > Jim Porzak wrote: > >> Roger, >> >> Followin

Re: [R] Incompatible methods ("+.Date", "Ops.difftime") for "+"

2008-06-24 Thread Gabor Grothendieck
You can specify units= to be extra sure: d <- difftime(Sys.Date() + 1, Sys.Date(), units = "mins") as.numeric(d, units = "days") On Wed, Jun 25, 2008 at 12:23 AM, Richard M. Heiberger <[EMAIL PROTECTED]> wrote: > I received a warning about incompatible methods that I don't understand. > The wo

Re: [R] running R-code outside of R

2008-06-24 Thread Esmail Bonakdarian
Jim Porzak wrote: Roger, Following on to Spencer's comments, we have had some success using RWui http://rwui.cryst.bbk.ac.uk/ to build web enabled versions of (non-interactive) R programs. Advantage is your users only need a browser. No exe to install. Downside is you need to have a web server

[R] Incompatible methods ("+.Date", "Ops.difftime") for "+"

2008-06-24 Thread Richard M. Heiberger
I received a warning about incompatible methods that I don't understand. The workaround in this example is simple. What is the reason that these methods are seen as incompatible? Is there some dangerous consequence of my as.numeric() workaround? Can a fix to the code base, perhaps similar to my wo

Re: [R] help with cube3d cube size

2008-06-24 Thread Ben Bolker
Mark Kimpel gmail.com> writes: > > I'm using the command below on an open3d() object to create a shaded > cube. Changes to myScalingFactor do not effect changes in the size of > the cube. What is the correct approach? Mark how about scale3d() ? shade3d(translate3d(scale3d(cube3d(),5,5,5),-

Re: [R] help with cube3d cube size

2008-06-24 Thread Duncan Murdoch
Mark Kimpel wrote: I'm using the command below on an open3d() object to create a shaded cube. Changes to myScalingFactor do not effect changes in the size of the cube. What is the correct approach? Mark shade3d(translate3d(cube3d(identityMatrix() * myScalingFactor),-6,1,-1),col="green", alpha =

Re: [R] Error message: Bad value

2008-06-24 Thread Toby Gass
Thank you for the response. I was doing a basic operation with a small dataset and am (fortunately for me) unable to reproduce the error. After restarting R, without shutting down anything else, there was no error. I thought I would post, however, since 2 others had reported the same problem

Re: [R] Average of Two Matrices

2008-06-24 Thread Erik Iverson
What about z <- (x + y) / 2 Gundala Viswanath wrote: Hi, I have two matrices x and y (same dimensions). How can I compute the average of "x" and "y" for each coordinate to form a new average matrix "z" ? - Gundala Viswanath Jakarta - Indonesia __

[R] Average of Two Matrices

2008-06-24 Thread Gundala Viswanath
Hi, I have two matrices x and y (same dimensions). How can I compute the average of "x" and "y" for each coordinate to form a new average matrix "z" ? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

[R] help with cube3d cube size

2008-06-24 Thread Mark Kimpel
I'm using the command below on an open3d() object to create a shaded cube. Changes to myScalingFactor do not effect changes in the size of the cube. What is the correct approach? Mark shade3d(translate3d(cube3d(identityMatrix() * myScalingFactor),-6,1,-1),col="green", alpha = 0.2) -- Mark W. Kim

Re: [R] heatmap and continuous variable

2008-06-24 Thread Gregory Warnes
Hello Hans, Do you need *both* a categorical *and* a continuous variable, or just a continuous variable? -Greg On 6/24/08 4:51PM , "Hans-Ulrich Klein" <[EMAIL PROTECTED]> wrote: > Dear All, > > I want to plot a heat map with annotated columns. Both functions heatmap > (stats) and heatmap.2 (g

Re: [R] Hessian in box-constraint problem - concern OPTIM function

2008-06-24 Thread Cleber Nogueira Borges
Hello Mr. Graves, Hello all useRs, Many thanks for your attention. This is an interesting question. What is the problem you are trying to solve and how do the boundary conditions function as part of this system? One of the functions that I need to minimized is: sum( ( ( hat_xi - xi

Re: [R] Dynamically switching lattice device characteristics in Sweave under Makefile control

2008-06-24 Thread Deepayan Sarkar
On 6/24/08, Douglas Bates <[EMAIL PROTECTED]> wrote: > I am indebted to Deepayan Sarkar for lattice graphics, Fritz Leisch > for Sweave and the authors of the beamer package for LaTeX. For me > these are a "killer app" combination. I wouldn't want to go back to > creating presentations in any o

Re: [R] Error message: Bad value

2008-06-24 Thread Duncan Murdoch
On 24/06/2008 3:12 PM, Toby Gass wrote: Dear R help, In the middle of my session, I started receiving the error message "bad value" regardless of what I entered. I had to close R and restart it. When the error occurred, I was creating basic lattice plots, with no other add-on packages running.

Re: [R] running R-code outside of R

2008-06-24 Thread Gabor Grothendieck
You can set up a web site and have them use that. Then they just need a browser. See www.rpad.org for one way or develop an internal or external site using any technology you know and call R on the back end. On Tue, Jun 24, 2008 at 2:01 PM, Roger Leenders <[EMAIL PROTECTED]> wrote: > > R 2.7.0,

Re: [R] running R-code outside of R

2008-06-24 Thread Jim Porzak
Roger, Following on to Spencer's comments, we have had some success using RWui http://rwui.cryst.bbk.ac.uk/ to build web enabled versions of (non-interactive) R programs. Advantage is your users only need a browser. No exe to install. Downside is you need to have a web server accessible to your u

Re: [R] logistic regression

2008-06-24 Thread Bill.Venables
It looks like A*B*C*D is a complete, totally saturated model, (the residual deviance is effectively zero, and the residual degrees of freedom is exactly zero - this is a clue). So when you try to put even more parameters into the model and even higher way interactions, something has to give. I

Re: [R] running R-code outside of R

2008-06-24 Thread Spencer Graves
A short answer to your question is 'yes and no': R is an interpreted language. There may have been attempts to create a "compiler" for R, but I don't know if any have actually succeeded very well. However, there are ways to (a) call R from other languages and (b) run R in batch mo

Re: [R] Measuring Goodness of a Matrix

2008-06-24 Thread Gundala Viswanath
Thanks so much all. I will try out each of your suggestions. - Gundala Viswanath Jakarta - Indonesia On Wed, Jun 25, 2008 at 8:01 AM, Moshe Olshansky <[EMAIL PROTECTED]> wrote: > What do you mean by "A similar to X"? > Do you mean norm of the difference, similar eigenvalues/vectors, anything >

[R] logistic regression

2008-06-24 Thread Mikhail Spivakov
Hi everyone, I'm sorry if this turns out to be more a statistical question than one specifically about R - but would greatly appreciate your advice anyway. I've been using a logistic regression model to look at the relationship between a binary outcome (say, the odds of picking n white balls fro

Re: [R] Find max of a row in data frame (like Excel)

2008-06-24 Thread Erik Iverson
?pmax Anh Tran wrote: Hi, Here's the data we have: rs[1:5,] probe_id f1 f2 f3 f4 MA f 1 A_68_P20002076 2 58 0 0 1.51778114 6.344453 59 2 A_68_P20002775 22 8 15 0 0.43419304 5.488819 59 3 A_68_P20005791 43 3 0 0 0.05698666 9.830594 59 4 A_68_P20005805 11 34 0

Re: [R] Equivalent of Mathematica's Apply

2008-06-24 Thread Juan Pablo Romero Méndez
Thanks all! JP On Tue, Jun 24, 2008 at 3:30 PM, Franz Mueter <[EMAIL PROTECTED]> wrote: > Try > >> apply(ind, 1, function(i) x[i[1]:i[2]]) > > which returns a matrix if all sequences are the same length, a list > otherwise > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL

[R] Error message: Bad value

2008-06-24 Thread Toby Gass
Dear R help, In the middle of my session, I started receiving the error message "bad value" regardless of what I entered. I had to close R and restart it. When the error occurred, I was creating basic lattice plots, with no other add-on packages running. I am running R through John Fox's XEmacs

Re: [R] Find max of a row in data frame (like Excel)

2008-06-24 Thread milton ruser
Hi Anh, I know that it is not so elegant, but may work. x<-runif(10) y<-runif(10)*2 z<-runif(10)*3 df<-data.frame(cbind(x,y,z)) df df$f<-NULL for (i in 1:nrow(df)) { df[i,"f"]<-max(c(df[i,"x"],df[i,"y"],df[i,"z"])) } Of course, others that know better apply family will solve if with a line

Re: [R] Measuring Goodness of a Matrix

2008-06-24 Thread Moshe Olshansky
What do you mean by "A similar to X"? Do you mean norm of the difference, similar eigenvalues/vectors, anything else? --- On Wed, 25/6/08, Gundala Viswanath <[EMAIL PROTECTED]> wrote: > From: Gundala Viswanath <[EMAIL PROTECTED]> > Subject: [R] Measuring Goodness of a Matrix > To: [EMAIL PROTECT

Re: [R] Find max of a row in data frame (like Excel)

2008-06-24 Thread jim holtman
Is this what you want: > x <- read.table(textConnection(" probe_id f1 f2 f3 f4 M > A f + 1 A_68_P20002076 2 58 0 0 1.51778114 6.344453 59 + 2 A_68_P20002775 22 8 15 0 0.43419304 5.488819 59 + 3 A_68_P20005791 43 3 0 0 0.05698666 9.830594 59 + 4 A_68_P20005805 11 34

[R] how to make auto.key to produce a legend that uses line pattern (rather than data point) as labels?

2008-06-24 Thread Mark Farnell
Hi! I am working on a line graph under xyplot. what command should I feed to auto.key so that it uses the line pattern of series as labels? Also where can I find doc about all options that I can feed to auto.key? Thanks! Mark __ R-help@r-project.org

[R] Find max of a row in data frame (like Excel)

2008-06-24 Thread Anh Tran
Hi, Here's the data we have: > rs[1:5,] probe_id f1 f2 f3 f4 MA f 1 A_68_P20002076 2 58 0 0 1.51778114 6.344453 59 2 A_68_P20002775 22 8 15 0 0.43419304 5.488819 59 3 A_68_P20005791 43 3 0 0 0.05698666 9.830594 59 4 A_68_P20005805 11 34 0 0 1.71076835 6.624038 5

Re: [R] spineplot (graphics package): how to control font size?

2008-06-24 Thread Duncan Murdoch
On 24/06/2008 5:21 PM, Paul Shannon wrote: I cannot modify the font size of the standard text items for the splineplot function found in the standard graphics package. Here is a tiny example, in which I try (but fail) to make the main title large. tbl = read.table ('http://www.ggobi.or

[R] Dynamically switching lattice device characteristics in Sweave under Makefile control

2008-06-24 Thread Douglas Bates
I am indebted to Deepayan Sarkar for lattice graphics, Fritz Leisch for Sweave and the authors of the beamer package for LaTeX. For me these are a "killer app" combination. I wouldn't want to go back to creating presentations in any other way. When I create a presentation I use a Makefile that al

[R] GWA plot

2008-06-24 Thread kk473
I need some help with a genome-wide association scatterplot. A recently published example of such a plot is attached to this message. Typical variables include: Y: -logP-value (range from 0 to 8) X: chromosomal distance Z: chromosomes 1 through 22 and X (a factor with 23 levels) I used coplot(

[R] spineplot (graphics package): how to control font size?

2008-06-24 Thread Paul Shannon
I cannot modify the font size of the standard text items for the splineplot function found in the standard graphics package. Here is a tiny example, in which I try (but fail) to make the main title large. tbl = read.table ('http://www.ggobi.org/book/data/tips.csv', sep=',', header=T)

Re: [R] Measuring Goodness of a Matrix

2008-06-24 Thread Mark Difford
Hi Gundala, >> Suppose I have 2 matrices A and B. >> And I want to measure how good each of this matrix is. You really want to be using Robert & Escoufier's RV-coefficient (A unifying tool for linear multivariate statistical methods: The $RV$-coefficient Appl. Statist., 1976, 25, 257-265). Seve

Re: [R] Coloring Stripchart Points, or Better, Lattice Equivalent

2008-06-24 Thread Deepayan Sarkar
On 6/24/08, Bryan Hanson <[EMAIL PROTECTED]> wrote: > If anyone remains interested, the solution in base graphics is to modify > stripchart.default, the last couple of lines where the coloring of points > defaults in a way that depends on groups. In my example, the groups are > being handled co

[R] heatmap and continuous variable

2008-06-24 Thread Hans-Ulrich Klein
Dear All, I want to plot a heat map with annotated columns. Both functions heatmap (stats) and heatmap.2 (gplots) can plot a horizontal side bar that can be used to visualize a categorical variable. In addition to a categorical variable, I would like to visualize a continuous variable. This could

Re: [R] running R-code outside of R

2008-06-24 Thread Rolf Turner
On 25/06/2008, at 6:01 AM, Roger Leenders wrote: R 2.7.0, WinXP Hi list, I have written some code in R that I would like to share with others who are not R-users. Is there a way to compile the code so it will run outside of R? The best thing would be a functionality to compile the code in

Re: [R] Equivalent of Mathematica's Apply

2008-06-24 Thread Franz Mueter
Try > apply(ind, 1, function(i) x[i[1]:i[2]]) which returns a matrix if all sequences are the same length, a list otherwise -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Juan Pablo Romero Méndez Sent: Tuesday, June 24, 2008 11:51 AM To: [EMAIL PROTECT

Re: [R] R help on for loop

2008-06-24 Thread milton ruser
Hi Ramya. Like this? for ( i in 1:nrow(map) ) { cat ("this is the line", i, "\n") } Miltinho. Brazil On 6/24/08, Rajasekaramya <[EMAIL PROTECTED]> wrote: > > > hi, > > I have a data stored in table format. The data is stored in the name map. > > 500545 rows and 3 columns. > > I want to use

[R] R help on for loop

2008-06-24 Thread Rajasekaramya
hi, I have a data stored in table format. The data is stored in the name map. 500545 rows and 3 columns. I want to use a for loop to scan through till the end of the row. can i use like this. for ( i in 1:row(map) { } Kindly clarify me Cheers Ramya -- View this message in context: http:/

Re: [R] persp plot

2008-06-24 Thread Chad Junkermeier
Thanks for your reply. When I did what you said z <- t(matrix(zdata, nrow = length(ydata))) persp(xdata, ydata, z) I got the following errors: Error in persp.default(xdata, ydata, z) : invalid 'x' argument Calls: persp -> persp.default In addition: Warning messages: 1: In min(x, na.rm = na.r

Re: [R] Need ideas on how to show spikes in my data and how to code it in R

2008-06-24 Thread Rolf Turner
On 24/06/2008, at 8:10 AM, Daniel Folkinshteyn wrote: on 06/23/2008 03:40 PM Thomas Frööjd said the following: 2. Scale the data so they can be plotted on the same axis. The reference dataset has around 20 000 observations and my data from the clinic only around 3000 so I h

[R] Equivalent of Mathematica's Apply

2008-06-24 Thread Juan Pablo Romero Méndez
Hello, Is there some equivalent function in R of Mathematica's "Apply" i.e. Apply[ f, g[a,b]] ==> f[a,b] In concret, I have a matrix of indexes: > ind = cbind(1:5, 1:5+5) > ind [,1] [,2] [1,]16 [2,]27 [3,]38 [4,]49 [5,]5 10 and I'd like to extrac

Re: [R] Error Handling

2008-06-24 Thread jim holtman
?try On Tue, Jun 24, 2008 at 1:59 PM, Sit Yee Kong <[EMAIL PROTECTED]> wrote: > > Hi All, > > The for-loop below stopped when error("Cannot get confidence intervals on > var-cov components: Non-positive definite approximate variance-covariance") > occurred. > I assigned a row of NA values > to t

[R] How to solve empty cells in the contingency table?

2008-06-24 Thread 程燕
Hi,Dear all R experts, I am trying to do the 2-way contingency table analysis by fitting the loglinear models. However, I found my table has several empty cells which are theoretically missing values.I have no idea of how to solve them coz we cannot compute the simulated p-value with zero

[R] running R-code outside of R

2008-06-24 Thread Roger Leenders
R 2.7.0, WinXP Hi list, I have written some code in R that I would like to share with others who are not R-users. Is there a way to compile the code so it will run outside of R? The best thing would be a functionality to compile the code into a ".exe" file that does not require the user to have

[R] Error Handling

2008-06-24 Thread Sit Yee Kong
Hi All, The for-loop below stopped when error("Cannot get confidence intervals on var-cov components: Non-positive definite approximate variance-covariance") occurred. I assigned a row of NA values to the data frame "m1" manually and reset "j" in the for-loop every time error returned. I’m wo

Re: [R] R help

2008-06-24 Thread John Kane
?subset may help. --- On Tue, 6/24/08, Rajasekaramya <[EMAIL PROTECTED]> wrote: > From: Rajasekaramya <[EMAIL PROTECTED]> > Subject: [R] R help > To: r-help@r-project.org > Received: Tuesday, June 24, 2008, 12:27 AM > Hi there, > > I am very new to R.I have to write the code for the > followin

Re: [R] Bar charts with error bars

2008-06-24 Thread John Kane
Does this example help? my.values <- c(10, 5) err1 <- c(.5,.3) x <- barplot(my.values, ylim=c(0,12)) arrows(x,my.values-.5 ,x,my.values+.5, code=3, angle=90, length=.1) box() --- On Tue, 6/24/08, Liat RT <[EMAIL PROTECTED]> wrote: > From: Liat RT <[EMAIL PROTECTED]> > Subject: [R] Bar charts w

[R] spectral filtering

2008-06-24 Thread stephen sefick
I would like to filter using a periodogram produced by spec.pgram() then pick the frequencies that I would like to filter out and then get the inverse back into the time domain. Any thoughts. Stephen -- Let's not spend our time and resources thinking about things that are so little or so large

Re: [R] Fitdistr of a 3 parameter Gamma distribution

2008-06-24 Thread Markus Gesmann
Serguei, You might want to look at the TransformedGamma or InverseTransformedGamma distributions, which are part of the actuar package, see page 41, 25 here: http://cran.r-project.org/web/packages/actuar/actuar.pdf You can then use fitdistr of the MASS package to fit the parameters. Regards, Ma

Re: [R] Elliott's efficient unit root test

2008-06-24 Thread Jorge Ivan Velez
Dear Keli, To be a member of the R mailing list, just go to https://stat.ethz.ch/mailman/listinfo/r-help HTH, Jorge 2008/6/24 Xu, Ke-Li <[EMAIL PROTECTED]>: > Dear Gustaf and Stephen, > > > > The lines work - Thank you very much. "@teststat" is exactly what I want. > > > > I think the forums

[R] Elliott's efficient unit root test

2008-06-24 Thread Xu, Ke-Li
Dear Gustaf and Stephen, The lines work - Thank you very much. $B!H([EMAIL PROTECTED](J is exactly what I want. I think the forums are very helpful. Could you kindly let me know how to be a member since my message was held because of $B!H(JPost by non-member to a members-only list$B

[R] Fitdistr of a 3 parameter Gamma distribution

2008-06-24 Thread Serguei Kaniovski
Hello, how can I fit a three, as opposed to a two parameter Gamma distribution, i.e. one in which "shape" and "rate" are not tied. Thanks, Serguei __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

Re: [R] transform a table into a matrix

2008-06-24 Thread Martin Maechler
> "JohnF" == John Fox <[EMAIL PROTECTED]> > on Tue, 24 Jun 2008 08:10:43 -0400 writes: JohnF> Dear Maria, On 23-Jun-08, at 11:40 PM, Maria JohnF> Gavilanez wrote: >> Hi. >> >> is there a way to transform a table that has numeric and >> categorical variables in

Re: [R] reset row numbers when extracting a subset of a table

2008-06-24 Thread Gabor Grothendieck
I assume that by table you mean data frame. Using the built in data frame, BOD, try this: > ix <- 2:4 > BOD[ix, ] Time demand 22 10.3 33 19.0 44 16.0 > data.frame(BOD[ix, ], row.names = seq_along(ix)) Time demand 12 10.3 23 19.0 34 16.0 On Tue, Jun 24, 20

Re: [R] changing scale range after an axis break

2008-06-24 Thread Ben Bolker
Megan J Bellamy gov.ns.ca> writes: > > Hello, > > I am constructing a boxplot but have a very wide range of values (zero - ~28000). I have placed an axis break at > the 8000 mark but would like to have a different scale above the break that ranges from 8000-28000. ... See gap.plot and axis

[R] persp plot

2008-06-24 Thread Chad Junkermeier
I have a set of data in the form x1, y1, z1 x1, y2, z2 ... x1, yN, zN x2, y1, z(N+1) x2, y2, z(N+2) ... x2, yN, z(2N) ...and so on... xM, yN, val(M*N) I have been trying to figure out how to get R to use this data in a persp plot. So far the only thing that I can figure out to do is to break

Re: [R] reset row numbers when extracting a subset of a table

2008-06-24 Thread Gabor Csardi
Nina, these are not row NUMBERS, but row NAMES. Numbers are actually reset, they always start with 1 and they are continuous. Just try doing T[1,] on your table. If you want to reset row names, you can do this: rownames(T) <- seq(length=nrow(T)) or you can even remove them: rownames(T) <- N

[R] ylab position in levelplot

2008-06-24 Thread steven wilson
is it possible to change the position of the ylab in a lavelplot from the default (left) to the right? thanks sw __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/p

Re: [R] Problem when building a test R package on PC

2008-06-24 Thread Doran, Harold
I don't know the problem per se, but I can say this. In the past, I used the Rossi example and wasn't able to build an R package for Windows. I also explored other resources on the web and came to a similar halt. The only solution for me was to read the R manual and follow the Murdoch instruction

Re: [R] Suppressing output (e.g. from cat)

2008-06-24 Thread Richard Pearson
Many thanks Brian and Hadley, the quiet function works well for me. Maybe a candidate for utils? Best wishes Richard. hadley wickham wrote: Or: tc <- textConnection(NULL, "w") sink(tc) ... sink() close(tc) That is a lot more expensive and subject to o Use of textConnection(NULL, mode=

[R] reset row numbers when extracting a subset of a table

2008-06-24 Thread naw3
Hi I created a new table by extracting only certain rows of table, but the row numbers in my new table correspond to those from the original table. Is there a way to reset the row numbers in my new table so that they start from one? like below: my table: COL1 COL2 17 v 45 18 b

[R] Problem when building a test R package on PC

2008-06-24 Thread Xiaohui Wang
I followed the instruction of building R package on PC by Peter Rossi. I got problem when I tried to build a R package from his example, test.zip. The problem occurs when I tried to R CMD check test the screen stops at D:\Rpackagebuild\Rossi_test>R CMD check test * checking for working pdflate

[R] Bar charts with error bars

2008-06-24 Thread Liat RT
I would like to add error bars to a bar chart, I have created in R. I am able to add error bars to a bar plot, but the same method does not seem to work for my bar chart version.   Is there a way to add error bars to bar charts?

Re: [R] Measuring Goodness of a Matrix

2008-06-24 Thread Marc Schwartz
on 06/24/2008 09:41 AM Gundala Viswanath wrote: Hi all, Suppose I have 2 matrices A and B. And I want to measure how good each of this matrix is. So I intend to compare A and B with another "gold standard" matrix X. Meaning the more similar a matrix to X the better it is. What is the common wa

Re: [R] Measuring Goodness of a Matrix

2008-06-24 Thread Wacek Kusnierczyk
Gundala Viswanath wrote: > Hi all, > > Suppose I have 2 matrices A and B. > And I want to measure how good each of this matrix is. > > So I intend to compare A and B with another "gold standard" > matrix X. Meaning the more similar a matrix to X the better it is. > > What is the common way in R to

[R] Measuring Goodness of a Matrix

2008-06-24 Thread Gundala Viswanath
Hi all, Suppose I have 2 matrices A and B. And I want to measure how good each of this matrix is. So I intend to compare A and B with another "gold standard" matrix X. Meaning the more similar a matrix to X the better it is. What is the common way in R to measure matrix similarity (ie. A vs X, a

Re: [R] insert new columns to a matrix

2008-06-24 Thread Daniel Folkinshteyn
just cbind the cols in the appropriate order: m.2 = cbind( m.1[,1:5], yourthreecolumns, m.1[,6:ncol(m.1)] ) on 06/24/2008 07:02 AM Daren Tan said the following: Instead of prepend or append new columns to a matrix, how to insert them to a matrix ? For example, I would like to insert 3 new column

[R] changing scale range after an axis break

2008-06-24 Thread Megan J Bellamy
Hello, I am constructing a boxplot but have a very wide range of values (zero - ~28000). I have placed an axis break at the 8000 mark but would like to have a different scale above the break that ranges from 8000-28000. Right now my axis is so large that the boxplots are only represented as lin

[R] bug? nls and "[" indexing

2008-06-24 Thread Petr PIKAL
Dear all I just encountered a strange problem with nls formula. I tried to use nls in cycle but I was not successful. I traced the problem to some parse command. Here is an example > DF<-data.frame(x=1:10, y=3*x^.5+rnorm(10)) > coef(lm(log(DF[,2])~log(DF[,1]))) (Intercept) log(DF[, 1]) 0

Re: [R] Coloring Stripchart Points, or Better, Lattice Equivalent

2008-06-24 Thread Bryan Hanson
If anyone remains interested, the solution in base graphics is to modify stripchart.default, the last couple of lines where the coloring of points defaults in a way that depends on groups. In my example, the groups are being handled collectively with the coloring. Code is below. Deepayan has not

Re: [R] two y-axis using ggplot

2008-06-24 Thread Ben Bolker
Thorsten Vogel staff.hu-berlin.de> writes: > Dear List Members > > As a relatively new R user I am extremely glad for there being a nice > tool such as ggplot for producing easily nice graphs in R. Now I want to > produce graphs with two y-axis. I know that this has been asked a > hundred time

Re: [R] Suppressing output (e.g. from cat)

2008-06-24 Thread hadley wickham
>> Or: >> >> tc <- textConnection(NULL, "w") >> sink(tc) >> ... >> sink() >> close(tc) > > That is a lot more expensive and subject to > >o Use of textConnection(NULL, mode="w") could segfault. > > (NEWS for 2.7.1). Output textConnections are convenient, but have quite a > lot of overhead si

Re: [R] glibc detected error

2008-06-24 Thread pqs
On Tue, 24 Jun 2008 11:50:44 +0100 (BST), Prof Brian Ripley <[EMAIL PROTECTED]> wrote: >Some compiled code used by your script screwed up the memory allocator, directly or indirectly. But we have no idea what is in 'run.R', and little about your OS, version of R ... see the posting guide.

Re: [R] Suppressing output (e.g. from cat)

2008-06-24 Thread Prof Brian Ripley
On Tue, 24 Jun 2008, hadley wickham wrote: On Tue, Jun 24, 2008 at 1:15 PM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: On Tue, 24 Jun 2008, Richard Pearson wrote: Wacek, many thanks! I'm wondering however whether this will be problematic on Windows (I have no windows box to hand to check th

Re: [R] transform a table into a matrix

2008-06-24 Thread John Fox
Dear Maria, On 23-Jun-08, at 11:40 PM, Maria Gavilanez wrote: Hi. is there a way to transform a table that has numeric and categorical variables into a matrix? No, because all of the elements of a matrix must be of the same mode, but a dataframe is a data structure that can have heteroge

Re: [R] Suppressing output (e.g. from cat)

2008-06-24 Thread hadley wickham
On Tue, Jun 24, 2008 at 1:15 PM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Tue, 24 Jun 2008, Richard Pearson wrote: > >> Wacek, many thanks! I'm wondering however whether this will be problematic >> on Windows (I have no windows box to hand to check this, but am creating a >> package that I

[R] sparse matrix and block of R

2008-06-24 Thread alessia matano
Dear all, I am writing you for two problems I can not solve with R. I used both the 2.6.1 version and the 2.7.0 version. I run a sintax written by a collegue of mine, where there are involved both sparse matrix and quantile estimations. My data begins with 10008*14 observations and at maximum they

Re: [R] insert new columns to a matrix

2008-06-24 Thread Henrique Dallazuanna
Try something like this: m <- matrix(1:20, ncol = 5) cbind(m[, 1:3], matrix(1:16, ncol = 4), m[,4:ncol(m)]) On Tue, Jun 24, 2008 at 8:02 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > Instead of prepend or append new columns to a matrix, how to insert them to > a matrix ? For example, I would like

Re: [R] Suppressing output (e.g. from cat)

2008-06-24 Thread Prof Brian Ripley
On Tue, 24 Jun 2008, Richard Pearson wrote: Wacek, many thanks! I'm wondering however whether this will be problematic on Windows (I have no windows box to hand to check this, but am creating a package that I would like to be cross-platform)? It will fail. But sink(tempfile()) ... sink() i

Re: [R] subscripting in data frames with NA

2008-06-24 Thread Prof Brian Ripley
On Tue, 24 Jun 2008, Agustin Lobo wrote: Dear list: Given str(b3) 'data.frame': 159 obs. of 6 variables: $ index_pollution : num 8.228 10.513 0.549 0.915 10.416 ... $ position_descrip: chr "2" "2" "2" NA ... $ position_geo: chr "3" "0" "3" "3" ... $ institution : Factor w/ 3

[R] Using Huge Pages for R

2008-06-24 Thread subramanian R
Hi all, My application usually works on huge amounts of data in the size of MB's .So the performance of "R" in this case will increase if Huge pages are used instead of malloc'ing (as in memory.c) . So Are there any methods to support Huge Pages in "R" ? Can any one give some inputs to help me impl

Re: [R] L-BFGS-B needs finite values of 'fn'

2008-06-24 Thread Prof Brian Ripley
On Tue, 24 Jun 2008, Jinsong Zhao wrote: Another question related with the same code: r <- c(3,4,4,3,5,4,5,9,8,11,12,13) n <- rep(15,12) x <- c(0, 1.1, 1.3, 2.0, 2.2, 2.8, 3.7, 3.9, 4.4, 4.8, 5.9, 6.8) x <- log10(x) fr <- function(c, alpha, beta) { P <- c + (1-c) * pnorm(alpha + beta * x)

[R] insert new columns to a matrix

2008-06-24 Thread Daren Tan
Instead of prepend or append new columns to a matrix, how to insert them to a matrix ? For example, I would like to insert 3 new columns after the 5th column of matrix m. _ [[elided Hotmail spam]] [[alternative HTML versio

Re: [R] subscripting in data frames with NA

2008-06-24 Thread Peter Dalgaard
Agustin Lobo wrote: > Dear list: > > Given > > str(b3) > 'data.frame':159 obs. of 6 variables: > $ index_pollution : num 8.228 10.513 0.549 0.915 10.416 ... > $ position_descrip: chr "2" "2" "2" NA ... > $ position_geo: chr "3" "0" "3" "3" ... > $ institution : Factor w/ 3 le

Re: [R] Suppressing output (e.g. from cat)

2008-06-24 Thread Richard Pearson
Wacek, many thanks! I'm wondering however whether this will be problematic on Windows (I have no windows box to hand to check this, but am creating a package that I would like to be cross-platform)? Richard. Wacek Kusnierczyk wrote: Richard Pearson wrote: Is it possible to temporarily suspen

Re: [R] L-BFGS-B needs finite values of 'fn'

2008-06-24 Thread Jinsong Zhao
Another question related with the same code: r <- c(3,4,4,3,5,4,5,9,8,11,12,13) n <- rep(15,12) x <- c(0, 1.1, 1.3, 2.0, 2.2, 2.8, 3.7, 3.9, 4.4, 4.8, 5.9, 6.8) x <- log10(x) fr <- function(c, alpha, beta) { P <- c + (1-c) * pnorm(alpha + beta * x) P <- pmax(pmin(P,1),0) -(sum(log(choose(n

Re: [R] R help

2008-06-24 Thread stephen sefick
A comment from the peanut gallery- It is always good to write an explicative title because it facilitates searching in the forums. thanks Stephen On Tue, Jun 24, 2008 at 6:49 AM, Gustaf Rydevik <[EMAIL PROTECTED]> wrote: > dear Xu, > > does: > >library(urca) > >example(ur.ers) > >ers.gnp > >str(

[R] two y-axis using ggplot

2008-06-24 Thread Thorsten Vogel
Dear List Members As a relatively new R user I am extremely glad for there being a nice tool such as ggplot for producing easily nice graphs in R. Now I want to produce graphs with two y-axis. I know that this has been asked a hundred times with respect to standard plots in R. (The answer, to

[R] subscripting in data frames with NA

2008-06-24 Thread Agustin Lobo
Dear list: Given > str(b3) 'data.frame': 159 obs. of 6 variables: $ index_pollution : num 8.228 10.513 0.549 0.915 10.416 ... $ position_descrip: chr "2" "2" "2" NA ... $ position_geo: chr "3" "0" "3" "3" ... $ institution : Factor w/ 3 levels "digesa","mem",..: 3 3 3 3 3 3

Re: [R] glibc detected error

2008-06-24 Thread Prof Brian Ripley
On Tue, 24 Jun 2008, pqs wrote: Hello, Today I run a R script that I didn't use for a while (one or two months) and I got an error which I don't understand. source("run.R") *** glibc detected *** double free or corruption (!prev): 0x0809ea98 *** Abandon (core dumped) Does anybod

Re: [R] R help

2008-06-24 Thread Gustaf Rydevik
dear Xu, does: >library(urca) >example(ur.ers) >ers.gnp >str(ers.gnp) >[EMAIL PROTECTED] ,do what you want? (this reminds me that I have to learn S4 sometime) best, Gustaf Rydevik On Tue, Jun 24, 2008 at 3:52 AM, Xu, Ke-Li <[EMAIL PROTECTED]> wrote: > Dear Sir/Madam, > > I found your email ad

Re: [R] L-BFGS-B needs finite values of 'fn'

2008-06-24 Thread Prof Brian Ripley
On Tue, 24 Jun 2008, Jinsong Zhao wrote: Hi, When I run the following code, r <- c(3,4,4,3,5,4,5,9,8,11,12,13) n <- rep(15,12) x <- c(0, 1.1, 1.3, 2.0, 2.2, 2.8, 3.7, 3.9, 4.4, 4.8, 5.9, 6.8) x <- log10(x) So x[1] = -Inf fr <- function(c, alpha, beta) { P <- c + (1-c) * pnorm(alpha + beta

Re: [R] Suppressing output (e.g. from cat)

2008-06-24 Thread Wacek Kusnierczyk
Richard Pearson wrote: > Is it possible to temporarily suspend output? I am using a function > that gives lots of output using cat, that is not very informative. Is > it possible to turn output off, run the function, then turn output > back on again? I've looked at ?options and done various RSiteSe

Re: [R] loop with files

2008-06-24 Thread Wacek Kusnierczyk
Alfredo Alessandrini wrote: >> can you *explain* what the goal is? >> > > I want import any rwl files (cimfasy.rwl, rocquce.rwl, ...), in a > data.frame with the name like to name of file rwl: > > cimfasy.rwl -> cimfasy > > rocquce.rwl -> rocquce > > with this loop: > > >> library(dplR

[R] Suppressing output (e.g. from cat)

2008-06-24 Thread Richard Pearson
Is it possible to temporarily suspend output? I am using a function that gives lots of output using cat, that is not very informative. Is it possible to turn output off, run the function, then turn output back on again? I've looked at ?options and done various RSiteSearch()s but couldn't find a

Re: [R] loop with files

2008-06-24 Thread Wacek Kusnierczyk
Alfredo Alessandrini wrote: > I'm trying to make a loop with many files... > > > >> library(dplR) >> >> files <- system("ls *.rwl", intern=TRUE) >> >> files >> > [1] "cimfasy.rwl" "rocquce.rwl" > >> for (i in files) {a <- read.rwl(i,header=0)} >> > There are 70 series > There are 21

[R] L-BFGS-B needs finite values of 'fn'

2008-06-24 Thread Jinsong Zhao
Hi, When I run the following code, r <- c(3,4,4,3,5,4,5,9,8,11,12,13) n <- rep(15,12) x <- c(0, 1.1, 1.3, 2.0, 2.2, 2.8, 3.7, 3.9, 4.4, 4.8, 5.9, 6.8) x <- log10(x) fr <- function(c, alpha, beta) { P <- c + (1-c) * pnorm(alpha + beta * x) P <- pmax(pmin(P,1),0) -(sum(log(choose(n,r))) + sum

[R] loop with files

2008-06-24 Thread Alfredo Alessandrini
I'm trying to make a loop with many files... > library(dplR) > > files <- system("ls *.rwl", intern=TRUE) > > files [1] "cimfasy.rwl" "rocquce.rwl" > for (i in files) {a <- read.rwl(i,header=0)} There are 70 series There are 21 series > class(a) [1] "data.frame" This loop import all the files r

[R] glibc detected error

2008-06-24 Thread pqs
Hello, Today I run a R script that I didn't use for a while (one or two months) and I got an error which I don't understand. >> source("run.R") > *** glibc detected *** double free or corruption (!prev): 0x0809ea98 *** > Abandon (core dumped) Does anybody have a clue about the possible

  1   2   >