[R] remove column

2012-08-25 Thread Kate Dresh
*Hi all,* I'm trying to filter a file through the columns. This file below is a example of my data frame. My true data frame has seven hundred thousand columns and 500 hundred lines. I need to identify and to remove all columns that all elements equal a number 1. In this my case, columns were

[R] Turning of source echo

2012-08-25 Thread darnold
HI, I have this code: BAGA - c(10,20,20,30,30,30,30,40, 40,40,40,50,50,50,50,50, 60,60,60,60,60,70,70,70, 70,80,80,80,90,90,100) BAGB - c(10,10,10,10,10,20,20,20, 20,30,30,30,40,40,50,60, 70,70,80,80,80,90,90,90,

[R] extract vector elements of unknown range

2012-08-25 Thread Sepp Tannhuber
Dear all, I have two vectors   x - c(1:20)   y - c(1,5,10,14) Now I would like to extract   x[ (y[n] + 2):(y[n+1] - 1) ] for all elements except last one in y. This means I want to have   x[ c( (y[1]+2):(y[2]-1), (y[2]+2):(y[3]-1), (y[3]+2):(y[4]-1) ) ] How is this possible if y is a vector of

Re: [R] mgcv package, problems with NAs in gam

2012-08-25 Thread Bert Gunter
Grace: Confession: I loved that error message! -- and it seems pretty clear to me. What does to no avail mean -- in particular, what happened when you changed your NA's to 0? Presumably you did not get the same error message, again, but something else, right? What else? Modulo the above

Re: [R] kernlab | ksvm error

2012-08-25 Thread Reza Salimi-Khorshidi
Dear Uwe, I appreciate that if you let me know why, when using the attached file, the following script (two lines) doesn't work once in 10s of times. Best, Reza svm.pol4 - ksvm(class.labs ~ ., data = train.data, prob.model = T, scale = T, kernel = polydot) svm.pol.prd4 - predict(svm.pol4,

[R] How to arrange the GUI's in window in tcltk package???

2012-08-25 Thread punitha
Hi, I am new to R, I need your help. I have been said to create a GUI in R, I started using Tcltk package which was very easy to learn and code, but i am unable to arrange the GUI's in proper order in the window they are always arranged one below the other, please can anyone

Re: [R] remove column

2012-08-25 Thread Berend Hasselman
On 25-08-2012, at 02:11, Kate Dresh wrote: *Hi all,* I'm trying to filter a file through the columns. This file below is a example of my data frame. My true data frame has seven hundred thousand columns and 500 hundred lines. I need to identify and to remove all columns that all

Re: [R] Turning of source echo

2012-08-25 Thread Noia Raindrops
Hi, ?cat Read item sep in argument section. And try: cat(X = , B, sep = ) -- Noia Raindrops noia.raindr...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] extract vector elements of unknown range

2012-08-25 Thread Noia Raindrops
Hi, try below: x - c(1:20) y - c(1, 5, 10, 14) x[ c( (y[1]+2):(y[2]-1), (y[2]+2):(y[3]-1), (y[3]+2):(y[4]-1) ) ] x[unlist(lapply(1:(length(y) - 1), function (i) (y[i] + 2) : (y[i + 1] - 1)))] x[unlist(mapply(seq, y[-length(y)] + 2, y[-1] - 1, SIMPLIFY = FALSE))] -- Noia Raindrops

Re: [R] How to arrange the GUI's in window in tcltk package???

2012-08-25 Thread steven mosher
1. get programming grapgical user interfaces in R. lawrence and verzani. 2. if you used gwidgets on gtk i could tell you exactly what to do. 3. with the toolkit youve selected i think tlpack controls the way children are placed in a container. default is top to bottom On Aug 24, 2012 11:27 PM,

Re: [R] remove column

2012-08-25 Thread arun
Hello, Try this: idx-sapply(file,function(x) all(unique(x)==1)) file[!idx] #  V2 V3 V4 V6 V7 V8 V9 #1  0  2  2  1  5  1  1 #2  0  2  2  1  5  1  1 #3  0  2  2  2  5  2  2 #4  0  2  2  1  5  1  1 #5  0  2  2  0  5  0  2 #6  0  2  2  1  5  1  0 A.K. - Original Message - From: Kate Dresh

Re: [R] mgcv package, problems with NAs in gam

2012-08-25 Thread grace
I've attached the data to this message. http://r.789695.n4.nabble.com/file/n4641291/2005pip.csv 2005pip.csv -- View this message in context: http://r.789695.n4.nabble.com/mgcv-package-problems-with-NAs-in-gam-tp4641253p4641291.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] POSIXct-coerced NA's not considered NA by is.na()

