Re: [R] Testing memory limits in R??

2009-07-07 Thread Peter Dalgaard
Duncan Murdoch wrote: On 06/07/2009 4:16 PM, Peter Dalgaard wrote: Scott Zentz wrote: Hello Everyone, We have recently purchased a server which has 64GB of memory running a 64bit OS and I have compiled R from source with the following config ./configure --prefix=/usr/local/R-2.9.1

Re: [R] bigglm() results different from glm()+Another question

2009-07-07 Thread utkarshsinghal
Trust me, it is the same total data I am using, even the chunksizes are all equal. I also crosschecked by manually creating the chunks and updating as in example given on biglm help page. ?biglm Regards Utkarsh Greg Snow wrote: Are you sure that you are fitting all the models on the

Re: [R] Solving quadratic equations with covariance term

2009-07-07 Thread Stein, Luba (AIM SE)
Hi, more precisely I consider a matrix with three column vectors a_i (i=1,2,3), i.e. A=(a_1,a_2,a_3). On the other hand x should take vectors as values, i.e. x=v_j, while j goes also from 1 till 3. Now I just want to calculate the equation Cov(a_i,x_j) = 0, where Cov(a_i,x_j) is the covariance

Re: [R] OK - I got the data - now what? :-)

2009-07-07 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.07.2009 01:58:38: On Sun, Jul 5, 2009 at 1:44 PM, hadley wickhamh.wick...@gmail.com wrote: I think the root cause of a number of my coding problems in R right now is my lack of skills in reading and grabbing portions of the data out of

[R] How to separate the string?

2009-07-07 Thread Hemavathi Ramulu
Hi everyone, Hi want to separate the string(column1) for example column1 column2 column3 column4 column5 column6 bear b e a r cat c a t tigert i g e r I know how to

Re: [R] How to separate the string?

2009-07-07 Thread milton ruser
hi hema may be strsplit can help on the job. bests. milton On Tue, Jul 7, 2009 at 3:54 AM, Hemavathi Ramulu hema.ram...@gmail.comwrote: Hi everyone, Hi want to separate the string(column1) for example column1 column2 column3 column4 column5 column6 bear b e

[R] Multiplication of data frame with vector

2009-07-07 Thread cir p
Dear group: sorry for my beginners question, but I'm rather new to R and was searching high and low without success: I have a data frame (df) with variables in the rows and observations in the columns like (the actual data frame has 15 columns and 1789 rows): early1 early2 early3

[R] Odp: How to separate the string?

2009-07-07 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 07.07.2009 09:54:30: Hi everyone, Hi want to separate the string(column1) for example Well, how did you get the data in R? Are they in separated columns of data.frame? What do you mean by separate? column1 column2 column3 column4 column5 column6

Re: [R] output too large to display all

2009-07-07 Thread Christine Griffiths
Dear All Thanks for the suggestions. Mark's suggestion to specify corr=FALSE did the job and removed the reams of correlations that were being outputted from the model and using up all the output space. Thanks Christine --On 06 July 2009 12:44 -0600 Lyman, Mark mark.ly...@atk.com wrote:

[R] Odp: Multiplication of data frame with vector

2009-07-07 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 07.07.2009 10:05:09: Dear group: sorry for my beginners question, but I'm rather new to R and was searching high and low without success: I have a data frame (df) with variables in the rows and observations in the columns like (the actual

Re: [R] How to separate the string?

2009-07-07 Thread Hemavathi Ramulu
Hi Petr, The data in text file and not csv format. The word separate which I mean in this content is like split/separate the string to each alphabet where each alphabet will be in different column. thanks alot. regards, Hema. On Tue, Jul 7, 2009 at 4:12 PM, Petr PIKAL petr.pi...@precheza.cz

[R] help me about data format.

2009-07-07 Thread yongkook Kwon
Hi I am used to handle bio information such as NMR data or IR data . I want to perform pls regression, so I search the help page of plsr. and I use the example of plsr. But I have a problem to make appropriate data format to do plsr. these example data type like this : A data frame with

Re: [R] How to separate the string?

2009-07-07 Thread Petr PIKAL
Hi If you have data frame like this test=data.frame(x=c(abcd, abc, abcde)) than strsplit(as.matrix(test), ) makes a list with splitted character vectors. If you want them in data frame you would need to combine vectors of unequal length. However I would try reading your text file with

[R] curve from a formula with ggplot2

