[R] how to get the rows that satisfy a specific condition

2014-09-26 Thread Fix Ace
Hello, there, I wonder if there is an easier way that I would only get the rows that satisfies some condition. For example:I have the following matrix, and I would like to output only the 3rd row and 4th row, since only these two rows contain the numbers greater than 11 > a [,1] [,2] [,3] [

[R] quadprog::solve.QP sometimes returns NaNs

2014-09-26 Thread Benjamin Tyner
Hello, Here is an example; hopefully it is reproducible on others' platform: library(quadprog) n <- 66L set.seed(6860) X <- matrix(1e-20, n, n) diag(X) <- 1 Dmat <- crossprod(X) y <- seq_len(n) dvec <- crossprod(X, y) Amat <- diag(n) bvec <- y + runif(n)

Re: [R] Savitzky-Golay Smoother

2014-09-26 Thread Gabor Grothendieck
On Fri, Sep 26, 2014 at 3:32 AM, Erick Okuto wrote: > Dear Paul and Henrik, > I have a time series with some missing data points that i need smoothed > using Savitzky-Golay filter. Related question was asked here > http://thr3ads.net/r-help/2012/11/2121748-Savitzky-Golay-filtering-with-missing-da

Re: [R] Median of streaming data

2014-09-26 Thread Rolf Turner
On 26/09/14 21:48, Martin Maechler wrote: Rolf Turner > I have coded up the algorithm from the Cameron and Turner > paper. Dunno if it gives exactly the same results as my > (Splus?) code from lo these many years ago (the code that > is lost in the mists of time), but

Re: [R] Histogram from a single column of a data frame

2014-09-26 Thread Rolf Turner
On 27/09/14 05:57, Richard Lerner wrote: Column 7 of "oded" is "Breed". If I enter summary(Breed) I get the counts of the numbers in each breed. However, if I enter I have tried hist($Breed) Error: unexpected '$' in "hist($" hist(Breed) Error in hist(Breed) : object 'Breed' not found

Re: [R] Histogram from a single column of a data frame

2014-09-26 Thread William Dunlap
Try hist(oded$Breed) (I suspect that summary(Breed) does not work in your current session either - perhaps you had a dataset named just Breed or had attached the data.frame oded in the session where summary(Breed) works.) Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Sep 26, 2014 at 10

Re: [R] Help with conversion of variable labels (Hmisc and Epicalc)

2014-09-26 Thread David Winsemius
On Sep 26, 2014, at 4:21 AM, Otto Pichlhöfer wrote: For my epidemiological analysis I use the packages Epicalc and Hmisc – among others. Both packages allow to assign variable labels that will appear in the output of the respective packages’ own functions. The modes of storage of the labels

[R] Histogram from a single column of a data frame

2014-09-26 Thread Richard Lerner
Column 7 of "oded" is "Breed". If I enter > summary(Breed) I get the counts of the numbers in each breed. However, if I enter I have tried > hist($Breed) Error: unexpected '$' in "hist($" > hist(Breed) Error in hist(Breed) : object 'Breed' not found > hist("Breed") Error in hist.default("Breed

Re: [R] Savitzky-Golay Smoother

2014-09-26 Thread Paul Kienzle
You can perform the equivalent filtering by hand using something like: k = (window_length - 1) / 2 for i in k to len(x) - k xh,yh = x[points-k:points+k], y[points-k:points+k] idx = isfinite(xh) and isfinite(yh) xh,yh = xh[idx],yh[idx] p = polyfit(xh,yh, degr

[R] question regarding pcalg package

2014-09-26 Thread Jack Luo
Hi, I am trying to use the pcalg package to do some causal inference on some high dimensional omics data (~ 30k variables). It takes forever to run and my machine get stuck. I just realized that conditional independence test can be calculated without using the correlation matrix (I think it's just

[R] package loadable in R 3.1.1 Rterm but not in emacs/ESS

2014-09-26 Thread Christopher W Ryan
I'm running R on Windows 7. Clean install on a brand new computer yesterday. I installed Protext then R then Vincent Goulet's emacs with ESS, in that order. I then installed some R packages, in the R terminal window. Among them was car Today I opened emacs, hit M-x R to start an R session, and

Re: [R] Help with conversion of variable labels (Hmisc and Epicalc)

2014-09-26 Thread David Winsemius
On Sep 26, 2014, at 3:21 AM, Otto Pichlhöfer wrote: > For my epidemiological analysis I use the packages Epicalc and Hmisc – > among others. Both packages allow to assign variable labels that will > appear in the output of the respective packages’ own functions. The modes > of storage of the l

[R] [rJava] RJavaClassLoader and system classloader

2014-09-26 Thread Benoît Thiébault
Hi everyone, I want to call a Java application from R and have encountered some problems with the way rJava deals with the system class loader. To run my application, I use the following R script: > library(rJava) > .jinit() > .jaddClassPath("myApp.jar") > rWrapper <- .jnew("org/test/RWrapper")

[R] Savitzky-Golay Smoother

2014-09-26 Thread Erick Okuto
Dear Paul and Henrik, I have a time series with some missing data points that i need smoothed using Savitzky-Golay filter. Related question was asked here http://thr3ads.net/r-help/2012/11/2121748-Savitzky-Golay-filtering-with-missing-data but no straight forward answer was posted. However, Henrik

[R] Help with conversion of variable labels (Hmisc and Epicalc)

2014-09-26 Thread Otto Pichlhöfer
For my epidemiological analysis I use the packages Epicalc and Hmisc – among others. Both packages allow to assign variable labels that will appear in the output of the respective packages’ own functions. The modes of storage of the labels in a dataframe are very different. I am wonderiung if t

Re: [R] Can't seem to get lapply to work.

2014-09-26 Thread Keith S Weintraub
Jeff, Of course a data.frame is a list of columns. Duh! Sorry about that. Was working about 10 hours straight. Also sorry about the excess attributes. They were created by via expand.grid. Here is my current solution which seems to be working: lapply(1:nrow(tstSet), function(x, y, z) oneRun

Re: [R] Performance (speed) of ggplot

2014-09-26 Thread ONKELINX, Thierry
You are using ggplot2 very inefficiently. Many geom's plot only one data point. You can combine several of them in a single geom. Have a look at this gridExtra package which has some useful functions like grid.arrange and tableGrob. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en b

Re: [R] Performance (speed) of ggplot

2014-09-26 Thread PIKAL Petr
Hi I will second Jeff. If you want several plots on one page it could be more convenient to use standard plot. see ?layout or ?split.screen for complex figures or ?par mfrow for simple layout. In all cases it is difficult to combine base and grid graphics though. Regards Petr > -Origina

Re: [R] Median of streaming data

2014-09-26 Thread Martin Maechler
> Rolf Turner > on Thu, 25 Sep 2014 11:44:38 +1200 writes: > On 24/09/14 20:16, Martin Maechler wrote: >> 1) has your proposal ever been provided in R? I'd be >> happy to add it to the robustX >> (http://cran.ch.r-project.org/web/packages/robustX) or >> even rob

Re: [R] error in rownames

2014-09-26 Thread PIKAL Petr
Hi. Partly. You got response from David regarding HTML formating. I polished scrammbled text but I got > AsciiGridImpute(type.rf, xfile, outfile) Error in file(xfiles[[i]], open = "rt") : cannot open the connection In addition: Warning message: In file(xfiles[[i]], open = "rt") : cannot open f