[R] Inverse of FAQ 7.31.

2011-08-01 Thread Rolf Turner
Why does R think these numbers ***are*** equal? In a somewhat bizarre set of circumstances I calculated x0 <- 0.03580067 x1 <- 0.03474075 y0 <- 0.4918823 y1 <- 0.4474461 dx <- x1 - x0 dy <- y1 - y0 xx <- (x0 + x1)/2 yy <- (y0 + y1)/2 chk <- yy*dx - xx*dy + x

Re: [R] how to control to save plots to which dev

2011-08-01 Thread Prof Brian Ripley
On Tue, 2 Aug 2011, David Winsemius wrote: On Aug 1, 2011, at 11:14 PM, zhenjiang xu wrote: Hi, I have a for loop to make 2 types of plots and I'd like to save one type of plots to a pdf file and the other to another pdf file. How can I control which plot will be saved to which pdf? Thanks

Re: [R] going past restrictions on number of elements

2011-08-01 Thread Prof Brian Ripley
On Mon, 1 Aug 2011, Paul Rodriguez wrote: Hello R experts, I'm trying to test R in a shared memory environment in which addressable memory is aggregrated to about 600G. However, I get an error of 'too many elements' specified when I try creating a 45K x 100K matrix. I tried running R with a

Re: [R] how to control to save plots to which dev

2011-08-01 Thread David Winsemius
On Aug 1, 2011, at 11:14 PM, zhenjiang xu wrote: Hi, I have a for loop to make 2 types of plots and I'd like to save one type of plots to a pdf file and the other to another pdf file. How can I control which plot will be saved to which pdf? Thanks Why not give them file names that identify t

Re: [R] if function problems

2011-08-01 Thread zoe_zhang
David, I'm so appreciate! Sincerely, Zoe -- View this message in context: http://r.789695.n4.nabble.com/if-function-problems-tp3710995p3711062.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://s

Re: [R] going past restrictions on number of elements

2011-08-01 Thread Paul Rodriguez
Hello R experts, I'm trying to test R in a shared memory environment in which addressable memory is aggregrated to about 600G. However, I get an error of 'too many elements' specified when I try creating a 45K x 100K matrix. I tried running R with a --max-nsize=500 option, but got the

Re: [R] how to control to save plots to which dev

2011-08-01 Thread Jeff Newmiller
Simplest to make two consecutive loops. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Co

[R] how to control to save plots to which dev

2011-08-01 Thread zhenjiang xu
Hi, I have a for loop to make 2 types of plots and I'd like to save one type of plots to a pdf file and the other to another pdf file. How can I control which plot will be saved to which pdf? Thanks -- Best, Zhenjiang __ R-help@r-project.org mailing l

Re: [R] Plotting question

2011-08-01 Thread Indrajit Sengupta
Why can't you simply draw a 3 - D plot. The third variable being categorical can expressed as a bar. Regards, Indrajit From: Andrew McCulloch To: r-help@r-project.org Sent: Monday, August 1, 2011 3:14 PM Subject: [R] Plotting question Hi, I use R to draw my

Re: [R] Is R the right choice for simulating first passage times of random walks?

2011-08-01 Thread Paul Menzel
Am Montag, den 01.08.2011, 12:43 -0400 schrieb R. Michael Weylandt : > I've only got a 20 minute layover, but three quick remarks: > > 1) Do a sanity check on your data size: if you want a million walks of > a thousand steps, that already gets you to a billion integers to > store--even at a very l

Re: [R] if function problems

2011-08-01 Thread Steve Lianoglou
In addition to what David said: On Mon, Aug 1, 2011 at 6:57 PM, zoe_zhang <1987.zhan...@gmail.com> wrote: > Dear All, > Sorry to bother > I want to write a function in R using if > Say I have a dataset x, > if x[i]<0, then x[i]=x[i], > if x[i]>0, then x[i]=0 > > for example, x=-3:3, > then using t

Re: [R] zero truncated poisson regression