2009-07-07 Thread Benoit Boulinguiez
Hi all, I'm smoothly transferring my lattice graphs to ggplot2 graphs, but I'm stuck on representing a curve from a formula. I'm looking for the equivalent of curve() in ggplot2, Hadley Wickham mentions geom_curve, but as far as I've seen in the help it doesn't exist. My need is to plot a

Re: [R] Large Stata file Import in R

2009-07-07 Thread Xavier
Thomas Lumley vas escriure el dia dt, 30 jun 2009: On Tue, 30 Jun 2009, Xavier wrote: saurav pathak vas escriure el dia dl, 29 jun 2009: Hi I am using Stata 10 and I need to import a data set in stata 10 to R, I have saved the dataset in lower versions of Stata as well by using saveold

Re: [R] help me about data format.

2009-07-07 Thread Claudia Beleites
I want to make a matrix and vector in same data frame. You need to protect your matrix by I () Btw: I'm actually writing a package for handling spectra that I plan to release in some weeks. It contains a vignette showing how pls calibration can be done. If you want to give it a try, let me

[R] Error in object$coefficients : $ operator not defined for this S4 class

2009-07-07 Thread aledanda
Hallo, I received this error message while calculating the coefficents coef(fit, matrix=TRUE) Error in object$coefficients : $ operator not defined for this S4 class what is this? How can I solve it? Ale -- View this message in context:

[R] rle

2009-07-07 Thread aledanda
Hallo, I have an other problem, I have this vector signData with an alternation of 1 and -1 that corrispond to the duration of two different percepts. I extracted the durations like this: signData- scan(dataTR10.txt) dur-rle(signData)$length Now I would like to extract only the positive

Re: [R] Error in object$coefficients : $ operator not defined for this S4 class

2009-07-07 Thread Ronggui Huang
What is fit in your example? Ronggui 2009/7/7 aledanda danda.ga...@gmail.com: Hallo, I received this error message while calculating the coefficents coef(fit, matrix=TRUE) Error in object$coefficients : $ operator not defined for this S4 class what is this? How can I solve it? Ale

Re: [R] rle

2009-07-07 Thread Henrique Dallazuanna
Try this: rle(signData)$lengths[rle(signData)$values == 1] On Tue, Jul 7, 2009 at 8:11 AM, aledanda danda.ga...@gmail.com wrote: Hallo, I have an other problem, I have this vector signData with an alternation of 1 and -1 that corrispond to the duration of two different percepts. I

Re: [R] rle

2009-07-07 Thread Henrique Dallazuanna
Or: with(rle(signData), lengths[values == 1]) On Tue, Jul 7, 2009 at 8:26 AM, Henrique Dallazuanna www...@gmail.comwrote: Try this: rle(signData)$lengths[rle(signData)$values == 1] On Tue, Jul 7, 2009 at 8:11 AM, aledanda danda.ga...@gmail.com wrote: Hallo, I have an other problem,

Re: [R] rle

2009-07-07 Thread Richard . Cotton
I have an other problem, I have this vector signData with an alternation of 1 and -1 that corrispond to the duration of two different percepts. I extracted the durations like this: signData- scan(dataTR10.txt) dur-rle(signData)$length I think that last line should be

Re: [R] Remove all spaces from a string so it can be used by assign() -- A Fortune?

2009-07-07 Thread Kurt Smith
Thank you for all the advice and I shall listen with regards to assign() and think of another way of writing what I want. Cheers! From: gunter.ber...@gene.com To: greg.s...@imail.org; kurt.sm...@hotmail.co.uk; r-help@r-project.org Subject: RE: [R] Remove all spaces from a string so it

Re: [R] Odp: Multiplication of data frame with vector

2009-07-07 Thread Henrique Dallazuanna
maybe with sweep: sweep(df, 2, mean(mean(df))/mean(df), *) On Tue, Jul 7, 2009 at 5:36 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi r-help-boun...@r-project.org napsal dne 07.07.2009 10:05:09: Dear group: sorry for my beginners question, but I'm rather new to R and was searching

[R] Mathematical annotation axis in lattice

2009-07-07 Thread Coster, Albart
Dear list, making mathematical expressions in plots is not difficult: expression(phi[1]) for example. At this moment I am stuck in creating a vector of expressions: pos - 1:10 lab - letters[pos] Now, I would like to create a vector of expressions which I could use for labeling the x-axis of a

Re: [R] Error in object$coefficients : $ operator not defined for this S4 class

