[R] Odp: R not recognizing words

2012-01-06 Thread Petr PIKAL
Hi Hello all I'm new to R and am experiencing a problem with a categorical variable. All the data of this variable are Low, High, or NA. When I put summary(x$y), it gives me the number of High, Low, and NA entries. However, when I try to subset by writing x$y==Low or x$y==High, R

Re: [R] question about rev

2012-01-06 Thread Petr PIKAL
Hi [R] question about rev Hi,all: I have a vector,and wanna get the opposite value via rev function. a [1] FALSE FALSE TRUE TRUE TRUE rev(a) [1] TRUE TRUE TRUE FALSE FALSE I don't know why the 3rd TRUE has not been reversed,while all other values are reversed?

[R] Reply on ggplot2 - tricky problem

2012-01-06 Thread Mario Giesel
That comes really close to what I had in mind. Thanks a lot for helping out, Justin! Good luck,  Mario Re: [R] ggplot2 - tricky problem how bout: dat-data.frame(id=1:4,city=c('berlin','munich'),likeability=c(5,4,6,5),uniqueness=c(3,4,4,4)) ggplot(ddply(melt(dat,                          

[R] how to remove an element from list or character

2012-01-06 Thread arunkumar1111
HI I want to remove an element from a list or character. i can any of the class type like cat= [1] mac med if my input is 2 i need to remove med and if my input is one i need to remove mac from cat Please help - Thanks in Advance Arun -- View this message in context:

Re: [R] Bayesian estimate of prevalence with an imperfect test

2012-01-06 Thread LianD
Thanks Bert I've been through my variables again and have managed to get the code working - shouldn't have tried to deal with it at the end of the day yesterday! all the best Lian -- View this message in context:

Re: [R] question about rev

2012-01-06 Thread 孟欣
Yes£¬I find out later. rev is only reverse the order. What I use is ! Thanks At 2012-01-06 16:07:11,Petr PIKAL petr.pi...@precheza.cz wrote: Hi [R] question about rev Hi,all: I have a vector,and wanna get the opposite value via rev function. a [1] FALSE FALSE TRUE TRUE

[R] need help with connecting to SQL Server2008 Express with RJDBC

2012-01-06 Thread cvez
i have been trying RJDBC for many hours but still failed to connect to my sql server. platform: win7 professional; SQL server 2008 express; the code is : drv - JDBC(com.microsoft.sqlserver.jdbc.SQLServerDriver, C:/Users/myname/sqljdbc_3.0/enu/sqljdbc4.jar);

Re: [R] question about rev

2012-01-06 Thread cvez
the function /rev / REVERSEs the order of the vector, as v= c(1,2,3) rev(v)= 3,2,1 if you want the opposite value , just add a exclamation in front of the vector: v=c(T,F,T,T); !v is F,T,F,F -- View this message in context: http://r.789695.n4.nabble.com/question-about-rev-tp4268518p4268716.html

Re: [R] how to remove an element from list or character

2012-01-06 Thread Milan Bouchet-Valat
Le jeudi 05 janvier 2012 à 23:52 -0800, arunkumar a écrit : HI I want to remove an element from a list or character. i can any of the class type like cat= [1] mac med if my input is 2 i need to remove med and if my input is one i need to remove mac from cat This is really

Re: [R] plot rq lm

2012-01-06 Thread Tal Galili
I asked a while ago what diagnostic plots exists for quantile regression, here: http://stats.stackexchange.com/questions/19291/what-diagnostic-plots-exists-for-quantile-regression And had received no answer. I hope some more information will become available regarding this. Best, Tal

Re: [R] R not recognizing words

2012-01-06 Thread peter dalgaard
On Jan 6, 2012, at 06:20 , arabarkev wrote: Hello all I'm new to R and am experiencing a problem with a categorical variable. All the data of this variable are Low, High, or NA. When I put summary(x$y), it gives me the number of High, Low, and NA entries. However, when I try to subset

[R] add data to a file while doing a loop

2012-01-06 Thread Joao Fadista
Hi, I would like to know how can I keep adding data to a file while doing a loop and without deleting the data of the previous iteration. Thanks. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] add data to a file while doing a loop

2012-01-06 Thread Stephen Sefick
Without context, read reproducible code, it is hard to answer this question. What system are you on? Do you need to write one line of data or a data frame or a list out? Are trying to write a graphic out? It will be easier to answer your question with some context. Good luck! Stephen On

[R] Spatial data, rpoispp, using window with fixed radius?

2012-01-06 Thread herbert8686
Dear All, I was searching through the spatstat manual in order to find a function to simulate a Poisson pattern only within a fixed radius (circular moving window) around individual points. If points are distributed heterogeneously over a large area this may help to only assess deviation from

Re: [R] add data to a file while doing a loop

2012-01-06 Thread Joao Fadista
Thanks for the reply. Every iteration produces a text data.frame directly into a file without saving it in R. And every iteration overwrites the data produced from the previous iteration. So what I would like to do is being able not to overwrite the data of any iteration but adding it to the

[R] [R-pkgs] The BRugs 0.7-4 interface to OpenBUGS released

2012-01-06 Thread Uwe Ligges
After so many questions and a considerable delay (almost entirely my fault), the BRugs package version 0.7-4 has been released yesterday. The BRugs package is available from CRAN master already as source and in binary form for Windows and will be synced by the mirrors shortly. Note the

Re: [R] Problem with axes in a plot of Kaplan-Meier

2012-01-06 Thread Terry Therneau
After changing involuntarily some of the graphics parameters with the command par() (I did not know that changes with this command are permanent), now when I made a plot of the survival Kaplan-Meier function, the Y axis does not start at 1, and the X axis does starts at 0. The commands that I use

Re: [R] R not recognizing words

2012-01-06 Thread Nutter, Benjamin
I've developed a preference for x$y %in% Low when subsetting.   Benjamin Nutter |  Biostatistician   |  Quantitative Health Sciences   Cleveland Clinic  |  9500 Euclid Ave.  |  Cleveland, OH 44195  | (216) 445-1365 -Original Message- From: r-help-boun...@r-project.org

Re: [R] automatic SI prefixes as ticklabels on axis

2012-01-06 Thread Rui Barradas
Ben's solution is much better, I was using only Jonas' code. There might be typo with large values of 'x', getSIstring(1e309) [1] Inf Y I don't believe this will happen, the range upper limit is much smaller. Anyway, it can be easily solved. (Ben's code, slightly changed.) getSIstring -

[R] What is wrong with this plotting?

2012-01-06 Thread raphael.felber
Hello I have a data frame, called input, like this: DateTime CO2_A1cont 1 2011-04-08 11:47:01 NA 2 2011-04-08 12:42:018.9 3 2011-04-08 13:07:01 NA 4 2011-04-08 13:32:01 NA 5 2011-04-08 13:57:01 7.556482 6 2011-04-08 14:22:01 NA 57

Re: [R] add data to a file while doing a loop

2012-01-06 Thread Rui Barradas
Hello, See ?open and ?capture.output or ?textConnection To open a connection (with 'open') then write to it is probably the solution. Rui Barradas -- View this message in context: http://r.789695.n4.nabble.com/add-data-to-a-file-while-doing-a-loop-tp4269086p4269396.html Sent from the R

[R] lme model specification problem (Error in MEEM...)

2012-01-06 Thread Pascal A. Niklaus
Dear all, In lme, models in which a factor is fully contained in another lead to an error. This is not the case when using lm/aov. I understand that these factors are aliased, but believe that such models make sense when the factors are fitted sequentially. For example, I sometimes fit a

Re: [R] R not recognizing words

2012-01-06 Thread arabarkev
There was a trailing white space! Now I feel not so smart Thanks a lot for your help! -- View this message in context: http://r.789695.n4.nabble.com/R-not-recognizing-words-tp4268283p4269326.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] add data to a file while doing a loop

2012-01-06 Thread Sander Timmer
So you're looking for: write.table(dataset, file=x.txt, append=TRUE) Or do I understand your question wrongly? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] add data to a file while doing a loop

2012-01-06 Thread David Winsemius
On Jan 6, 2012, at 8:27 AM, Joao Fadista wrote: Thanks for the reply. Every iteration produces a text data.frame directly into a file without saving it in R. And every iteration overwrites the data produced from the previous iteration. So what I would like to do is being able not to

[R] venneuler plots may be inaccurate

2012-01-06 Thread Carl Witthoft
Hi, I just started playing w/ venneuler, and have a question about the last method listed for creating inputs. This is the method where the source is a matrix X, for which each column represents a set, and the co-occurrence is defined by the rows. So, for example: Rgames foo [,1]

[R] ggplot using scale_x_date gives Error in seq.int(r1$year, to$year, by)

2012-01-06 Thread Aidan Corcoran
Dear all, ggplot gives me an error when trying to plot time series data using a date variable as the x axis. g-structure(list(Date = c(2011-12-23, 2011-12-30, 2012-01-06, 2011-12-23, 2011-12-30, 2012-01-06, 2011-12-23, 2011-12-30, 2012-01-06), variable = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 3L,

Re: [R] What is wrong with this plotting?

2012-01-06 Thread Gabor Grothendieck
On Fri, Jan 6, 2012 at 5:49 AM, raphael.fel...@art.admin.ch wrote: Hello I have a data frame, called input, like this:           DateTime CO2_A1cont 1 2011-04-08 11:47:01         NA 2 2011-04-08 12:42:01    8.9 3 2011-04-08 13:07:01         NA 4 2011-04-08 13:32:01         NA 5

[R] VarCov matrix between coefficients across quantiles - summary.rq

2012-01-06 Thread Julia Lira
Dear all, I am trying to design a Wald test to verify whether some coefficients are statistically equal. I would like to test not only whether they are jointly equal for a given quantile, but for a range of quantiles. Hence, I need to extract the variance-covariance matrix among the

[R] Dropping columns from data frame

2012-01-06 Thread Mike Harwood
How does R do it, and should I ever be worried? I always remove columns by index, and it works exactly as I would naively expect - but HOW? The second illustration, which deletes non contiguous columns, represents what I do all the time and have some trepidation about because I don't know the

[R] how to use rgl to plot dynamic orbit

2012-01-06 Thread Phillip Von
Dear all, I have a question about the plotting of the dynamical orbit by using rgl. My code is as follows: open3d() par3d(cex=2) bg3d(white) for(i in 1:out.length){ ind-which plot3d(x[1:i],y[1:i],out[,z][1:i],xlim=c(-10,10),ylim=c(-10,10),zlim=c(-10,10),col=red,cex=2) Sys.sleep(0.0001) } ,where

[R] data.frame: temporal complexity

2012-01-06 Thread ikuzar
Hello, I created a data.frame which contains two columns: df$P (Power) et df$DateTime (time). I'd like to add a new column df$diffP (difference of Power between T and T-2). I made a loop : for (i in 3:length(df$DateTime)){ df$diffP[i] = df$P[i] - df$P[i-2] } execution time result is

[R] plots for residual analysis

2012-01-06 Thread jose romero
Hello List: I'm writing in R some code to produce plots for residual analysis and diagnostics in linear regressions.  An example of the plots produced is given for downloading at http://dl.dropbox.com/u/25445316/res_plots.png .  Regarding the example plot, I'd like to point out that: 1)

Re: [R] data.frame: temporal complexity

2012-01-06 Thread Bert Gunter
1. You are doing exactly what one is recommended to avoid in R. Have you read an Introduction to R? -- especially about vectorization? 2. To answer your question: ?diff It will probably be an order or 2 of magnitude faster. -- Bert On Fri, Jan 6, 2012 at 6:39 AM, ikuzar raz...@hotmail.fr

Re: [R] data.frame: temporal complexity

2012-01-06 Thread jim holtman
Try this: df - data.frame(power = runif(1)) # add difference diffGap - 2 df$diff - c(rep(NA, diffGap), head(df$power, -diffGap) - tail(df$power, -diffGap)) head(df, 10) powerdiff 1 0.86170585 NA 2 0.90672473 NA 3 0.96868367 -0.10697782 4 0.44199262

Re: [R] add data to a file while doing a loop

2012-01-06 Thread William Dunlap
Is this an example of what you want to do? fileName - tempfile(fileext=.txt) fileCon - file(fileName, wt) # a file connection, opened for writing text for(i in 1:5) { cat(file=fileCon, Line, i, \n) # write to connection, not file name } close(fileCon) Then look to see what the

Re: [R] Dropping columns from data frame

2012-01-06 Thread David Winsemius
On Jan 6, 2012, at 10:00 AM, Mike Harwood wrote: How does R do it, and should I ever be worried? I always remove columns by index, and it works exactly as I would naively expect - but HOW? The second illustration, which deletes non contiguous columns, represents what I do all the time and

Re: [R] lme model specification problem (Error in MEEM...)

2012-01-06 Thread Ben Bolker
Pascal A. Niklaus pascal.niklaus at ieu.uzh.ch writes: In lme, models in which a factor is fully contained in another lead to an error. This is not the case when using lm/aov. I understand that these factors are aliased, but believe that such models make sense when the factors are fitted

Re: [R] how to use rgl to plot dynamic orbit

2012-01-06 Thread Duncan Murdoch
On 06/01/2012 9:13 AM, Phillip Von wrote: Dear all, I have a question about the plotting of the dynamical orbit by using rgl. My code is as follows: open3d() par3d(cex=2) bg3d(white) for(i in 1:out.length){ ind-which

[R] How to fit my data with a distribution?

2012-01-06 Thread Andra Isan
Dear All, I have a bunch of data points as follows: x  100 y  200 z  300 ... where 100, 200, 300 are the values. I would like to know the distribution of my data? how can I fit my data into a distribution? Thanks a lot, Andra [[alternative HTML version deleted]]

Re: [R] Dropping columns from data frame

2012-01-06 Thread Mike Harwood
Thank you, David. I was merely using head to limit the code/ output. My question remains, because a created data frame has the same columns as was output from head: head(orig.df,3) num1.10 num11.20 lc1.10 lc11.20 uc1.10 uc11.20 1 1 11 a k A K 2 2

[R] Error using qda on the spambase training dataset

2012-01-06 Thread Ravi Kulkarni
Hello, I am trying to run the code for quadratic discriminant analysis with the Spambase data set following the code example in the book R in a Nutshell by Joseph Adler (page 443). The line of code: spam.qda - qda(formula=is_spam~., data=spambase.training)

Re: [R] What is wrong with this plotting?

2012-01-06 Thread Sarah Goslee
I think it's even simpler than that: plot(y~as.POSIXct(times, format=%d.%m. %H:%M), type=l, data=na.omit(data.frame(y,times))) This is using y from the data specification in the plot command (not the y in the base environment, or you'd be getting the same error), and data= is specifying the

Re: [R] Dropping columns from data frame

2012-01-06 Thread Sarah Goslee
On Fri, Jan 6, 2012 at 10:00 AM, Mike Harwood harwood...@gmail.com wrote: How does R do it, and should I ever be worried? You should be worried, but not about that.  I always remove columns by index, and it works exactly as I would naively expect - but HOW?  The second illustration, which

Re: [R] How to fit my data with a distribution?

2012-01-06 Thread R. Michael Weylandt michael.weyla...@gmail.com
MASS::fitdistr Michael On Jan 6, 2012, at 10:47 AM, Andra Isan andra_i...@yahoo.com wrote: Dear All, I have a bunch of data points as follows: x� 100 y� 200 z� 300 ... where 100, 200, 300 are the values. I would like to know the distribution of my data? how can I fit my data

Re: [R] Dropping columns from data frame

2012-01-06 Thread David Winsemius
On Jan 6, 2012, at 11:43 AM, Mike Harwood wrote: Thank you, David. I was merely using head to limit the code/ output. My question remains, because a created data frame has the same columns as was output from head: head(orig.df,3) num1.10 num11.20 lc1.10 lc11.20 uc1.10 uc11.20 1 1

Re: [R] data.frame: temporal complexity

2012-01-06 Thread ikuzar
Ok, thanks, it works ! -- View this message in context: http://r.789695.n4.nabble.com/data-frame-temporal-complexity-tp4269585p4270073.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] add data to a file while doing a loop

2012-01-06 Thread MacQueen, Don
Look at the documentation for whatever function you are using to write data to the file. It should be pretty obvious (look for an append argument). Otherwise you'll have to provide more information, such as a short simple example of what you have tried. -Don -- Don MacQueen Lawrence Livermore

[R] cbind alternate

2012-01-06 Thread Mary Kindall
I have two one dimensional list of elements and want to perform cbind and then write into a file. The number of entries are more than a million in both lists. R is taking a lot of time performing this operation. Is there any alternate way to perform cbind? x = table1[1:100,1] y =

Re: [R] RODBC installation: error message

2012-01-06 Thread Marc Schwartz
Hi Gregory, See below. On Jan 5, 2012, at 4:20 PM, gregory benison wrote: As Duncan noted, the message is pretty clear in that the ODBC header files are missing, which are required to compile RODBC from source. On RH based Linuxen, this requires the installation of the unixODBC-devel RPM,

Re: [R] Spatial data, rpoispp, using window with fixed radius?

2012-01-06 Thread MacQueen, Don
What's wrong with rpoispp in spatstat? It can simulate over a polygon, which can of course be used to closely approximate a circle. There is also spsample in the sp package. I'd also suggest asking this question on r-sig-geo. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East

[R] (Edited) cbind alternate for data frames

2012-01-06 Thread Mary Kindall
I have two dataframes and want to perform cbind and then write into a file. The number of entries are more than a million in both frames. R is taking a lot of time performing this operation. Is there any alternate way to perform cbind? x = table1[1:100,1:4] y = table2[1:100,3:6]

[R] Assign and cmpfun

2012-01-06 Thread Michael Pearmain
Hi All, I've just recently discovered the cmpfun function, and was wanting to to create a function to assign this to all the functions i have created, but without explicitly naming them. I've achieved this with: foo - function(x) { print(x)} bar - function(x) { print(x + 1)} foo - function(x)

Re: [R] data.frame: temporal complexity

2012-01-06 Thread MacQueen, Don
Something like this (not tested)? df$diffP - c(NA, NA, diff(df$P,2)) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 1/6/12 6:39 AM, ikuzar raz...@hotmail.fr wrote: Hello, I created a data.frame which contains two

Re: [R] How to fit my data with a distribution?

2012-01-06 Thread Andra Isan
That MASS::fitdistr is used for the case when I have some sense about the distribution of my data. When I do not know anything about my data, is there any function that can I use to tell what distribution of my data is? Thanks a lot, Andra From: R. Michael

Re: [R] (Edited) cbind alternate for data frames

2012-01-06 Thread MacQueen, Don
For me, this example runs in a fraction of a second: t1 - data.frame(matrix(rnorm(3e6),ncol=3)) t2 - data.frame(matrix(rnorm(3e6),ncol=3)) t3 - cbind(t1,t2) dim(t3) [1] 100 6 Maybe it takes longer if your data frames have other classes of objects in them. If some of your data frame

Re: [R] cbind alternate

2012-01-06 Thread Bos, Roger
You could break the data into chunks, so you cbind and save 50,000 observations at a time. That should be less taxing on your machine and memory. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mary Kindall Sent: Friday, January

Re: [R] How to fit my data with a distribution?

2012-01-06 Thread David Winsemius
On Jan 6, 2012, at 1:02 PM, Andra Isan wrote: That MASS::fitdistr is used for the case when I have some sense about the distribution of my data. When I do not know anything about my data, is there any function that can I use to tell what distribution of my data is? ?density

Re: [R] add data to a file while doing a loop

2012-01-06 Thread William Dunlap
Using append=TRUE in many functions will work, but more slowly than opening a connection once, writing to the connection many times, then closing it. (Opening a file is a pretty expensive operation, while writing to it is much cheaper.) Some more recently written functions do not have an append=

Re: [R] add data to a file while doing a loop

2012-01-06 Thread Joao Fadista
Thank you all for your useful replies. I got it to work! Best regards, João Fadista, Ph.D. Post Doc Lund University Diabetes Centre CRC, Malmö University Hospital Entrance 72, building 60, level 13 SE-205 02 Malmö, Sweden Tel: +46 (0)40 391237 e-mail: joao.fadi...@med.lu.se -Original

Re: [R] data.frame: temporal complexity

2012-01-06 Thread ikuzar
I did not test this way, I 'll do it later, I think that df$diffP - c(NA, NA, diff(df$P,2)) is the best way to compute the difference !! I 'll post the result here -- View this message in context: http://r.789695.n4.nabble.com/data-frame-temporal-complexity-tp4269585p4270256.html Sent from the

Re: [R] cbind alternate

2012-01-06 Thread Marc Schwartz
On Jan 6, 2012, at 11:43 AM, Mary Kindall wrote: I have two one dimensional list of elements and want to perform cbind and then write into a file. The number of entries are more than a million in both lists. R is taking a lot of time performing this operation. Is there any alternate way to

Re: [R] How to fit my data with a distribution?

2012-01-06 Thread Bert Gunter
except, of course, that the distributions of all finite sets of data are the same: discrete. I think Andra would do well to seek help from his/her local statistician, as his/her query seems to indicate considerable confusion about basic concepts. Please excuse me if I have misjudged. --

[R] Correlated count data technique advice

2012-01-06 Thread Lee Davis
Please excuse me for having posted a similar question on ecolog, but thus far I have received few useful answers there. I am looking for some advice concerning techniques in R that are appropriate for correlated count data. Specifically, I have some freezing days data, which is a count of the

Re: [R] cbind alternate

2012-01-06 Thread David Winsemius
On Jan 6, 2012, at 12:43 PM, Mary Kindall wrote: I have two one dimensional list of elements and want to perform cbind and then write into a file. The number of entries are more than a million in both lists. R is taking a lot of time performing this operation. Is there any alternate way

Re: [R] cbind alternate

2012-01-06 Thread Marc Schwartz
On Jan 6, 2012, at 12:39 PM, Marc Schwartz wrote: On Jan 6, 2012, at 11:43 AM, Mary Kindall wrote: I have two one dimensional list of elements and want to perform cbind and then write into a file. The number of entries are more than a million in both lists. R is taking a lot of time

[R] How to properly re-set a saved seed? I've got the answer, but no explanation

2012-01-06 Thread Paul Johnson
Hello, happy new year. I've come back to a problem from last spring. I need to understand what what is the technically correct method to save a seed and then re-set it. Although this example arises in the context of MT19937, I'm needing to do this with other generators as well, including

Re: [R] cbind alternate

2012-01-06 Thread Rui Barradas
Hello, I believe this function can handle a problem of that size, or bigger. It does NOT create the full matrix, just writes it to a file, a certain number of lines at a time. write.big.matrix - function(x, y, outfile, nmax=1000){ if(file.exists(outfile)) unlink(outfile) testf

Re: [R] How to properly re-set a saved seed? I've got the answer, but no explanation

2012-01-06 Thread Sarah Goslee
Hi Paul, Did you try looking at s1, or ?.Random.seed s1 - 444 set.seed(s1) will give you the same result as set.seed(444) but .Random.seed does not contain the seed (444), but the state of the RNG, and is an integer vector. You can save that state using s1 - .Random.seed and restore it

Re: [R] Assign and cmpfun

2012-01-06 Thread Duncan Murdoch
On 12-01-06 12:18 PM, Michael Pearmain wrote: Hi All, I've just recently discovered the cmpfun function, and was wanting to to create a function to assign this to all the functions i have created, but without explicitly naming them. I've achieved this with: foo- function(x) { print(x)} bar-

Re: [R] How to properly re-set a saved seed? I've got the answer, but no explanation

2012-01-06 Thread William Dunlap
In S+ you can do orig - .Random.seed x - runif(10) set.seed(orig) identical(x, runif(10)) # return TRUE because S+'s set.seed interprets a non-scalar input as a copy of an old .Random.seed and assigns it in the proper location. (It throws an error if it is not a valid value for

[R] Bootstrapping nlme models

2012-01-06 Thread lynnland
Hi, Let me start my saying that I am new to R hence my grasp of the appropriate used of R coding is undoubtedly way behind many on this forum. I am trying to use boostrapping to derive errors around my parameter estimate for the fixed effects in the following model. It is simply estimating the

Re: [R] cbind alternate

2012-01-06 Thread Rui Barradas
Sorry Mary, My function would write the remainder twice, I had only tested it with multiples of the chunk size. (And without looking at the lenghty output correctly.) Now checked: write.big.matrix - function(x, y, outfile, nmax=1000){ if(file.exists(outfile)) unlink(outfile) testf -

[R] Please help!! How do I set graphical parameters for ploting ctree()

2012-01-06 Thread Chris Conner
I'm trying to understand how to set graphical parameters for trees created with the party package.  For example take the following code:   library(party)     data(airquality)     airq - subset(airquality, !is.na(Ozone))     airct - ctree(Ozone ~ ., data = airq,    controls =

Re: [R] cbind alternate

2012-01-06 Thread jim holtman
What is it you want to do with the data after you save it? Are you just going to read it back into R? If so, consider using save/load. On Fri, Jan 6, 2012 at 12:43 PM, Mary Kindall mary.kind...@gmail.com wrote: I have two one dimensional list of elements and want to perform cbind and then

[R] Sweave Chunks

2012-01-06 Thread Riccardo Romoli
Hi, is there a way to collapse/expand the Sweave chunks? Best Riccardo __ 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/posting-guide.html and provide

Re: [R] Spatial data, rpoispp, using window with fixed radius?

2012-01-06 Thread Rolf Turner
On 07/01/12 02:17, herbert8...@gmx.de wrote: Dear All, I was searching through the spatstat manual in order to find a function to simulate a Poisson pattern only within a fixed radius (circular moving window) around individual points. If points are distributed heterogeneously over a large

Re: [R] RODBC installation: error message

2012-01-06 Thread gregory benison
1. If you do not have unixODBC installed, you will get an error message regarding a missing ODBC driver manager, if as you have done here, that test is first rather than second. If the test for the headers comes first, and no driver manager is installed, configure exits with an error before

[R] Getting a list of unique gene names from a list with semi-colons

2012-01-06 Thread Kurinji Pandiyan
Hello, I have one column in my dataframe that has gene names of interest. Unfortunately, due to the fact that some probes lie between two genes or two transcripts of a gene, it looks something like this - FAM81A LOC283050;LOC283050;LOC283050;ZMIZ1 PINK1;PINK1 MRPL12;MRPL12 C1orf114

Re: [R] Getting a list of unique gene names from a list with semi-colons

2012-01-06 Thread R. Michael Weylandt michael.weyla...@gmail.com
I think you can do this with something like this (untested): unique(unlist(strsplit(XXX, ,))) Michael On Jan 6, 2012, at 8:05 PM, Kurinji Pandiyan kurinji.pandi...@gmail.com wrote: Hello, I have one column in my dataframe that has gene names of interest. Unfortunately, due to the fact

Re: [R] Getting a list of unique gene names from a list with semi-colons

2012-01-06 Thread Gabor Grothendieck
On Fri, Jan 6, 2012 at 9:05 PM, Kurinji Pandiyan kurinji.pandi...@gmail.com wrote: Hello, I have one column in my dataframe that has gene names of interest. Unfortunately, due to the fact that some probes lie between two genes or two transcripts of a gene, it looks something like this -  

Re: [R] Getting a list of unique gene names from a list with semi-colons

2012-01-06 Thread R. Michael Weylandt michael.weyla...@gmail.com
Sorry. - that should be a semi-colon below. Michael Weylandt On Jan 6, 2012, at 8:17 PM, R. Michael Weylandt michael.weyla...@gmail.com michael.weyla...@gmail.com wrote: I think you can do this with something like this (untested): unique(unlist(strsplit(XXX, ,))) Michael On Jan 6,

Re: [R] Please help!! How do I set graphical parameters for ploting ctree()

2012-01-06 Thread David Winsemius
On Jan 6, 2012, at 6:09 PM, Chris Conner wrote: I'm trying to understand how to set graphical parameters for trees created with the party package. For example take the following code: library(party) data(airquality) airq - subset(airquality, !is.na(Ozone)) airct - ctree(Ozone ~

[R] Putting an index explicitly into function code --- a curiosity.

2012-01-06 Thread Rolf Turner
I want to create a list of functions in a for loop, with the index of the loop appearing explicitly in the function code. After quite a bit of thrashing around I figured out how to do it. Here is a toy example: junk - vector(list,4) for(i in 1:4) { itmp - i junk[[i]] -

Re: [R] Putting an index explicitly into function code --- a curiosity.

2012-01-06 Thread R. Michael Weylandt michael.weyla...@gmail.com
I imagine the answer will involve lazy evaluation and require you use force() but I'm not quite qualified to pronounce and not at a computer to test. Michael On Jan 6, 2012, at 8:43 PM, Rolf Turner rolf.tur...@xtra.co.nz wrote: I want to create a list of functions in a for loop, with the

Re: [R] Putting an index explicitly into function code --- a curiosity.

2012-01-06 Thread David Winsemius
On Jan 6, 2012, at 9:51 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: I imagine the answer will involve lazy evaluation and require you use force() but I'm not quite qualified to pronounce and not at a computer to test. Your theory passes the experimental test: for(i in

Re: [R] Putting an index explicitly into function code --- a curiosity.

2012-01-06 Thread Rolf Turner
On 07/01/12 15:51, R. Michael Weylandt michael.weyla...@gmail.com wrote: I imagine the answer will involve lazy evaluation and require you use force() but I'm not quite qualified to pronounce and not at a computer to test. I think you've got it; I tried junk - vector(list,4) for(i in 1:4) {

Re: [R] Putting an index explicitly into function code --- a curiosity.

2012-01-06 Thread Gabor Grothendieck
On Fri, Jan 6, 2012 at 9:43 PM, Rolf Turner rolf.tur...@xtra.co.nz wrote: I want to create a list of functions in a for loop, with the index of the loop appearing explicitly in the function code. After quite a bit of thrashing around I figured out how to do it. Here is a toy example: junk

Re: [R] Putting an index explicitly into function code --- a curiosity.

2012-01-06 Thread R. Michael Weylandt
Presumably because the i = 4 has to be re-evaluated at the start of each iteration of the while-loop which implicitly force()s it? Though, I don't know if it might not be a bad idea to put an implicit force() in the internal code for `for` to prevent these sorts of things. I can't immediately

Re: [R] Putting an index explicitly into function code --- a curiosity.

2012-01-06 Thread Gabor Grothendieck
On Fri, Jan 6, 2012 at 11:13 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: Presumably because the i = 4 has to be re-evaluated at the start of each iteration of the while-loop which implicitly force()s it? Though, I don't know if it might not be a bad idea to put an implicit