2012-08-25 Thread jim holtman
If you are going to convert a column from character to POSIXct, I would assume that you would do it this way and get the results that you want: x - data.frame(times = c('2012-08-14 12:00', '2011-01-04 08:00', 'b') + , stringsAsFactors = FALSE + ) x times 1 2012-08-14 12:00

Re: [R] mgcv package, problems with NAs in gam

2012-08-25 Thread Simon Wood
'gam' doesn't know what to do with the model formula '1 ~ 1' (i.e. one tilde one). What is it supposed to mean? 'glm' also does nothing meaningful in this case... ## code to load you data file into 'dat' omitted model-glm(1~1, data=dat) model Call: glm(formula = 1 ~ 1, data = dat)

Re: [R] extract vector elements of unknown range

2012-08-25 Thread Sepp Tannhuber
Hi, thanks for your quick answers! These solve my problem. Now I have another question. I think I can use    head(y, -1) instead of   y[-length(y)] Are there differences in terms of performance? Best regards Joseph __ R-help@r-project.org mailing

Re: [R] How to arrange the GUI's in window in tcltk package???

2012-08-25 Thread punitha
Thank you steven, tkpack is helping me in arranging the components in container. and yes, i went through gwidgets package, i found it also good to design GUI in R. -- View this message in context:

[R] sourcecode for the balloonplot function from the gplots package

2012-08-25 Thread ravi
Hi, I want to take a look at the sourcecode for balloonplot. I would appreciate it if I could get help on overcoming the following problem : methods(balloonplot) [1] balloonplot.default* balloonplot.table*      Non-visible functions are asterisked balloonplot.default Error: object

Re: [R] [Rd] Suggestion for Writing R Extensions

2012-08-25 Thread Duncan Murdoch
On 12-08-22 5:32 PM, Rui Barradas wrote: Hello, It makes sense. And should be easy to change. I don't think it is easy to change. The Extensions manual doesn't have access to the numbering (er, lettering) of appendices in the other manual. So we'd have to hard code A and D, and we don't

[R] fourier analysis

2012-08-25 Thread mpkamath
I have an intensity pattern of the laser beam at the image plane of a optical relay cum spatial filtering system. I wish to know the field and intensity distribution at the spatial filtering plane. Requesting suggestions. -- View this message in context:

Re: [R] date

2012-08-25 Thread arun
HI, Try this: dat1-01/04/2006 1:10:60 PM  dat1-as.character(dat1)  strptime(dat1,%m/%d/%Y %I:%M:%S %p)$yday+1 #[1] 4 A.K. - Original Message - From: Veerappa Chetty chett...@gmail.com To: r-help@r-project.org Cc: Sent: Friday, August 24, 2012 11:30 PM Subject: [R] date Hi, I have

Re: [R] mgcv package, problems with NAs in gam

2012-08-25 Thread grace
Hi Simon, I'm trying to fit a negative binomial gam with no covariates, that therefore looks at the detection/non-detection data and nothing else. I thought having 1~1 as formula would allow the model to just estimate occurrence without looking at relationship between variables. On 25 Aug

Re: [R] How to arrange the GUI's in window in tcltk package???

2012-08-25 Thread jverzani
punitha punitha.c87 at wipro.com writes: Thank you steven, tkpack is helping me in arranging the components in container. and yes, i went through gwidgets package, i found it also good to design GUI in R. Try `tkraise`: library(tcltk) w1 - tktoplevel() tkpack(ttkbutton(w1, text=w1,

Re: [R] extract vector elements of unknown range

2012-08-25 Thread William Dunlap
Using system.time() you can check out the performance yourself. E.g., the following compares head(y,-1), y[-length(y)], and y[seq_len(length(y)-1))]. y - 1:10 all.equal(head(y,-1), y[-length(y)]) [1] TRUE all.equal(head(y,-1), y[seq_len(length(y)-1)]) [1] TRUE

Re: [R] extract vector elements of unknown range

2012-08-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 25, 2012, at 4:23 AM, Sepp Tannhuber sepp.tannhu...@yahoo.de wrote: Hi, thanks for your quick answers! These solve my problem. Now I have another question. I think I can use head(y, -1) instead of y[-length(y)] Are there differences in terms of performance? The latter

Re: [R] sourcecode for the balloonplot function from the gplots package

2012-08-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
Use getAnywhere() or getS3method(). Michael On Aug 25, 2012, at 4:13 AM, ravi rv...@yahoo.se wrote: Hi, I want to take a look at the sourcecode for balloonplot. I would appreciate it if I could get help on overcoming the following problem : methods(balloonplot) [1] balloonplot.default*

Re: [R] extract vector elements of unknown range

2012-08-25 Thread Noia Raindrops
Hi, Yes you can. As William says, the 'seq_len' approach seems to be better. 'head' function is the wrapper for 'seq_len' approach and slower. I didn't know that '-length(x)' approach is slow for long vectors -- Noia Raindrops noia.raindr...@gmail.com

Re: [R] sourcecode for the balloonplot function from the gplots package

2012-08-25 Thread Noia Raindrops
Use triple colon operator: gplots:::balloonplot.default -- Noia Raindrops noia.raindr...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] NLS bi exponential Fit