2009-07-07 Thread Ronggui Huang
I can not reproduce your problem with the latest version of VGAM. Besides, if you want to get the coef and std. error etc. you can use summary(fit)@coef3 Value Std. Error t value (Intercept):1 -1.020388 0.03215889 -31.72957 (Intercept):2 1.335657 0.04206706 31.75067

[R] logic question

2009-07-07 Thread matsumotoN
Setting: 200 input variables, 1 binary target variable. Run a principle component analysis on the data then use the output of the principle component analysis (the generated factors) as input into a neural network -but first having partitioned the pca data into training and testing sets so that a

[R] logic question

2009-07-07 Thread matsumotoN
Setting: 200 input variables, 1 binary target variable. Run a principle component analysis on the data then use the output of the principle component analysis (the generated factors) as input into a neural network -but first having partitioned the pca data into training and testing sets so that

[R] subscripted assignment of grid units

2009-07-07 Thread pbarros
Hi, I want to do subscripted assignment of grid units, but I cannot find a straightforward way of doing it (and I have searched all forums and places I could think about, including Paul Murrell,s page). The usual subscripted assignment operator does replace the numeric part, but does not update

Re: [R] Testing memory limits in R??

2009-07-07 Thread Scott Zentz
Hello Everyone! Thanks for all your replies! This was very helpful! I found that there seems to be a limitation to only 32GB of memory which I think will be fine. I was able to consume the 32GB of memory with the following: Start R with the following command: R --max-vsize 55000M then

Re: [R] Multiplication of data frame with vector

2009-07-07 Thread David Freedman
Would the scale function work for this? Something like new=scale(df, center=T) HTH, david freedman cir p wrote: Dear group: sorry for my beginners question, but I'm rather new to R and was searching high and low without success: I have a data frame (df) with variables in the rows and

Re: [R] Testing memory limits in R??

2009-07-07 Thread Whit Armstrong
Seems strange. I can go all the way up to 50GB on our machine which has 64GB as well. It starts swapping after that, so I killed the process. try this: ans - list() for(i in 1:100) { ans[[ i ]] - numeric(2^30/2) cat(iteration: ,i,\n) print(gc()) } source(scripts/test.memory.r)

[R] Uncorrelated random vectors

2009-07-07 Thread Stein, Luba (AIM SE)
Hello, is it possible to create two uncorrelated random vectors for a given distribution. In fact, I would like to have something like the function rnorm or rlogis with the extra property that they are uncorrelated. Thanks for your help, Luba [[alternative HTML version deleted]]

[R] how to get R to print only one column per line when outputting a matrix?

2009-07-07 Thread Godmar Back
Hi, I'm trying to make it easier for my survey evaluators to read the results of my survey analysis. To that end, I'd like to suppress R's habit of filling every line up to width columns. How do I do that? For instance, using 'print()', R outputs something like: [,1]

Re: [R] Testing memory limits in R??