2011-08-01 Thread Achim Zeileis
On Mon, 1 Aug 2011, Iasonas Lamprianou wrote: Thank you, it works! And the estimates (as well as the standard errors) seem to be more reasonable now, compared to the "normal" Poisson model. Thank you. However, I tried to find a manual? (although I did manage to find the paper published in the

Re: [R] if function problems

2011-08-01 Thread David Winsemius
On Aug 1, 2011, at 6:57 PM, zoe_zhang wrote: Dear All, Sorry to bother I want to write a function in R using if Say I have a dataset x, if x[i]<0, then x[i]=x[i], if x[i]>0, then x[i]=0 for example, x=-3:3, then using the function, x becomes [-3,-2,-1,0,0,0,0] Just use logical indexing x[ x>

Re: [R] fill Matrix quicker

2011-08-01 Thread peter dalgaard
On Aug 1, 2011, at 20:12 , monk wrote: > dear all, > > i have a quite simple question, i want to fill up a Matrix like done in the > following function, > but the performance is very bad for large dimensions > is there a way to do this like with apply or something similar? > > > makeMatrix <-

[R] if function problems

2011-08-01 Thread zoe_zhang
Dear All, Sorry to bother I want to write a function in R using if Say I have a dataset x, if x[i]<0, then x[i]=x[i], if x[i]>0, then x[i]=0 for example, x=-3:3, then using the function, x becomes [-3,-2,-1,0,0,0,0] I write the codes as follows, gjr=function(x) {lena=length(x) for(i in 1:lenx)

[R] GLMNET ERROR

2011-08-01 Thread Jeff Allard
Hi All, I am looking for some help figuring out what is causing an error in my attempt to fit a regularized logistic regression (specifically finding the optimal lambda value using cv.glmnet). Running the following command: RegLR_CV<-cv.glmnet(x=train.sub.clean[,-c(431)],y=as.factor(train.sub$fi

Re: [R] Plotting question

2011-08-01 Thread Bert Gunter
Well stated, Duncan, and I plead guilty, though I did try to weasel out with caveats. Perhaps I may plead down to a lesser sentence or probation by saying that I was offering what I still believe to be appropriate advice for a general strategy for handling this sort of plotting issue; but that as

Re: [R] fitting a sinus curve

2011-08-01 Thread Marianne.ZEYRINGER
Dear all, Thanks again for your help. I looked at a polynomial regression of 12th order and the sinus regression and to me the polynomial model seems to fit better. What do you think? Thanks a lot, Mariannne time <- c(0.15,0.30,0.45,1.00,1.15,1.30,1.45,2.00,2.15,2.30,2.45,3.00,3.15,3.30,3.45

Re: [R] Errors, driving me nuts

2011-08-01 Thread Ista Zahn
Hi Matt, On Mon, Aug 1, 2011 at 4:47 PM, Matt Curcio wrote: > Greetings all, > I am getting this error that is driving me nuts... (not a long trip, haha) > > I have a set of files and in these files I want to calculate ttests on > rows 'compareA' and 'compareB' (these will change over time there

Re: [R] Identifying US holidays

2011-08-01 Thread Dimitri Liakhovitski
To be specific, I only need to get rid of 2 NYSE holidays: Washington's Birthday and Good Friday. Is there a way to reduce the vector of NYSE holidays in timeDate by throwing out those two? Thank you! Dimitri On Mon, Aug 1, 2011 at 4:24 PM, R. Michael Weylandt wrote: > Don't know if this is suff

Re: [R] Plotting question

2011-08-01 Thread Duncan Murdoch
On 11-08-01 11:48 AM, Bert Gunter wrote: IMHO: On Mon, Aug 1, 2011 at 7:51 AM, Duncan Murdoch wrote: On 11-08-01 5:44 AM, Andrew McCulloch wrote: Hi, I use R to draw my graphs. I have 100 points on a simple xy-plot. The points are distinguished by a third variable which is categorical with

[R] Errors, driving me nuts

2011-08-01 Thread Matt Curcio
Greetings all, I am getting this error that is driving me nuts... (not a long trip, haha) I have a set of files and in these files I want to calculate ttests on rows 'compareA' and 'compareB' (these will change over time there I want a variable here). Also these files are in many different directo

Re: [R] Identifying US holidays

2011-08-01 Thread R. Michael Weylandt
Don't know if this is sufficiently slick for this list (which never fails to impress me with quick and elegant solutions) but I would point out to you that GF is the only NYSE holiday falling in March or April so it shouldn't be hard to discard it if desired. Michael Weylandt On Aug 1, 2011,

Re: [R] Identifying US holidays

2011-08-01 Thread Dimitri Liakhovitski
Just to clarify - I realize that "major" is subjective here. Maybe I should say "most common". But maybe there is a way for me to select from a list of all NYSE holidays and flag only some of them? Just not sure how to do it... Thanks! Dimitri On Mon, Aug 1, 2011 at 3:45 PM, Dimitri Liakhovitski

Re: [R] error in self-made function - cannot deal with objects of length = 1

2011-08-01 Thread R. Michael Weylandt
But if you do mean to divide by max(x), I'll also vote for the prior ROI <- function(x) { if (length(x)==1) return(NA) r=c(x[1], diff(x))/max(x) return(r)} As being about as quick and elegant as this can be done in R. M On Aug 1, 2011, at 4:07 PM, "R. Michael Weylandt " wrote: > Just jumpin

Re: [R] error in self-made function - cannot deal with objects of length = 1

2011-08-01 Thread bjmjarrett
> But why not just > c(x[1], diff(x))/max(x) So simple! Thank you ever so much Berend. Best wishes, Ben -- View this message in context: http://r.789695.n4.nabble.com/error-in-self-made-function-cannot-deal-with-objects-of-length-1-tp3710555p3710646.html Sent from the R help mailing list a

Re: [R] error in self-made function - cannot deal with objects of length = 1

2011-08-01 Thread R. Michael Weylandt
Just jumping into this, but does the ROC(x, type="discrete") function of either the TTR or caTools (can't remember which) work if you need a prebuilt function? Also, why are you dividing by the max value? That seems a funny way to calculate ROC... On Aug 1, 2011, at 3:14 PM, bjmjarrett wrote:

Re: [R] 5 arguments passed to .Internal(matrix) which requires 7

2011-08-01 Thread Robert Pfister
It looks like I had been missing an update needed for Ubuntu systems. All I needed was the following. Thank you. update.packages(lib.loc = "/usr/local/lib/R/site-library") On Mon, Aug 1, 2011 at 2:39 PM, Jean V Adams wrote: > > That's interesting. My function matrix() looks like this: > > fun

[R] error in self-made function - cannot deal with objects of length = 1

2011-08-01 Thread bjmjarrett
I have a function to calculate the rate of increase (the difference between the value and the previous value divided by the total number of eggs in a year) of egg production over the course of a year: rate <- function(x){ storage <- matrix(nrow=length(x),ncol=1) storage[1,] <- x[1] /

Re: [R] fill Matrix quicker

2011-08-01 Thread monk
thanks a lot , that will do the trick -- View this message in context: http://r.789695.n4.nabble.com/fill-Matrix-quicker-tp3710428p3710533.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.e

[R] Error while trying to install a package

2011-08-01 Thread Sushil Amirisetty
Hi Everyone, When i try to install a package using > install.packages("agricolae") --- Please select a CRAN mirror for use in this session --- | The cursor keeps blinking i dont get a popup menu to choose a CRAN mirror? Is it due to my proxy server settings? I tried to echo $http_proxy ,

Re: [R] example package for devel newcomers

2011-08-01 Thread Brian Diggs
On 7/31/2011 6:24 PM, Alexandre Aguiar wrote: Em Domingo 31 Julho 2011, você escreveu: My memory is that this question gets asked every few months and one of the stock answers is to use the function 'package.skeleton' in the utils package as a starting point. Got that from docs. And actually I

Re: [R] error in self-made function - cannot deal with objects of length = 1

2011-08-01 Thread Berend Hasselman
bjmjarrett wrote: > > ... > rate <- function(x){ > storage <- matrix(nrow=length(x),ncol=1) > ifelse(length(x)==1,storage[1,] <- NA,{ > storage[1,] <- x[1]/max(x) > for(i in 2:length(x)){ > p <- i-1 > storage[i,] <- ((x[i] - x[p]) / max(x)) >

[R] Identifying US holidays

2011-08-01 Thread Dimitri Liakhovitski
Hello! I am trying to identify which ones of a vector of dates are US holidays. And, ideally, which is which. And I do not know (a-priori) which dates those should be. I have, for example: x<-seq(as.Date("2011-01-01"),as.Date("2011-12-31"),by="day") (x) I think chron should help me here - but ma

Re: [R] Inserting column in between -- "better" way?

2011-08-01 Thread David L Carlson
Actually Sara's method fails if the insertion is after the first or before the last column: >x <- data.frame(A=1:3, B=1:3, C=1:3, D=1:3, E=1:3) >newcol <- 4:6 >cbind(x[,1], newcol, x[,2:ncol(x)]) x[, 1] newcol B C D E 1 1 4 1 1 1 1 2 2 5 2 2 2 2 3 3 6 3 3 3 3 > cbi

Re: [R] fill Matrix quicker

2011-08-01 Thread Patrick Burns
Most certainly you can speed it up: X <- exp(-abs(row(X) - col(X)) / (3*b)) diag(X) <- a should do what you want. This is called 'vectorization' and is discussed lots of places -- for instance, in the two documents mentioned below in my signature. On 01/08/2011 19:12, monk wrote: dear all,

Re: [R] 5 arguments passed to .Internal(matrix) which requires 7

2011-08-01 Thread Jean V Adams
That's interesting. My function matrix() looks like this: function (data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL) { if (is.object(data) || !is.atomic(data)) data <- as.vector(data) .Internal(matrix(data, nrow, ncol, byrow, dimnames, missing(nrow), missi

Re: [R] 5 arguments passed to .Internal(matrix) which requires 7

2011-08-01 Thread Robert Pfister
Yes, even if I only run the command matrix(0,30,10) I get the error. I am running R with Ubuntu 10.10 (maverick) with R version: R version 2.13.1 (2011-07-08) When I check the function matrix, I can see that it is only passing five arguments to the function .Internal() (shown below). function (

Re: [R] fill Matrix quicker

2011-08-01 Thread Jean V Adams
Making use of the row() and col() functions speeds things up a bit. makeMatrix2 <- function(a, b, dim) { X <- matrix(NA, ncol=dim, nrow=dim) X <- exp( (-1*abs(row(X) - col(X)))/(3*b) ) diag(X) <- a X } system.time(makeMatrix(1, 2, 1000)) system.time(makeMat

Re: [R] error message jpeg62.dll missing

2011-08-01 Thread Prof Brian Ripley
See the footer of this and every R-help message. In particular, that DLL is not used by R itself, so this is probably something called from a third-party package. A number of packages used to use that DLL (which is rather out of date), but no longer, so is your R actually current (the posting

[R] fill Matrix quicker

2011-08-01 Thread monk
dear all, i have a quite simple question, i want to fill up a Matrix like done in the following function, but the performance is very bad for large dimensions is there a way to do this like with apply or something similar? makeMatrix <- function(a, b,dim) { X=matrix(0,ncol=dim,nrow=dim)

Re: [R] Inserting column in between

2011-08-01 Thread Bert Gunter
Thanks Sarah and David. Yes, but note this: > z <- data.frame(a=1:2,b=3:4) > z a b 1 1 3 2 2 4 > newdat <- 5:6 > cbind(z[,1],newdat,z[,2]) newdat [1,] 1 5 3 [2,] 2 6 4 > cbind.data.frame(z[,1],newdat,z[,2]) z[, 1] newdat z[, 2] 1 1 53 2 2 6

Re: [R] Accessing the index of factor in by() function

2011-08-01 Thread Sarah Goslee
Merik, You did get an answer to the question, and it's even included in the material below. What doesn't work for you in Ista's suggestion? id<- c(1,1,1,1,1,2,2,2,3,3,3) month <- c(1, 1, 2, 3, 6, 2, 3, 6, 1, 3, 5) value <- c(10, 12, 11, 14, 16, 12, 10, 8, 14, 11, 15) dat.tmp <- data.frame(id

Re: [R] Inserting column in between -- "better" way?

2011-08-01 Thread Ista Zahn
On Mon, Aug 1, 2011 at 1:43 PM, Sarah Goslee wrote: > Bert, > > On Mon, Aug 1, 2011 at 1:27 PM, Bert Gunter wrote: >> Folks: >> >> I consider my reply below rather clumsy: One has to keep track of >> index numbers other than that which is inserted and must separately >> change column names. Is th

Re: [R] Inserting column in between -- "better" way?

2011-08-01 Thread Sarah Goslee
Bert, On Mon, Aug 1, 2011 at 1:27 PM, Bert Gunter wrote: > Folks: > > I consider my reply below rather clumsy: One has to keep track of > index numbers other than that which is inserted and must separately > change column names. Is there as "essentially better" way to do this, > either via base R

Re: [R] Inserting column in between

2011-08-01 Thread Sarah Goslee
Bert, On Mon, Aug 1, 2011 at 1:17 PM, Bert Gunter wrote: > Doesn't work -- you lose column names. But I don't lose column names: > x <- data.frame(A=1:3, B=1:3, C=1:3, D=1:3, E=1:3) > x A B C D E 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 > newcol <- 4:6 > cbind(x[,1:2], newcol, x[,3:ncol(x)]) A B

Re: [R] Inserting column in between

2011-08-01 Thread David L Carlson
Not when I do it. > a <- data.frame(A=1:10, B=11:20, D=31:40, E=41:50) > a A B D E 1 1 11 31 41 2 2 12 32 42 3 3 13 33 43 4 4 14 34 44 5 5 15 35 45 6 6 16 36 46 7 7 17 37 47 8 8 18 38 48 9 9 19 39 49 10 10 20 40 50 > b <- cbind(a[,1:2], C=21:30, a[,3:4]) > b A B C D

Re: [R] Accessing the index of factor in by() function

2011-08-01 Thread Merik Nanish
Since I didn't get an answer to this question, I'm rephrasing my question in simpler terms: I have a dataframe and I want to split it based on the levels of one of its columns, and apply a function to each section of the data. Output of the function may be drawing a plot, returning a value, what

Re: [R] Inserting column in between -- "better" way?

2011-08-01 Thread Bert Gunter
Folks: I consider my reply below rather clumsy: One has to keep track of index numbers other than that which is inserted and must separately change column names. Is there as "essentially better" way to do this, either via base R or via an R package. I leave it to you to define "essentially better.

Re: [R] Plotting problems directional or rose plots

2011-08-01 Thread David L Carlson
Searching R Graphical Manual (http://www.oga-lab.net/RGM2/, mirror http://www.oga-lab.net/RGM2/) shows possible candidates in packages circular (windrose), IDPmisc (plot.rose), climatol (rosavent), openair (windRose), and oce (as.windrose). -- David L Ca

Re: [R] Inserting column in between

2011-08-01 Thread Bert Gunter
Doesn't work -- you lose column names. Try this instead: yourframe[,30:51] <- cbind( newcolumn,yourframe[,30:50]) Adjust column names after via: names(yourframe) [30:51] <- c(newcolname,names(yourframe[30:50]) Cheers, Bert On Mon, Aug 1, 2011 at 10:10 AM, Sarah Goslee wrote: > x <- cbind(x[,

Re: [R] Limited number of principal components in PCA

2011-08-01 Thread David L Carlson
Providing the data will help, but the first thing I noted is that you have more columns (variables) than rows (cases). PCA will return a maximum of (the number of columns) or (the number of rows-1) whichever is less. With 84 columns and 66 rows means you can get no more than 65 components. If th

Re: [R] Inserting column in between

2011-08-01 Thread Sarah Goslee
x <- cbind(x[,1:29], newcolumn, x[,30:ncol(x)]) On Mon, Aug 1, 2011 at 12:59 PM, Bansal, Vikas wrote: > Dear all, > > I have a very simple question.I have data frame of 50 columns and i want to > insert a column in 30th position.But i do not want to delete that column.Is > it possible to includ

Re: [R] 5 arguments passed to .Internal(matrix) which requires 7

2011-08-01 Thread Jeff Newmiller
Y'know, you aren't likely to get many responses with this kind of request. Why don't you go read the posting guidelines and come back with: R version info Sample data Actual commands used, so we can reproduce the problem ---

Re: [R] 5 arguments passed to .Internal(matrix) which requires 7

2011-08-01 Thread Jean V Adams
Robert, What code did you run to get that error? Do you get the error if the only code that you run is ... matrix(0, 30, 10) You gave three arguments to matrix, which requires none, but can take up to five. In the function matrix there is a call to .Internal(matrix) which requires 7 argum

[R] Inserting column in between

2011-08-01 Thread Bansal, Vikas
Dear all, I have a very simple question.I have data frame of 50 columns and i want to insert a column in 30th position.But i do not want to delete that column.Is it possible to include a column in between, so that new values are in 30th column and 30 th column is now 31st and 31st is 32nd..

[R] 5 arguments passed to .Internal(matrix) which requires 7

2011-08-01 Thread Robert Pfister
Hello, I am having a problem with the function matrix. Specifically, when I pass three arguments (two more being instantiated in the function), I get the following error message: Error in matrix(0, 30, 10) : 5 arguments passed to .Internal(matrix) which requires 7 I looked into it, and someon

Re: [R] Impact of multiple imputation on correlations

2011-08-01 Thread Joshua Wiley
Hi Tina, That is quite a bit of missingness, especially considering the sample size is not large to begin with. This would make me treat *any* result cautiously. That said, if you have a reasonable idea what the mechanism causing the missingness is or if from additional variables in your study,

Re: [R] possible reason for merge not working

2011-08-01 Thread world peace
the answer was indeed in subtle differences, and 'str' did help. Problem is solved. Thanks everybody for comments which was all very useful. Best, On Mon, Aug 1, 2011 at 12:25 PM, jim holtman wrote: > What you "see" and what the data really is may be two different > things.  You should have at

Re: [R] Is R the right choice for simulating first passage times of random walks?

2011-08-01 Thread R. Michael Weylandt
I've only got a 20 minute layover, but three quick remarks: 1) Do a sanity check on your data size: if you want a million walks of a thousand steps, that already gets you to a billion integers to store--even at a very low bound of one byte each, thats already 1GB for the data and you still have

Re: [R] possible reason for merge not working

2011-08-01 Thread David Winsemius
On Aug 1, 2011, at 12:17 PM, world peace wrote: Hi Guys, working on a "merge" for 2 data frames. Using the command: x <- merge(annotatedData, UCSCgenes, by.x="names", by.y="Ensembl.Gene.ID", all.x=TRUE) names and Ensembl.Gene.ID are columns with similar elements from the x and y data frames

Re: [R] possible reason for merge not working

2011-08-01 Thread Jean V Adams
Dan, If the variables you are merging by are character variables, there may be subtle differences that you haven't noticed, e.g., capitalization or spacing. You can look for differences by listing off the unique values: table(c(annotatedData$names, UCSCgenes$Ensembl.Gene.ID)) Jean `·.,, ><

Re: [R] possible reason for merge not working

2011-08-01 Thread jim holtman
What you "see" and what the data really is may be two different things. You should have at least enclosed an 'str' of the two data frames; even better would be a subset of the data using 'dput'. Most likely your problem is that your data is not what you 'expect' it to be. On Mon, Aug 1, 2011 at

Re: [R] Reorganize(stack data) a dataframe inducing names

2011-08-01 Thread jim holtman
Try this: had to add extra names to your data since it was not clear how it was organized. Next time use 'dput' to enclose data. > x <- read.table(textConnection(" index time key date values + 13732 27965 DATA.Q211.SUM.Index04/08/11 1.42 + 13733 27974 DATA.Q211.SUM.Index

[R] How to make a nomogam and Calibration plot

2011-08-01 Thread sytangping
Dear R users, I am a new R user and something stops me when I try to write a academic article. I want to make a nomogram to predict the risk of prostate cancer (PCa) using several factors which have been selected from the Logistic regression run under the SPSS. Always, a calibration plot is needed

[R] possible reason for merge not working

2011-08-01 Thread world peace
Hi Guys, working on a "merge" for 2 data frames. Using the command: x <- merge(annotatedData, UCSCgenes, by.x="names", by.y="Ensembl.Gene.ID", all.x=TRUE) names and Ensembl.Gene.ID are columns with similar elements from the x and y data frames. annotatedData has 8909 entries, so has x(as expec

Re: [R] How to make a nomogam and Calibration plot

2011-08-01 Thread Frank Harrell
Kindly do not attach questions in a separate document. Install and read the documentation for the R rms package, and see handouts at http://biostat.mc.vanderbilt.edu/rms Frank sytangping wrote: > > Dear R users, > > I am a new R user and something stops me when I try to write a academic > arti

Re: [R] Write.table Question

2011-08-01 Thread Ivan Calandra
Hi Margaux, Check the row.names and col.names arguments of write.table. See ?write.table write.table (dat, file = "/path/to/my/data.txt", sep = " ", col.names=FALSE, row.names=FALSE) HTH, Ivan Le 8/1/2011 17:18, Margaux Keller a écrit : Hi, I'm trying to create an abbreviated data file fr

Re: [R] General indexing in multidimensional arrays

2011-08-01 Thread Gene Leynes
What do you think about this? apply(data, 3, '[', indices) On Mon, Aug 1, 2011 at 4:38 AM, Jannis wrote: > Dear R community, > > > I have a general question regarding indexing in multidiemensional arrays. > > Imagine I have a three dimensional array and I only want to extract on > vector along

Re: [R] Plotting question

2011-08-01 Thread Bert Gunter
IMHO: On Mon, Aug 1, 2011 at 7:51 AM, Duncan Murdoch wrote: > On 11-08-01 5:44 AM, Andrew McCulloch wrote: >> >> Hi, >> >> I use R to draw my graphs. I have 100 points on a simple xy-plot. The >> points are >> distinguished by a third variable which is categorical with 10 levels. I >> have >> bee

Re: [R] Problem with gam() after R update

2011-08-01 Thread David Winsemius
On Aug 1, 2011, at 5:01 AM, Przemek Jura wrote: Dear group, I experience some problems with gam() function after R update to version 2.13.1 The function in both gam and mgcv packages stopped to work. Before, with the same code I used, everything was fine. Reports like this often turn out

[R] 5 arguments passed to .Internal(matrix) which requires 7

2011-08-01 Thread Robert Pfister
Hello, I am having a problem with the function matrix. Specifically, when I pass three arguments (two more being instantiated in the function), I get the following error message: Error in matrix(0, 30, 10) : 5 arguments passed to .Internal(matrix) which requires 7 I looked into it, and someon

[R] Write.table Question

2011-08-01 Thread Margaux Keller
Hi, I'm trying to create an abbreviated data file from a larger version. I can use the subset command to create a value for this data: dat <-subset(raw.data, select=c(SNP, Pvalue)) > head (dat) SNP Pvalue 1 rs11 0.6516 2 rs12 0.3311 3 rs13 0.5615 but when I try to write.table using: w

Re: [R] Plotting question

2011-08-01 Thread Gene Leynes
plot(1:10, pch=letters[1:10]) On Mon, Aug 1, 2011 at 4:44 AM, Andrew McCulloch wrote: > Hi, > > I use R to draw my graphs. I have 100 points on a simple xy-plot. The > points are > distinguished by a third variable which is categorical with 10 levels. I > have > been plotting x against y and usin

Re: [R] Reorganize(stack data) a dataframe inducing names

2011-08-01 Thread Francesca
Dear Contributors thanks for any help you can provide. I searched the threads but I could not find any query that satisfied my needs. This is my database: index time values 13732 27965 DATA.Q211.SUM.Index04/08/11 1.42 13733 27974 DATA.Q211.SUM.Index05/10/11 1.45 1

Re: [R] General indexing in multidimensional arrays

2011-08-01 Thread David Winsemius
On Aug 1, 2011, at 10:50 AM, Duncan Murdoch wrote: On 11-08-01 5:38 AM, Jannis wrote: Dear R community, I have a general question regarding indexing in multidiemensional arrays. Imagine I have a three dimensional array and I only want to extract on vector along a single dimension from

Re: [R] Plotting problems directional or rose plots

2011-08-01 Thread kitty
Hi again, I have tried playing around with the code given to me by Alan and Jim, thank you for the code but unfortunatelyI can't seem to get either of them to work... Alans does not work with the sample data and Jims is giving the error : Error in radial.grid(labels = labels, label.pos = labe

Re: [R] memory problem; Error: cannot allocate vector of size 915.5 Mb

2011-08-01 Thread David Winsemius
On Aug 1, 2011, at 3:04 AM, Dimitris.Kapetanakis wrote: Thanks a lot for the help. Actually, I am using a mac which (R for Mac OS X GUI 1.40-devel Leopard build 32-bit (5751)) but I think I can find access on windows 7 64- bit. I don't think that was what Holtman was advising. You just ne

Re: [R] fitting a sinus curve

2011-08-01 Thread Marianne.ZEYRINGER
Dear David and Hans- Werner, Thank you very much for your help. I would like to compare now if a polynomial or the sinus model fits better. How can I see R-squared or the F- Statistic for the sinus regression, so as to be able to compare it with the polynomial model? Thanks a lot and have a nice ev

Re: [R] Plotting question

2011-08-01 Thread Duncan Murdoch
On 11-08-01 5:44 AM, Andrew McCulloch wrote: Hi, I use R to draw my graphs. I have 100 points on a simple xy-plot. The points are distinguished by a third variable which is categorical with 10 levels. I have been plotting x against y and using gray scales to distinguish the level of the categori

[R] error message jpeg62.dll missing

2011-08-01 Thread Rocky Hyacinth
Dear R-help We are getting an error message `jpeg62.dll missing'. We are running Windows 7 64-bit, from a Mac using Boot Camp. Do you know of this error message, and can you give us help trying to resolve the problem? many thanks Rocky Rocky Hyacinth Technician Department of Archaeology Univer

Re: [R] General indexing in multidimensional arrays

2011-08-01 Thread Duncan Murdoch
On 11-08-01 5:38 AM, Jannis wrote: Dear R community, I have a general question regarding indexing in multidiemensional arrays. Imagine I have a three dimensional array and I only want to extract on vector along a single dimension from it: data<- array(rnorm(64),dim=c(4,4,4)) result<- data[1

Re: [R] [R-Forge] R 2.13.1 can't find package binaries on R-Forge

2011-08-01 Thread Stefan Theussl
Dear all, this must have been a temporary problem. In this case I assume that the build cycle did not finish in time, i.e., binaries were synced to the staging area although not all were built. best, stefan On 07/31/2011 05:52 PM, David Winsemius wrote: On Jul 31, 2011, at 11:26 AM, Michae

[R] Impact of multiple imputation on correlations

2011-08-01 Thread lifty . gere
Dear all, I have been attempting to use multiple imputation (MI) to handle missing data in my study. I use the mice package in R for this. The deeper I get into this process, the more I realize I first need to understand some basic concepts which I hope you can help me with. For example, let u

[R] How to colour specific edges in a dendrogram

2011-08-01 Thread Jan Teichmann
Dear Mailing-list I used hclust to make a dendrogram of 2613 leafs. I also have a list with the names of certain labels which are of interest and I would like to visualize their appearance within the dendrogram. I found an example how to use dendrapply to colour the labels but the problem is that

[R] Plotting question

2011-08-01 Thread Andrew McCulloch
Hi, I use R to draw my graphs. I have 100 points on a simple xy-plot. The points are distinguished by a third variable which is categorical with 10 levels. I have been plotting x against y and using gray scales to distinguish the level of the categorical variable for each point. It looks ok to

[R] Problem with gam() after R update

2011-08-01 Thread Przemek Jura
Dear group, I experience some problems with gam() function after R update to version 2.13.1 The function in both gam and mgcv packages stopped to work. Before, with the same code I used, everything was fine. The function from gam package yields following warning: Residual degrees of freedom are

[R] Problem with gam()

2011-08-01 Thread pjura
Dear group, I experience some problems with gam() function after R update to version 2.13.1 The function in both gam and mgcv packages stopped to work. Before, with the same code I used, everything was fine. The function from gam package yields following warning: Residual degrees of freedom are

Re: [R] memory problem; Error: cannot allocate vector of size 915.5 Mb

2011-08-01 Thread Dimitris.Kapetanakis
Thanks a lot for the help. Actually, I am using a mac which (R for Mac OS X GUI 1.40-devel Leopard build 32-bit (5751)) but I think I can find access on windows 7 64-bit. What I am trying to do is a maximization through grid search (because I am not sure that any of the optim() methods works suff

[R] General indexing in multidimensional arrays

2011-08-01 Thread Jannis
Dear R community, I have a general question regarding indexing in multidiemensional arrays. Imagine I have a three dimensional array and I only want to extract on vector along a single dimension from it: data<- array(rnorm(64),dim=c(4,4,4)) result <- data[1,1,] If I want to extract m

Re: [R] formula used by R to compute the t-values in a linear regression

2011-08-01 Thread Samuel Le
Yes, that's what I was looking for. Many thanks, Samuel -Original Message- From: S Ellison [mailto:s.elli...@lgcgroup.com] Sent: 01 August 2011 15:16 To: Samuel Le; r-h...@stat.math.ethz.ch Subject: RE: formula used by R to compute the t-values in a linear regression > -Original Me

Re: [R] formula used by R to compute the t-values in a linear regression

2011-08-01 Thread Samuel Le
Exactly. My formula holds only for k=1, this is how I generated it. Do you have any references concerning the " rather more careful algorithms"? Thanks, Samuel -Original Message- From: peter dalgaard [mailto:pda...@gmail.com] Sent: 01 August 2011 14:45 To: Samuel Le Cc: r-h...@stat.math.

Re: [R] formula used by R to compute the t-values in a linear regression

2011-08-01 Thread S Ellison
> -Original Message- > [mailto:r-help-boun...@r-project.org] On Behalf Of Samuel Le > Subject: [R] formula used by R to compute the t-values in a > linear regression > I was wondering if someone knows the formula used by the > function lm to compute the t-values. Typing summary.lm I

Re: [R] Reading name-value data

2011-08-01 Thread Hadley Wickham
Yes! Would you mind filing an issue so I dont forget? Hadley On Friday, July 29, 2011, Stavros Macrakis wrote: > Perfect! Thanks! > By the way, I see that, unlike base rbind, it does not work for vectors and lists: > rbind(c(a=1),c(b=2)) => matrix(1:2,2,1,dimnames=list(NULL,"a")) == as.matr

Re: [R] formula used by R to compute the t-values in a linear regression

2011-08-01 Thread peter dalgaard
On Aug 1, 2011, at 15:27 , Samuel Le wrote: > Hello, > > > > I was wondering if someone knows the formula used by the function lm to > compute the t-values. > > > > I am trying to implement a linear regression myself. Assuming that I have K > variables, and N observations, the formula I a

Re: [R] formula used by R to compute the t-values in a linear regression

2011-08-01 Thread David Winsemius
On Aug 1, 2011, at 9:27 AM, Samuel Le wrote: Hello, I was wondering if someone knows the formula used by the function lm to compute the t-values. I am trying to implement a linear regression myself. Assuming that I have K variables, and N observations, the formula I am using is: For t

[R] formula used by R to compute the t-values in a linear regression

2011-08-01 Thread Samuel Le
Hello, I was wondering if someone knows the formula used by the function lm to compute the t-values. I am trying to implement a linear regression myself. Assuming that I have K variables, and N observations, the formula I am using is: For the k-th variable, t-value= b_k/sigma_k With b_k

Re: [R] Use dump or write? or what?

2011-08-01 Thread Matt Curcio
Greetings all, Thanks for all your help so far. Let me give a better idea of what I am doing. I have hundreds of files that I need to plow thru with a t-test and correlation test. BTW, 'tempA' and tempB' are simply columns of numbers from a gene-chip experiment that spits out dna 'amounts'. So I h

[R] Problem Fixed: axes label

2011-08-01 Thread ogbos okike
Hi Peter, Many thanks. It worked. Regards Ogbos On 1 August 2011 14:05, Peter Ehlers wrote: > On 2011-08-01 03:32, ogbos okike wrote: > >> Dear All, >> I am trying to put 10^-8 st km^-2day^-1 on x-axis of my plot. I tried >> using >> : ylab = expression(paste("st / ", plain(km)^2, " / day")) to

Re: [R] Is R the right choice for simulating first passage times of random walks?

2011-08-01 Thread Paul Menzel
Am Sonntag, den 31.07.2011, 23:32 -0500 schrieb R. Michael Weylandt : > Glad to help -- I haven't taken a look at Dennis' solution (which may be far > better than mine), but if you do want to keep going down the path outlined > below you might consider the following: I will try Dennis’ solution ri

  1   2   >