2012-08-25 Thread vincent guyader
thanks it seems to be a good idea. a also find the PK package with the biexp function. 2012/8/23 Peter Ehlers ehl...@ucalgary.ca Have you checked help(SSbiexp) ? Peter Ehlers On 2012-08-23 04:54, vincent guyader wrote: Hi everyone, I'm trying to perform a bi exponential Fit with

Re: [R] Turning of source echo

2012-08-25 Thread darnold
Noia, Nope. Although sep is helpful for my output, I still get that source echo that I want to suppress. Here is the code with Noia's suggestion. BAGA - c(10,20,20,30,30,30,30,40, 40,40,40,50,50,50,50,50, 60,60,60,60,60,70,70,70, 70,80,80,80,90,90,100) BAGB -

Re: [R] Turning of source echo

2012-08-25 Thread Noia Raindrops
Sorry, How about this? invisible(capture.output(source(...))) # or sink(/dev/null) source(...) sink() -- Noia Raindrops noia.raindr...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Turning of source echo

2012-08-25 Thread Berend Hasselman
On 25-08-2012, at 21:31, Noia Raindrops wrote: Sorry, How about this? invisible(capture.output(source(...))) Makes all output invisible. # or sink(/dev/null) source(...) sink() Doesn't seem to do what is desired. The line with source still appears. In future would you please

Re: [R] Turning of source echo

2012-08-25 Thread Berend Hasselman
On 25-08-2012, at 17:59, darnold wrote: Noia, Nope. Although sep is helpful for my output, I still get that source echo that I want to suppress. Here is the code with Noia's suggestion. BAGA - c(10,20,20,30,30,30,30,40, 40,40,40,50,50,50,50,50,

Re: [R] Turning of source echo

2012-08-25 Thread darnold
Berend, Yes, I did ask this question on RStudio help page. Josh suggested that I try to find some package that pops up a window with the results I want. Anyone know how to do that? Is there a package or a tutorial that will instruct me as to how to do that? Here is my code: BAGA -

Re: [R] Turning of source echo

2012-08-25 Thread David L Carlson
This is not an RStudio issue. The RConsole echoes commands and then the output. If you want to open a window to display the output of a command, you might look at package tcltk. -- David L Carlson Associate Professor of Anthropology Texas AM University

Re: [R] sourcecode for the balloonplot function from the gplots package

2012-08-25 Thread Peter Ehlers
On 2012-08-25 09:30, Noia Raindrops wrote: Use triple colon operator: gplots:::balloonplot.default To the OP: You'll probably find it easier to decipher the code if you have access to the included comments. For that, download the source file (gplots_2.11.0.tar.gz) from CRAN and unzip with

[R] Standard deviation from MANOVA??

2012-08-25 Thread BrutishFruit
Hi, I have problem getting the standard deviation from the manova output. I have used the manova function: myfit - manova(cbind(y1, y2) ~ x1 + x2 + x3, data=mydata) . I tried to get the predicted values and their standard deviation by using: predict(myfit, type=response,

Re: [R] help with a special variant of balloonplot

2012-08-25 Thread Peter Ehlers
On 2012-08-24 09:12, ravi wrote: Hi, I am interested in implementing a special variant of balloonplot. Let me explain with an example dataset from the reference manual : library(gplots) data(Titanic) dframe-as.data.frame(Titanic) survived-dframe[dframe$Survived==Yes,] attach(survived)

[R] Comparing two variables for match and creating a new vector with results

2012-08-25 Thread inti luna
Hello, I need help comparing two variables and producing a third variable with the result.I have this data: id -c(1,2,3,4,5,6,7,8,9,10) vi -c(1,0,1,1,1,1,1,2,2,0) vi2 -c(0,1,1,1,1,1,1,2,0,0) data-cbind(id,vi,vi2) For the data in the example, I need to generate: id -c(1,2,3,4,5,6,7,8,9,10)

[R] Drawing a simplex

2012-08-25 Thread Chel Hee Lee
I will very appreciate if anyone can provide some materials to draw a simplex plot of a Dirichlet distribution in R as shown in the page at http://en.wikipedia.org/wiki/File:Dirichlet_distributions.png . __ R-help@r-project.org mailing list