2009-07-07 Thread Scott Zentz
Hey Whit, That worked! I was able to consume all the memory on the server! Thanks! -scz Whit Armstrong wrote: Seems strange. I can go all the way up to 50GB on our machine which has 64GB as well. It starts swapping after that, so I killed the process. try this: ans - list() for(i

Re: [R] Multiplication of data frame with vector

2009-07-07 Thread Stein, Luba (AIM SE)
Thank you for your help! But is it possible to produe two vectors x and y with a given length such that there correlation is zero. For me ist not enough just to simulate two vectors with there correlation. Thank you, Luba -Urspr?ngliche Nachricht- Von:

Re: [R] Uncorrelated random vectors

2009-07-07 Thread Stein, Luba (AIM SE)
Thank you for your help! But is it possible to produe two vectors x and y with a given length such that there correlation is zero. For me ist not enough just to simulate two vectors with there correlation. Thank you, Luba -Urspr?ngliche Nachricht- Von: ONKELINX, Thierry

[R] cor vs cor.test

2009-07-07 Thread Godmar Back
Hi, I am trying to use R for some survey analysis, and need to compute the significance of some correlations. I read the man pages for cor and cor.test, but I am confused about - whether these functions are intended to work the same way - about how these functions handle NA values - whether

Re: [R] Uncorrelated random vectors

2009-07-07 Thread Andrew Dolman
You could use the mvtnorm package to generate correlated vectors of random normal deviates where the nominal correlation is 0. library(mvtnorm) rho - 0.0 Cor - array(c(1, rho, rho, 1), dim=c(2,2)) Y - rmvnorm(1000, sigma=Cor) plot(Y) cor(Y) cor.test(Y[,1],Y[,2]) Any given random set will have

Re: [R] bigglm() results different from glm()+Another question

2009-07-07 Thread Greg Snow
How many rows does xx have? Let's look at your example for chunksize 1, you initially fit the first 1 observations, then the seq results in just the value 1 which means that you do the update based on vaues 10001 through 2, if xx only has 1 rows, then this should give at

Re: [R] cor vs cor.test

2009-07-07 Thread Peter Ehlers
?cor says that cor() can be applied to 'numeric vector, matrix or data frame' ?cor.test requires 'numeric vectors of data values' So, what's your q? As to na.action: ?cor.test makes no reference to na.action for the default method. Looking at the code of cor.test.default shows that only

Re: [R] Uncorrelated random vectors

2009-07-07 Thread Ted Harding
Be careful to be clear what you are referring to when you say correlation is zero. The commands x - rnorm(100) y - rnorm(100) will produce two vectors of given length (100) which (to within the effectively ignorable limitations of the ransom number generator) will have been produced

Re: [R] Solving quadratic equations with covariance term

2009-07-07 Thread Charles C. Berry
On Tue, 7 Jul 2009, Stein, Luba (AIM SE) wrote: Hi, more precisely I consider a matrix with three column vectors a_i (i=1,2,3), i.e. A=(a_1,a_2,a_3). On the other hand x should take vectors as values, i.e. x=v_j, while j goes also from 1 till 3. Now I just want to calculate the equation

Re: [R] Mathematical annotation axis in lattice

2009-07-07 Thread Paul Hiemstra
Hi Albart, This bugged me also for quite some time. After some experiments the following syntax worked best: library(lattice) a = 0.11 xyplot(1:10~10:11, xlab = as.expression(bquote(R^2~ equals ~.(a With the combination of as.expression and bquote you can mix text, math expression and

Re: [R] Uncorrelated random vectors

2009-07-07 Thread Greg Snow
Here are some examples that may get you started (note that there is no guarantee that a variable follows a given distribution after it has been adjusted to have 0 correlation with another variable): library(MASS) tmp - mvrnorm(25, c(0,0), diag(2), empirical=TRUE) zapsmall(cor(tmp)) tmp2 -

Re: [R] how to get R to print only one column per line when outputting a matrix?

2009-07-07 Thread David Winsemius
It looks like you are printing a matrix and that you want to print all rows of the first column before all rows of the second column. Apply should do it. Assume the matrix is named AA apply(AA, c(2,1), cat, \n) # the \n is the line-feed character -- DW On Jul 7, 2009, at 10:06 AM,

[R] Thanks!

2009-07-07 Thread Mark Knecht
Hi all, I just wanted to send a general word of thanks to the list for making my first week using R successful (by my measures) and reasonably pleasurable. (Not a single literal RTFM!) ;-) I appreciate all the help I've received from folks. I have a long way to go but I'm starting to get

[R] error: no such index at level 2

2009-07-07 Thread Godmar Back
Hi, I am confused about how to select elements from a list. I'm trying to select all rows of a table 'crossRsorted' such that the mean of a related vector is 0. The related vector is accessible as a list element l[[i]] where i is the row index. I thought this would work:

Re: [R] cor vs cor.test

2009-07-07 Thread Godmar Back
Thanks, Peter. You're right, I mistyped and getOption('na.action') shows na.omit. Perhaps my question was more commentary about my perceived lack of rationale and orthogonality in R than it should have been. Presumably, q[[i]] is a data frame and q[[i]][,1] is a numeric vector, so cor and

Re: [R] how to get R to print only one column per line when outputting a matrix?

2009-07-07 Thread Godmar Back
On Tue, Jul 7, 2009 at 12:20 PM, David Winsemiusdwinsem...@comcast.net wrote: It looks like you are printing a matrix and that you want to print all rows of the first column before all rows of the second column. Apply should do it. Assume the matrix is named AA apply(AA, c(2,1), cat, \n)   #

Re: [R] how to get R to print only one column per line when outputting a matrix?

2009-07-07 Thread Godmar Back
On Tue, Jul 7, 2009 at 1:22 PM, Godmar Backgod...@gmail.com wrote: apply(AA, c(2,1), cat, \n) Error in cat(list(...), file, sep, fill, labels, append) :  argument 1 (type 'list') cannot be handled by 'cat' ps: but your idea of using 'apply' led me to this: dummy - apply(AA, c(2), function

[R] Error due to non-conformable arrays

2009-07-07 Thread spime
Hello, Consider this function for generalized ridge regression: gre - function (X,y,D){ n - dim(X)[1] p - dim(X)[2] intercept - rep(1, n) X - cbind(intercept, X) X2D - crossprod(X,X)+ D Xy - crossprod(X,y) bth - qr.solve(X2D,

Re: [R] Error due to non-conformable arrays

2009-07-07 Thread Henrique Dallazuanna
I think that is because X in your function has (n + 1) columns and D with only n coluimns: matrix(1:9, ncol = 3) + matrix(1:8, ncol = 2) On Tue, Jul 7, 2009 at 2:30 PM, spime saby...@gmail.com wrote: Hello, Consider this function for generalized ridge regression: gre - function (X,y,D){

Re: [R] Error due to non-conformable arrays

2009-07-07 Thread David Winsemius
Incomplete code leaves us able to do naught but guess; Perhaps you are unaware that x != X -- DW On Jul 7, 2009, at 1:30 PM, spime wrote: Hello, Consider this function for generalized ridge regression: gre - function (X,y,D){ n - dim(X)[1] p - dim(X)[2] intercept

Re: [R] Error due to non-conformable arrays

2009-07-07 Thread Jorge Ivan Velez
Hi spime, What is x? Did you have any other X defined in your R-session? Be aware that R is case-sensitive. Best, Jorge On Tue, Jul 7, 2009 at 1:30 PM, spime saby...@gmail.com wrote: Hello, Consider this function for generalized ridge regression: gre - function (X,y,D){ n -

[R] how to read point shp file to R?

2009-07-07 Thread Sunny
I am new with R and want do some analysis with a point vector data file. Any help is appreciate. Sunny [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] object .trPaths not found

2009-07-07 Thread Knut Krueger
Uwe Ligges schrieb: Maybe, but the may depend on your script, your OS, your R version, used packages and so on. Hence please read and follow the posting guide and provide commented, minimal, self-contained, reproducible code. Hi Uwe, I was just asked the same question and hat the same

Re: [R] Quantitative Risk Management by McNeil

2009-07-07 Thread spencerg
Dear Andriy: 1. The help file for fit.NH says the first argument should be a vector of data. Consider the following modification of the example on that help page: rs - matrix(rseries, 10, 202, dimnames=list(letters[1:10], 1:202)) rs. - fit.NH(rs) Error: cannot allocate vector

[R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread Godmar Back
Hi, is there a simpler way to count the number of elements in a vector that are not NA than this: countN - function (v) { return (Reduce(function (x, y) x + y, ifelse(is.na(v), 0, 1))) } ? - Godmar __ R-help@r-project.org mailing list

Re: [R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread Jorge Ivan Velez
Dear Godmar, Yes. One way would be sum( !is.na( yourvector ) ) HTH, Jorge On Tue, Jul 7, 2009 at 2:56 PM, Godmar Back god...@gmail.com wrote: Hi, is there a simpler way to count the number of elements in a vector that are not NA than this: countN - function (v) { return

Re: [R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread Henrique Dallazuanna
another option should be: length(na.omit(v)) On Tue, Jul 7, 2009 at 3:56 PM, Godmar Back god...@gmail.com wrote: Hi, is there a simpler way to count the number of elements in a vector that are not NA than this: countN - function (v) { return (Reduce(function (x, y) x + y,

[R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Mark Knecht
Hi, I am apparently not understanding some nuance about either the use of subset or more likely my ability to test for a numerical match using '='. Which is it? Thanks in advance. I've read a data file, reshaped it and then created MyResults by keeping only lines where the value column is

Re: [R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread David Huffer
How about countN - function ( v ) { sum ( !is.na ( v ) ) - sum ( is.na ( v ) ) } -- David   - David Huffer, Ph.D. Senior Statistician CSOSA/Washington, DC david.huf...@csosa.gov

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Henrique Dallazuanna
Try this: MyResults.GroupA - subset(MyResults, PosType == 1) On Tue, Jul 7, 2009 at 4:06 PM, Mark Knecht markkne...@gmail.com wrote: Hi, I am apparently not understanding some nuance about either the use of subset or more likely my ability to test for a numerical match using '='. Which

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Jorge Ivan Velez
Hi Mark, X = 1 assings the number 1 to X whereas X == 1 test if X is equal to 1. I suspect you want to do this :-) Here is an example: # R code X = 1 X # [1] 1 X == 1 # [1] TRUE HTH, Jorge On Tue, Jul 7, 2009 at 3:06 PM, Mark Knecht markkne...@gmail.com wrote: Hi, I am apparently

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Duncan Murdoch
On 7/7/2009 3:06 PM, Mark Knecht wrote: Hi, I am apparently not understanding some nuance about either the use of subset or more likely my ability to test for a numerical match using '='. Which is it? Thanks in advance. I've read a data file, reshaped it and then created MyResults by

Re: [R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread David Huffer
On Tuesday, July 07, 2009 3:20 PM, Godmar Back wrote: ...That would be wrong, wouldn't it, if the other replies are correct Yes. It was wrong. This isn't: countN - function ( v ) { length ( v ) - sum ( is.na ( v ) ) } But there are really tons of ways to do it. Even your

[R] find duplicates... need help!

2009-07-07 Thread njhuang86
Hi all, Suppose I have x = c('a', 't', 'c', 'y', 'g') and also y = c('a', 'a', 'g', 's') If I do something like x%in%y, I obtain a vector like this: [TRUE, FALSE, FALSE, FALSE, TRUE] which I can easily turn into this: [1, 0, 0, 0, 1]. I was wondering is there anyway for me to get a vector back

Re: [R] Test for X=1 fails, test for 0 works, data in text file

2009-07-07 Thread Ted Harding
On 07-Jul-09 19:06:59, Mark Knecht wrote: Hi, I am apparently not understanding some nuance about either the use of subset or more likely my ability to test for a numerical match using '='. Which is it? Thanks in advance. It looks as though you have tripped over the distinction between =

Re: [R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread Godmar Back
Thank you for the many replies! This is really a very friendly and helpful community! On Tue, Jul 7, 2009 at 3:06 PM, Henrique Dallazuannawww...@gmail.com wrote: another option should be: length(na.omit(v)) I think the above is what I was looking for since, presumably, it uses the very same

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread Mark Knecht
On Tue, Jul 7, 2009 at 12:17 PM, Henrique Dallazuannawww...@gmail.com wrote: Try this: MyResults.GroupA - subset(MyResults, PosType == 1) SNIP Darn those small screen fonts. I never noticed that! Every example I'm looking at jsut looks like a single '=' until you pointed it out! Thanks to

Re: [R] find duplicates... need help!

2009-07-07 Thread Jorge Ivan Velez
Dear njhuang86, Here is one way: x - c('a', 't', 'c', 'y', 'g') y - c('a', 'a', 'g', 's') table(factor(y, levels = x)) # a t c y g # 2 0 0 0 1 HTH, Jorge On Tue, Jul 7, 2009 at 3:28 PM, njhuang86 njhuan...@yahoo.com wrote: Hi all, Suppose I have x = c('a', 't', 'c', 'y', 'g') and also y

[R] vectorizing a function

2009-07-07 Thread Steve Jaffe
I'm sure I'm missing something obvious but I'm not seeing how to simply vectorize a function of two or more variables. Say I have f - function(x,y) if (x0) y else -y Now I have vectors x and y of equal length and I'd like to apply f element-wise. I.e. conceptually z - f(x,y) where x, y, z are

Re: [R] vectorizing a function (NEVERMIND)

2009-07-07 Thread Steve Jaffe
Nevermind, indeed it is obvious: Vectorize ! Steve Jaffe wrote: I'm sure I'm missing something obvious but I'm not seeing how to simply vectorize a function of two or more variables. -- View this message in context: http://www.nabble.com/vectorizing-a-function-tp24380064p24380136.html

Re: [R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread Zhiliang Ma
how about sum(!is.na(x)) ? On Tue, Jul 7, 2009 at 2:56 PM, Godmar Backgod...@gmail.com wrote: Hi, is there a simpler way to count the number of elements in a vector that are not NA than this: countN - function (v) {    return (Reduce(function (x, y) x + y, ifelse(is.na(v), 0, 1))) } ?

Re: [R] vectorizing a function

2009-07-07 Thread Greg Snow
For this case it is quite simple, see ?ifelse z - ifelse( x 0, y, -y ) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org

Re: [R] vectorizing a function

2009-07-07 Thread Bert Gunter
?ifelse Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steve Jaffe Sent: Tuesday, July 07, 2009 12:42 PM To: r-help@r-project.org Subject: [R] vectorizing a function I'm sure I'm

Re: [R] Solving quadratic equations with covariance term

2009-07-07 Thread Giovanni Petris
It is not clear to me whether you are talking about a covariance (a theoretical quantity depending on the distribution of A and x) or an empirical covariance, estimated from some data. In the first case you don't need to solve anything because, as long as A is fixed, i.e. non-random, its

Re: [R] Test for X=1 fails, test for 0 works, data in text file is 1

2009-07-07 Thread William Dunlap
subset(), like many R methods, has an argument list that ends with '...', meaning that it will not tell you that an argument you gave it by name= is not in the official list of arument names. If the ... were not there then you would have gotten an error message. E.g., the following makes a

Re: [R] Uncorrelated random vectors

2009-07-07 Thread Giovanni Petris
Here is one way: x - rnorm(100) y - rnorm(100) z - residuals(lm(y ~ x)) cor(x, z) [1] 3.610290e-17 Best, Giovanni Date: Tue, 07 Jul 2009 16:26:02 +0200 From: Stein, Luba (AIM SE) luba.st...@allianz.com Sender: r-help-boun...@r-project.org Accept-Language: en-US, de-DE Precedence: list

[R] building 2.0.6 on Win32/Py2.5

2009-07-07 Thread Chuck White
After I posted the previous message, I repeated the process on a windows machine with Python 2.6 and still get the same error. I would appreciate any help. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Dump plots to powerpoint?

2009-07-07 Thread Thomas
Hi, Is it possible to dump a series of plots directly into a powerpoint presentation (as is possible in Splus)? Thank you, Thomas [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] subscripted assignment of grid units

2009-07-07 Thread Paul Murrell
Hi You have encountered the fact that, while there are [ methods for grid unit objects, there are NOT any [- methods for grid unit objects. I guess that needs to go (back) onto my todo list. A workaround for your simple example is ... unit.c(testUnits[1:2], testUnit2, testUnits[4:5]) ...

[R] Numbering sequences of non-NAs in a vector

2009-07-07 Thread Krishna Tateneni
Greetings, I have a vector of the form: [10,8,1,3,0,8,NA,NA,NA,NA,2,1,6,NA,NA,NA,0,5,1,9...] That is, a combination of sequences of non-missing values and missing values, with each sequence possibly of a different length. I'd like to create another vector which will help me pick out the

Re: [R] object .trPaths not found

2009-07-07 Thread Uwe Ligges
I have to admit that I have no idea what we are talking about here (yes, I tend to forget many things these days) - and you have not cited the original message, unfortunately (nor have you specifies R versions, Tinn-R versions and both OS versions, but just one) ... Best wishes, Uwe Knut

Re: [R] Dump plots to powerpoint?

2009-07-07 Thread Mark Wardle
I generate PDF images and then rasterise using imagemagick to large, high quality JPG files. Then manually insert into powerpoint. Former two can definitely be automated, I'm sure the latter insertion could be automated with judicious use of scripting if really necessary. 2009/7/7 Thomas

Re: [R] building 2.0.6 on Win32/Py2.5

2009-07-07 Thread Uwe Ligges
Which previous message? Should we all look up the archives now? Please cite and stay within the same thread. Thank you, Uwe LIgges Chuck White wrote: After I posted the previous message, I repeated the process on a windows machine with Python 2.6 and still get the same error. I would

Re: [R] how to count number of elements in a vector that are not NA ?

2009-07-07 Thread Giovanni Petris
sum(!is.na(x)) Date: Tue, 07 Jul 2009 14:56:54 -0400 From: Godmar Back god...@gmail.com Sender: r-help-boun...@r-project.org Precedence: list DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; Hi,

[R] ReShape to create Time from Observations?

2009-07-07 Thread Mark Knecht
Here is a couple of very simple data.frames: X-data.frame(A=1:10, B=0, C=1, Ob1=1:10, Ob2=2:11, Ob3=3:12, Ob4=4:13, Ob5=3:12, Ob6=2:11) Y-data.frame(A=1:20, B=0, C=1, D=5, Ob1=1:10, Ob2=2:11, Ob3=3:12, Ob4=4:13, Ob5=3:12, Ob6=2:11, Ob7=5:9) Z-data.frame(A=1:30, B=0, C=1, D=6, E=1:2, Ob1=1:10,

Re: [R] Numbering sequences of non-NAs in a vector

2009-07-07 Thread Jorge Ivan Velez
Dear Krishna, Here is one way. It is not very elegant, but seems to work: # x is the vector you want to change foo - function(x){ R1 - rle(!is.na(x)) R2 - rle(is.na(x)) len - R1$lengths[!R2$values] x[!is.na(x)] - rep(1:length(len), len) x } # Example x - c(10, 8, 1, 3, 0, 8, NA,

[R] R2WinBUGS under Linux/WINE fails

2009-07-07 Thread Harlan Harris
Hi, I'm running wine-1.0.1, OpenBUGS 3.0.3, R 2.9.0, and R2WinBUGS on a Redhat Enterprise Linux machine. Following various peoples' suggestions... This works perfectly (yay!): wine Z:/opt/OpenBUGS/winbugs.exe Within R, however, I get this: (setup the example from ?bugs, then) R

Re: [R] Numbering sequences of non-NAs in a vector

2009-07-07 Thread Stavros Macrakis
Here's one possibility: vv - c(10,8,1,3,0,8,NA,NA,NA,NA,2,1,6,NA,NA,NA,0,5,1,9) (1+cumsum(diff(is.na(c(vv[1],vv)))==1)) * !is.na(vv) [1] 1 1 1 1 1 1 0 0 0 0 2 2 2 0 0 0 3 3 3 3 On Tue, Jul 7, 2009 at 5:08 PM, Krishna Tateneni taten...@gmail.com wrote: Greetings, I have a vector of the

Re: [R] Numbering sequences of non-NAs in a vector

2009-07-07 Thread Marc Schwartz
On Jul 7, 2009, at 4:08 PM, Krishna Tateneni wrote: Greetings, I have a vector of the form: [10,8,1,3,0,8,NA,NA,NA,NA,2,1,6,NA,NA,NA,0,5,1,9...] That is, a combination of sequences of non-missing values and missing values, with each sequence possibly of a different length. I'd like to

[R] r-project.org address blacklisted by anti-spam software

2009-07-07 Thread Hans W Borchers
Dear List: An e-mail mentioning the r-project.org address and sent to a friend at a German university was considered spam by the local spam filter. Its reasoning: the URL r-project.org is blacklisted at uribl.swinog.ch resp. at antispam.imp.ch. I checked the list

[R] wordStem problems in R 2.9, Fedora 11; Linux Kernel 2.6.29.5-191.fc11.i586

2009-07-07 Thread Reitsma, Rene - COB
Dear All, I just updated from Fedora 9 to Fedora 11, kernel version 2.6.29.5-191.fc11.i586. I'm running R 2.9. I successfully installed package Rstem from source (it always ran fine for me in F9). However: wordStem(c(This,is,a,test)) Error in wordStem(c(This, is, a, test)) : VECTOR_ELT()

[R] Question in using e1071 svm routine

2009-07-07 Thread Michael
Hi all, I've got the following error message in using e1071 svm routine... Could anybody please help me? Thank you! - model - svm(y=factor(mytraindata[, 1]), x=mytraindata[, -1], probability=T) Error in if (any(co)) { : missing value where TRUE/FALSE needed In

Re: [R] building 2.0.6 on Win32/Py2.5

2009-07-07 Thread Chuck White
My sincere apologies. This message was intended for the rpy2 mailing list. Thanks. Uwe Ligges lig...@statistik.tu-dortmund.de wrote: Which previous message? Should we all look up the archives now? Please cite and stay within the same thread. Thank you, Uwe LIgges Chuck

Re: [R] odfWeave: odt-file damaged

2009-07-07 Thread ukoenig
Hi, I think, I can answer my own posting. I found out, that the directory structure of the ODT-file created by odfWeave causes the error message. The file structure of the unzipped odt-file looks like this: DIR Pictures content_1-Boxplot.png content.xml current.xml manifest.xml

Re: [R] r-project.org address blacklisted by anti-spam software

2009-07-07 Thread Duncan Murdoch
On 07/07/2009 5:59 PM, Hans W Borchers wrote: Dear List: An e-mail mentioning the r-project.org address and sent to a friend at a German university was considered spam by the local spam filter. Its reasoning: the URL r-project.org is blacklisted at uribl.swinog.ch resp. at antispam.imp.ch. I

[R] Tex fonts in R plots

2009-07-07 Thread KARAVASILIS GEORGE
Hello, R users. I would like to display the font of Math Mode of MikTex 2.3, WinEdt 5.4 in R plots, e.g. in xlab, ylab or legend. How can I do that? Thank you in advance. __ R-help@r-project.org mailing list

  1   2   >