Re: [R] merge function

2011-06-30 Thread Jeff Newmiller
You haven't provided a reproducible example. I do notice you are using T and F which are variables that can be redefined (which is why TRUE and FALSE are preferred. --- Jeff Newmiller The . . Go Live... DCN: Basics: #

Re: [R] merge function

2011-06-30 Thread Downey, Patrick
I was mistaken. There were duplicates in my y vector. Please ignore my previous message. Sorry. -Original Message- From: Downey, Patrick Sent: Thu 6/30/2011 11:08 PM To: r-help@r-project.org Subject: merge function Hello, I'm clearly confused about the merge function. In the following

[R] merge function

2011-06-30 Thread Downey, Patrick
Hello, I'm clearly confused about the merge function. In the following r <- merge(x,y,all.x=T,all.y=F) my y vector has only unique values (no duplicates). So I don't understand how this can ever generate an r which is of greater length than x. I thought the default behavior was only matching r

Re: [R] Looking for Filliben (correlation test)

2011-06-30 Thread Thomas . Adams
- Original Message - From: gaiarrido Date: Thursday, June 30, 2011 1:11 pm Subject: Re: [R] Looking for Filliben (correlation test) To: r-help@r-project.org Mario, I did a google search and found this: http://genepi.qimr.edu.au/staff/davidD/R/filliben.R Cheers! Tom > Thanks very much

Re: [R] highlighting clusters in a heatmap

2011-06-30 Thread David Winsemius
On Jun 30, 2011, at 8:02 PM, Levi Waldron wrote: I would like to draw horizontal or vertical lines on a heatmap to highlight the clusters at some specified cut depth of the dendrogram. As a hacked example, the following code would work if I could set the coordinates of the top and bottom of the

Re: [R] source, echo...and clicking the mouse

2011-06-30 Thread Steven Wolf
Ok, I think I see how flush.console() works. Just put it in and whatever has been done so far (and stored in the buffer) pops out. Unfortunately, I'm doing an optimization, and the process is slow. So that is where the "Misc|Buffered output" option is helpful. Thanks! -Steve -Original Mess

[R] highlighting clusters in a heatmap

2011-06-30 Thread Levi Waldron
I would like to draw horizontal or vertical lines on a heatmap to highlight the clusters at some specified cut depth of the dendrogram. As a hacked example, the following code would work if I could set the coordinates of the top and bottom of the false color image correctly (ymin and ymax), but the

[R] testInstalledBasic

2011-06-30 Thread Cody Hamilton
Hello, I installed R 2.13.0 on a Windows 2003 server.  I downloaded the Rtools213.exe from http://www.murdoch-sutherland.com/Rtools/ and placed it in the path (C:\Program Files\R\R-2.13.0\bin). I submitted the following code: library(tools) Sys.setenv(LC_COLLATE=C) testInstalledBasic('basic')

Re: [R] Error "singular gradient matrix at initial parameter estimates" in nls

2011-06-30 Thread Walmes Zeviani
I think that these aren't good initial values. If you do a plot of data and add a curve, the curve don't approximate the data. Frequently I use interactive procedures to get good initial values. Using playwith() you can handle sliders to adjust values and use in nls(), look the following r <- c(1.

Re: [R] Points but no lines in qplot.

2011-06-30 Thread Ashim Kapoor
This is probably due to a numerical value that is coded as a factor. Have a look at the example below. > In ggplot2 one line per group is plotted. The default grouping is the > combination of all factors. In the first example only B, in the second and > third example both A and B. This leaves just

Re: [R] source, echo...and clicking the mouse

2011-06-30 Thread Duncan Murdoch
On 30/06/2011 5:33 PM, Greg Snow wrote: On some operating systems (which we don't know yours, see the posting guide) the output is buffered and including a call to flush.console() will flush all the output from the buffer to the console. Put the function call throughout the script and when it

Re: [R] storing the return of system() function

2011-06-30 Thread Marc Schwartz
On Jun 30, 2011, at 4:55 PM, John Dennison wrote: > To get the tech specs out of the way I am running Rstudio(R 2.13.0) on a > ubuntu box. I am trying to use information returned from the system command > within an Rscript. System() passes commands to my ubuntu prompt and returns > the normal mess

[R] storing the return of system() function

2011-06-30 Thread John Dennison
To get the tech specs out of the way I am running Rstudio(R 2.13.0) on a ubuntu box. I am trying to use information returned from the system command within an Rscript. System() passes commands to my ubuntu prompt and returns the normal messages. For example. > system("date")Thu Jun 30 21:48:20 UTC

Re: [R] source, echo...and clicking the mouse

2011-06-30 Thread Greg Snow
On some operating systems (which we don't know yours, see the posting guide) the output is buffered and including a call to flush.console() will flush all the output from the buffer to the console. Put the function call throughout the script and when it is run it will stop buffering for a bit.

Re: [R] source, echo...and clicking the mouse

2011-06-30 Thread David Winsemius
On Jun 30, 2011, at 5:15 PM, Steven Wolf wrote: How does flush.console() work? Am I supposed to put anything in the parentheses? How could you? It has no arguments. -- David. When I type it in I get: flush.console() NULL Thanks, -Steve -Original Message- From: David Winsemius

Re: [R] source, echo...and clicking the mouse

2011-06-30 Thread Steven Wolf
How does flush.console() work? Am I supposed to put anything in the parentheses? When I type it in I get: > flush.console() NULL Thanks, -Steve -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Thursday, June 30, 2011 4:40 PM To: Steven Wolf Cc: r-help@r-pr

Re: [R] sdev value returned by princomp function (used for PCA)

2011-06-30 Thread peter dalgaard
On Jun 30, 2011, at 21:48 , Coghlan, Avril wrote: > > Dear all, > > I have a question about the 'sdev' value returned by the princomp function > (which does principal components analysis). > > On the help page for princomp it says 'sdev' is 'the standard deviations of > the principal compone

Re: [R] source, echo...and clicking the mouse

2011-06-30 Thread David Winsemius
On Jun 30, 2011, at 4:16 PM, Steven Wolf wrote: I'm attempting to view the progress of a script that I call on my screen as follows: source("myscript.R", echo=TRUE) When it is running, I have to click my mouse in the GUI window for anything to show up. I am wondering if I can change som

[R] source, echo...and clicking the mouse

2011-06-30 Thread Steven Wolf
I'm attempting to view the progress of a script that I call on my screen as follows: source("myscript.R", echo=TRUE) When it is running, I have to click my mouse in the GUI window for anything to show up. I am wondering if I can change something so that it writes to my GUI window automati

Re: [R] Sum Question

2011-06-30 Thread Dennis Murphy
Hi: Here's a data.table solution. After I read in your data as a data frame named dd, I used str() to check its contents: > str(dd) 'data.frame': 19 obs. of 5 variables: $ RID : int 43 95 230 230 235 235 247 247 321 321 ... $ SCRNO : Factor w/ 6 levels "HBA0020036","HBA0020087",..: 1 2

Re: [R] R 2.13 installation

2011-06-30 Thread peter dalgaard
On Jun 30, 2011, at 18:08 , Paul J. Ossenbruggen wrote: > I installed R 2.13 on my Power PC (32 bit). The installation responds with > the message; "Installed Successfully." R opens normally. > > When I attempt a simple example, like adding two numbers, it fails to > respond. I must use Force

Re: [R] sdev value returned by princomp function (used for PCA)

2011-06-30 Thread Sarah Goslee
Hi, What you want is this: > myPCA.cor <- princomp(scaledUSArrests, cor=TRUE) > myPCA.cor$sdev Comp.1Comp.2Comp.3Comp.4 1.5748783 0.9948694 0.5971291 0.4164494 > or alternatively > myPCA2 <- prcomp(scaledUSArrests) > myPCA2$sdev [1] 1.5748783 0.9948694 0.5971291 0.4164494 See th

[R] sdev value returned by princomp function (used for PCA)

2011-06-30 Thread Coghlan, Avril
Dear all, I have a question about the 'sdev' value returned by the princomp function (which does principal components analysis). On the help page for princomp it says 'sdev' is 'the standard deviations of the principal components'. However, when I calculate the principal components for the US

Re: [R] Error "singular gradient matrix at initial parameter estimates" in nls

2011-06-30 Thread Peter Ehlers
On 2011-06-30 06:14, Niklaus Hurlimann wrote: Greetings, I am struggling a bit with a non-linear regression. The problem is described below with the known values r and D inidcated. I tried to alter the start values but get always following error message: Error in nlsModel(formula, mf, start, wt

Re: [R] Querying the path separator?

2011-06-30 Thread Duncan Murdoch
On 30/06/2011 3:32 PM, Jonathan Greenberg wrote: Unfortunately, no. .Platform$file.sep on a windows box is the "/". For this DOS program it needs to be the "classic" backslash. Ok, we'll hack this a bit (query the platform and test if it is windows), but now I'm running into escape character pr

Re: [R] Querying the path separator?

2011-06-30 Thread Jonathan Greenberg
Unfortunately, no. .Platform$file.sep on a windows box is the "/". For this DOS program it needs to be the "classic" backslash. Ok, we'll hack this a bit (query the platform and test if it is windows), but now I'm running into escape character problems. Given: files1="*.las" files1_formatted=fi

Re: [R] Analysing insecticide biossays using lmer

2011-06-30 Thread Ben Bolker
pierricklabbe univ-montp2.fr> writes: > > Hi all, > > Here is my problem: I performed bioassays using a unique insecticide on 9 > different genotypes and got their mortality depending on the dose of > insecticide used. > Now, I want to see wether some genotypes are different or not in their > r

Re: [R] Testing the proportional odds assumption of an ordinal generalized estimating equations (GEE) regression model

2011-06-30 Thread Rune Haubo
If you are willing to leave the GEE world and use a mixed effects version of the proportional odds model, then you can test the proportional odds assumption with the clmm function in package ordinal. You simply include those variables for which you want to test the assumption in the nominal formula

Re: [R] Italicized greek symbols in PDF plots

2011-06-30 Thread Sam Albers
Thanks for the response Dr. Ripley. Much appreciated. On Wed, Jun 29, 2011 at 10:17 PM, Prof Brian Ripley wrote: > On Wed, 29 Jun 2011, Sam Albers wrote: > > I know that this has been asked before in other variations but I just >> can't >> seem to figure out my particular application from previo

Re: [R] Rmpi fails to install

2011-06-30 Thread Juergen Rose
Hi, I was just able to install the patched Rmpi on the second system with openmpi-1.5.3. What can we that Rmpi_0.5-9a.tar.gz becomes a standard CRAN package? Regards Juergen Am Freitag, den 17.06.2011, 13:28 +0200 schrieb Hugo Mildenberger: > Juergen, > > > I try to install Rmpi as root with in

[R] Zero Inflated Models - Plotting Results

2011-06-30 Thread SamiC
Hi, I am fitting a zero inflated negative binomial model to my data. I have pretty much got my selected model and now i am wanting to plot the model to the origional data. Example. f8<-formula(Birds~Tide+Fish+Zooplankton+Chlorophylla|StratificationIndex) Nb8<-zeroinfl(f8, dist="negbin", link= "

Re: [R] Sum Question

2011-06-30 Thread Marc Schwartz
On Jun 30, 2011, at 12:30 PM, Marc Schwartz wrote: > On Jun 30, 2011, at 11:20 AM, Edgar Alminar wrote: > I did this: library(data.table) dd <- data.table(bl) dd[,sum(as.integer(CONTTIME)), by = SCRNO] (I used as.integer because I got an error message:

Re: [R] Saving fExtremes estimates and k-block return level with confidence intervals.

2011-06-30 Thread Peter Maclean
Jorge: Thanks it works perfectly.   From: Jorge Ivan Velez Cc: R mailing list Sent: Thu, June 30, 2011 2:37:33 AM Subject: Re: [R] Saving fExtremes estimates and k-block return level with confidence intervals. Hi Peter, Try  data.frame(n = names(res2),

Re: [R] Sum Question

2011-06-30 Thread Marc Schwartz
On Jun 30, 2011, at 11:20 AM, Edgar Alminar wrote: >>> I did this: >>> >>> library(data.table) >>> >>> dd <- data.table(bl) >>> dd[,sum(as.integer(CONTTIME)), by = SCRNO] >>> >>> (I used as.integer because I got an error message: sum not meaningful for >>> factors) >>> >>> And got this: >>>

Re: [R] very large pair() plot

2011-06-30 Thread Greg Snow
In addition to Uwe's answer, you might also want to consider the pairs2 function in the TeachingDemos package. It lets you plot sections of the overall scatterplot matrix rather than the whole thing, so you could spread the entire scatterplot matrix over multiple pages. -- Gregory (Greg) L. S

Re: [R] Expected Value of Normal Order Statistics

2011-06-30 Thread Ben Bolker
Paul A. Roediger us.army.mil> writes: > > Is there an S+ (v8.2 for Windows) compatible function to compute these? > > -- This is an R list, not an S-PLUS list. Based on library(sos) findFn("{normal order statistics}") ppoints in the base package and NormalScore in the SuppDists packag

Re: [R] parallel computing with 'foreach'

2011-06-30 Thread Uwe Ligges
Type ?foreach and read the whole help page - as the positng guide asked you to do before posting, you will find the line describing the argument ".packages". Uwe Ligges On 28.06.2011 21:17, Stacey Wood wrote: Hi all, I would like to parallelize some R code and would like to use the 'forea

Re: [R] Looking for Filliben (correlation test)

2011-06-30 Thread David Winsemius
Original poster. On Jun 30, 2011, at 12:51 PM, gaiarrido wrote: Thanks very much, but...the OP, what's that? Sorry - Mario Garrido Escudero PhD student Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola Universidad de Salamanca -- View this message in context:

Re: [R] error building package: packaging into .tar.gz failed

2011-06-30 Thread Uwe Ligges
On 30.06.2011 18:51, Juliet Hannah wrote: I am trying to build a package using windows xp. Here is the error I am getting: R CMD build myfunctions * checking for file 'myfunctions/DESCRIPTION' ... OK * preparing 'myfunctions': * checking DESCRIPTION meta-information ... OK * checking for LF l

Re: [R] Testing if a variable is specified within a function & adding TRUE/FALSE options to functions

2011-06-30 Thread Gabor Grothendieck
On Wed, Jun 29, 2011 at 11:42 AM, Simon Goodman wrote: > I have 2 related questions about functions. > > 1. I am writing a function to plot data from a time series with the form > > myplot<-function(data, d1,d2) {    } > > Where d1 and d2 are two dates in a time series. The idea being that if no >

[R] Expected Value of Normal Order Statistics

2011-06-30 Thread Paul A. Roediger
Is there an S+ (v8.2 for Windows) compatible function to compute these? -- View this message in context: http://r.789695.n4.nabble.com/Expected-Value-of-Normal-Order-Statistics-tp3636214p3636214.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Looking for Filliben (correlation test)

2011-06-30 Thread gaiarrido
Thanks very much, but...the OP, what's that? Sorry - Mario Garrido Escudero PhD student Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola Universidad de Salamanca -- View this message in context: http://r.789695.n4.nabble.com/Looking-for-Filliben-correlation-test-t

[R] Sum Question

2011-06-30 Thread Edgar Alminar
>> I did this: >> >> library(data.table) >> >> dd <- data.table(bl) >> dd[,sum(as.integer(CONTTIME)), by = SCRNO] >> >> (I used as.integer because I got an error message: sum not meaningful for >> factors) >> >> And got this: >> >>SCRNO V1 >> [1,] HBA0020036 111 >> [2,] HBA0020

[R] error building package: packaging into .tar.gz failed

2011-06-30 Thread Juliet Hannah
I am trying to build a package using windows xp. Here is the error I am getting: R CMD build myfunctions * checking for file 'myfunctions/DESCRIPTION' ... OK * preparing 'myfunctions': * checking DESCRIPTION meta-information ... OK * checking for LF line-endings in source and make files * checkin

Re: [R] cumulative incidence plot vs survival plot

2011-06-30 Thread array chip
Dear Terry, Thanks for responding to my question. I am starting to understand CI now, but I still have a general question: in oncology medical literature, when the study endpoint is recurrence, it's so common to see publications with Kaplan-Meier survival curves (time to recurrence or recurrenc

Re: [R] Looking for Filliben (correlation test)

2011-06-30 Thread David Winsemius
On Jun 30, 2011, at 11:47 AM, gaiarrido wrote: Hi R-users, I need to run Filliben correlation test, but I'm not able to find this function in any package. Perhaps it isn't in a package, but sometimes anybody have program this function or create a routine to estimate it. I found it in google and

[R] R 2.13 installation

2011-06-30 Thread Paul J. Ossenbruggen
I installed R 2.13 on my Power PC (32 bit). The installation responds with the message; "Installed Successfully." R opens normally. When I attempt a simple example, like adding two numbers, it fails to respond. I must use Force Quit to stop it. I have no problems with R on my Intel Mac. I

[R] pH calculation

2011-06-30 Thread Ralf Masuch
Hello, I am looking for a function, which are able to calculate the exact pH of multiprotonic acids, bases and complex buffer systems. Does anybody know, if such a function/package is already available in R. Many thanks! [[alternative HTML version deleted]]

Re: [R] Testing if a variable is specified within a function & adding TRUE/FALSE options to functions

2011-06-30 Thread Simon Goodman
Many thanks, I think that should help. I'll give it a go. -- View this message in context: http://r.789695.n4.nabble.com/Testing-if-a-variable-is-specified-within-a-function-adding-TRUE-FALSE-options-to-functions-tp3633248p3635979.html Sent from the R help mailing list archive at Nabble.com. ___

[R] Looking for Filliben (correlation test)

2011-06-30 Thread gaiarrido
Hi R-users, I need to run Filliben correlation test, but I'm not able to find this function in any package. Perhaps it isn't in a package, but sometimes anybody have program this function or create a routine to estimate it. I found it in google and I hope what I found it's in this page, http://gene

Re: [R] RWinEdt

2011-06-30 Thread Uwe Ligges
The WinEdt people released a version R-Sweave at www.winedt.org. My plan is to finalize a new RWinEdt plungin during this summer with a smoother installer. I was reluctant to work on it since almost a complete redesign is necessary for new versions of WinEdt and I did the original work 10 years

[R] CCF of two time series pre-whitened using ARIMA

2011-06-30 Thread Emily C
Hi all, I have two time series that I would like to correlate but as they are autocorrelated, I am "pre-whitening" them first by fitting ARIMA models, then correlating their residualsas described in https://onlinecourses.science.psu.edu/stat510/?q=node/75 However, http://www.stat.pitt.edu/sto

Re: [R] subscript out of bouns

2011-06-30 Thread jim holtman
You need to at least provide 'str(datos2)' so we can understand your data. You are trying to access a row with the name "2011-01-03"; does that row exist in your data? what does rownames(datos2) show? The guide says "PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

Re: [R] Rmpi fails to install

2011-06-30 Thread Juergen Rose
Hi Hugo, I tried your patch. The first 'R CMD INSTALL --preclean Rmpi_0.5-9a.tar.gz' failed with: *** installing help indices ** building package indices ... ** testing if installed package can be loaded [inspironM12:22936] *** Process received signal *** [inspironM12:22936] Signal: Segmentation

Re: [R] Match strings across two differently sized dataframes and copy corresponding row to dataframe

2011-06-30 Thread jim holtman
?merge On Thu, Jun 30, 2011 at 9:35 AM, Chris Beeley wrote: > Hello- > > Sorry, this is a bit of a noob question, but I can't seem to progress > it any further. > > I have two dataframes which contain a series of strings which exactly > match. The problem is one has more rows than the other (more

Re: [R] Numerical integration

2011-06-30 Thread Dennis Murphy
Hi: You could write the function this way: f <- function(x, xstar, k) dnorm(x) * k * x * (x >= xstar) where the term in parentheses is a logical. For any x < xstar, f will be zero by definition. Substitute your density in for dnorm(). To integrate over a grid of (xstar, k) values, you could try

[R] lm.fit error in scatterplot matrix

2011-06-30 Thread Nevil Amos
I am getting the following error: Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases when running the command scatterplotMatrix(~THL+WL+BD+TL+Mass|SEX_,by.group=TRUE,plot.points=T,smooth=F,main=spp,) it works fine without the "by group" option I assume

Re: [R] R: nnet(): how number of weights are calculated, and what the output means

2011-06-30 Thread David Winsemius
On Jun 30, 2011, at 9:11 AM, Hafsa Hassan wrote: Dear list, I am new to programming in R, and am implementing my own neural network code and trying to compare its output with that of nnet(). I have tried the nnet CRAN help package, google and R-help mailing list to find out what the nnet(

Re: [R] Points but no lines in qplot.

2011-06-30 Thread ONKELINX, Thierry
This is probably due to a numerical value that is coded as a factor. Have a look at the example below. In ggplot2 one line per group is plotted. The default grouping is the combination of all factors. In the first example only B, in the second and third example both A and B. This leaves just one

Re: [R] Points but no lines in qplot.

2011-06-30 Thread Hadley Wickham
On Thu, Jun 30, 2011 at 7:31 AM, Ashim Kapoor wrote: > Dear R helpers, > > I have molten data which is : - > >> t3 >   Year       variable        value > 1  2005     ICICI.Bank 27488370 > 2  2006     ICICI.Bank 43166850 > 3  2007     ICICI.Bank 59515300 > 4  2008     ICICI.Bank 6308576

Re: [R] Points but no lines in qplot.

2011-06-30 Thread Sarah Goslee
Hi, > > I upgraded to the new R and tried R --vanilla but I still see no lines. In > the legend,as earlier,I see a line through a point but in the graph I see > only points. No lines. Any ideas now ? Not a clue. I even tried version of the data with t3 as character, and as a factor, since that's

Re: [R] Points but no lines in qplot.

2011-06-30 Thread Ashim Kapoor
Two things I'd try: > run your code in a clean R session, started at the command line with R > --vanilla and just loading that exact dataset and running that line of > code, in case there are issues with other things in your session. > > Upgrade to the current version of R. > > Dear Sarah, I upgr

Re: [R] Upgrading R in Ubuntu

2011-06-30 Thread Gabor Grothendieck
On Thu, Jun 30, 2011 at 1:48 AM, Jeff Newmiller wrote: > This is Googlable. You need to add the CRAN repository to your APT sources > file. Hadn't seen this adjective before. Googling for googlable it suggests using: googleable (with an e)! -- Statistics & Software Consulting GKX Group, GKX A

[R] serial autocorrelation tests for VAR model under heteroskedasticity

2011-06-30 Thread ivan
Hi all, I have the problem that in an estimated vector autoregressive model I find arch effects using the arch-lm test. As far as I know, the tests for autocorrelation in residuals are then biased. Am I right? So my question: Is there any possibility to conduct the serial tests using heteroskedast

[R] Analysing insecticide biossays using lmer

2011-06-30 Thread pierricklabbe
Hi all, Here is my problem: I performed bioassays using a unique insecticide on 9 different genotypes and got their mortality depending on the dose of insecticide used. Now, I want to see wether some genotypes are different or not in their responses to insecticide. My problem is that I have up to

Re: [R] RES: time series interpolation

2011-06-30 Thread tomtomme
I appologize, I should have mentioned that by myself, but was in such a hurry... - I myself would never have found a solution Thanks again! -- View this message in context: http://r.789695.n4.nabble.com/time-series-interpolation-tp3633193p3635733.html Sent from the R help mailing list archive

Re: [R] cumulative incidence plot vs survival plot

2011-06-30 Thread Terry Therneau
> Hi, I am wondering if anyone can explain to me if cumulative incidence > (CI) is The cumulative incidence curve and the KM are not the same, when there are multiple outcomes. See the "etype" argument to survfit, which is used to create CI curves (?survfit.formula). For testing difference

[R] subscript out of bouns

2011-06-30 Thread Kenneth Roy Cabrera Torres
Hi R users: I got a problem traying to select one date of a timeSeries object. But it works with the SWX data objetct. What am I doing worng? library(fImport) datos2<-readSeries(file="misDatos.csv",header=TRUE,sep=",", format="%Y-%m-%d", FinCenter='America

[R] R: nnet(): how number of weights are calculated, and what the output means

2011-06-30 Thread Hafsa Hassan
Dear list, I am new to programming in R, and am implementing my own neural network code and trying to compare its output with that of nnet(). I have tried the nnet CRAN help package, google and R-help mailing list to find out what the nnet() output means, and what the training algorithm is, but ha

[R] socket blocking with readBin

2011-06-30 Thread Matthew Maycock
R Gurus / Ninjas / Wizards: On both R 2.12 (Windows 7) and R 2.13 (OS X 10.5) I have tried the following: 1. In one instance of R open a socket via: s1 <- socketConnection(server=TRUE, open="a+b", port=31415, blocking=FALSE); 2. And in another instance I do the following: s2

[R] Distribution class

2011-06-30 Thread Christof Naumzik
Hi everyone, I am pretty new to R and facing some trouble with the distribution class, which is provided in the package "distr". I have calculated a certain c.d.f. which depends upon a certain parameter. Now I need to calculate the Kolmogorff-Smirnoff(KS)- distance between this c.d.f. and anot

[R] S4 group generic with additional argument

2011-06-30 Thread Andrew Whyte
Dear R-help, I am attempting to set the "Summary" group generic function for my S4 class. Using the standard arguments, this is easy. The function returns the result of the generic for every element in a list:   setClass("TestClass", representation(elements = "list"))   tc <- new("TestClass

[R] Match strings across two differently sized dataframes and copy corresponding row to dataframe

2011-06-30 Thread Chris Beeley
Hello- Sorry, this is a bit of a noob question, but I can't seem to progress it any further. I have two dataframes which contain a series of strings which exactly match. The problem is one has more rows than the other (more cases have been added) and they have been sorted so that they are not in

[R] Error "singular gradient matrix at initial parameter estimates" in nls

2011-06-30 Thread Niklaus Hurlimann
Greetings, I am struggling a bit with a non-linear regression. The problem is described below with the known values r and D inidcated. I tried to alter the start values but get always following error message: Error in nlsModel(formula, mf, start, wts): singular gradient matrix at initial parame

Re: [R] RES: time series interpolation

2011-06-30 Thread Joshua Ulrich
On Thu, Jun 30, 2011 at 6:10 AM, tomtomme wrote: > Thanks for the hints. Eitherway I´ve found another solution now: > More correctly, I answered the question you cross-posted on StackOverflow: http://stackoverflow.com/questions/6520799/interpolate-time-series-of-multiple-tables > w03_11temp<-read

Re: [R] Points but no lines in qplot.

2011-06-30 Thread Sarah Goslee
On Thu, Jun 30, 2011 at 8:53 AM, Ashim Kapoor wrote: > Yes Sarah,I am using qplot from ggplot2. > > My sessionInfo is as follows : - > >> sessionInfo() > R version 2.12.1 (2010-12-16) > Platform: x86_64-pc-linux-gnu (64-bit) Two things I'd try: run your code in a clean R session, started at the c

Re: [R] Points but no lines in qplot.

2011-06-30 Thread Ashim Kapoor
Yes Sarah,I am using qplot from ggplot2. My sessionInfo is as follows : - > sessionInfo() R version 2.12.1 (2010-12-16) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_IN LC_NUMERIC=C LC_TIME=en_IN [4] LC_COLLATE=en_IN LC_MONETARY=CLC_MESSAGES=en_IN [7

Re: [R] Points but no lines in qplot.

2011-06-30 Thread Sarah Goslee
Hi, You seem to be using qplot() from the ggplot2 package, but you really need to specify: there are several packages with a function of that name. That said, when I run your example I get a plot with both lines and points, which means we're going to need more information from you, specifically s

Re: [R] aggregating data

2011-06-30 Thread Oscar Perpiñan Lamigueiro
Hi, You can get it with "by": foo <- function(x)c(length(x$probe), mean(x$exp)) res <- by(df[c('exp', 'probe')], df['gene'], FUN=foo) do.call(rbind, res) Bye, Oscar. -- Oscar Perpiñán Lamigueiro Dpto. Ingeniería Eléctrica EUITI-UPM http://procomun.wordpress.com El Thu, 30 Jun 2011 17:28:02

[R] Points but no lines in qplot.

2011-06-30 Thread Ashim Kapoor
Dear R helpers, I have molten data which is : - > t3 Year variablevalue 1 2005 ICICI.Bank 27488370 2 2006 ICICI.Bank 43166850 3 2007 ICICI.Bank 59515300 4 2008 ICICI.Bank 63085760 5 2009 ICICI.Bank 54526330 6 2005 HDFC.Bank 265

[R] R 2.13.1 scheduled for July 8

2011-06-30 Thread Peter Dalgaard
This is to announce that we plan to release R version 2.13.1 on Friday, July 8, 2011. The 2.13.0 release has been quite solid, but some people expect an x.y.1 to roll out on larger installations for the next academic year. Of course, there have also been a sampling of minor bug fixes. Those

[R] Sys.glob() doesn't handle a UNC windows path beginning with backslashes

2011-06-30 Thread Keith Jewell
Hi, Back in 2010 I had a problem with 'update.packages()', which I worked around by mapping a drive letter to a UNC path [described in but my current workaround is assign(".lib.loc", sub("Server02/stats", "L:", .libPaths()

Re: [R] aggregating data

2011-06-30 Thread jim holtman
If you have a large datatable, you might consider using 'data.table' which is better performing than 'plyr' > x <- read.table(textConnection("Gene ProbeID > Expression_Level + A 1 0.34 + A 2 0.21 + E 3 0

Re: [R] very large pair() plot

2011-06-30 Thread Uwe Ligges
On 29.06.2011 23:28, ahrager wrote: Hi everyone, I'm a newbie and this is my first post. My boss wants me to make a series of scatter plots where 76 variables are plotted against each other. I know how to do this using pair()...my problem is that there are just too many plots to fit in the w

Re: [R] 4D data acsess

2011-06-30 Thread Peter Ehlers
On 2011-06-29 15:02, David Winsemius wrote: On Jun 29, 2011, at 4:56 PM, katarv wrote: Hi Sarah, I use readMat function, from R.matlab function. str(X) tells that X : num [1:64, 1:64, 1:21, 1:300] as I said, the first 3 columns are x,y,z coordinates. And I need all values in the last colum

Re: [R] update.packages fail

2011-06-30 Thread Uwe Ligges
On 29.06.2011 21:07, Art Burke wrote: update.packages has suddenly stopped working for me It did not stop working, it just gave the warning that the "CRAN extras" repository (http://www.stats.ox.ac.uk/pub/RWin/bin) was not available when you tried due to power outages in Oxford where "CRAN

Re: [R] RES: time series interpolation

2011-06-30 Thread tomtomme
Thanks for the hints. Eitherway I´ve found another solution now: w03_11temp<-read.delim2("w03_11.ASC", fileEncoding="ISO-8859-15", skip = 4) colnames(w03_11temp) <- c("date", "time", "temp") library(zoo) w03_11temp_z <- zoo(w03_11temp$temp, as.POSIXct(paste(w03_11temp$date, w03_11temp$time),

Re: [R] aggregating data

2011-06-30 Thread Iain Gallagher
oops last reply was only half the solution: library(plyr) df <- data.frame(gene=c('A', 'A', 'E', 'A', 'F', 'F'), probe = c(1,2,3,4,5,6), exp = c(0.34, 0.21, 0.11, 0.21, 0.56, 0.81)) ddply(df, .(gene), function(df)c(length(df$gene), median(df$exp)) gene V1V2 1A 3 0.210 2E 1 0.110

Re: [R] centre two graphs on one plot

2011-06-30 Thread Jim Lemon
On 06/30/2011 05:37 AM, chris20 wrote: Hi, I am trying to put together a biplot using symbols and different colours instead of text as points. Someone has previously suggested using this code: PC<- prcomp (iris[,1:4]) lambda<- PC$sdev * sqrt(nrow(PC$x)) plot (t(t(PC$x)/lambda),pch=16,col=as.nu

Re: [R] aggregating data

2011-06-30 Thread Iain Gallagher
Hi Max Using plyr instead of rehsape: library(plyr) df <- data.frame(gene=c('A', 'A', 'E', 'A', 'F', 'F'), probe = c(1,2,3,4,5,6)) ddply(df, .(gene), function(df)length(df$gene)) gene V1 1A 3 2E 1 3F 2 best iain --- On Thu, 30/6/11, Max Mariasegaram wrote: > From: Max Mar

Re: [R] Update MS Windows PATH variable based on a R script

2011-06-30 Thread Janko Thyson
On 29.06.2011 21:24, Duncan Murdoch wrote: On 29/06/2011 3:15 PM, Janko Thyson wrote: On 29.06.2011 20:58, Duncan Murdoch wrote: On 29/06/2011 2:24 PM, Janko Thyson wrote: Dear list, this is not directly an R question, but it is somewhat related to R aspects, so I hope it's okay to post it he

Re: [R] Measure the distance/home range along terrain surface

2011-06-30 Thread Jim Lemon
On 06/30/2011 01:54 AM, Zulima Tablado Almela wrote: Hello all, I have two questions: 1)Given two coordinates on a digital elevation model (DEM), I would like to measure the actual distance traveled between the two locations, assuming a straight line route. Does anyone know the function(if ther

Re: [R] Saving fExtremes estimates and k-block return level with confidence intervals.

2011-06-30 Thread Jorge Ivan Velez
Hi Peter, Try data.frame(n = names(res2), t(sapply(res2, function(l) l@fit$par.ests))) for the first part. HTH, Jorge On Thu, Jun 30, 2011 at 12:16 AM, Peter Maclean <> wrote: > I am estimating a large model by groups. How do you save the results > and returns > the associated quantiles? >

[R] aggregating data

2011-06-30 Thread Max Mariasegaram
Hi, I am interested in using the cast function in R to perform some aggregation. I did once manage to get it working, but have now forgotten how I did this. So here is my dilemma. I have several thousands of probes (about 180,000) corresponding to each gene; what I'd like to do is obtain is a f

Re: [R] DROP OBSEVATION IN A GROUP

2011-06-30 Thread Jorge Ivan Velez
Hi Peter, Try this: r <- with(z, tapply(y, n, function(x) sum(x == 0) > 2)) z[!rep(r, with(z, table(n))), ] HTH, Jorge On Thu, Jun 30, 2011 at 1:05 AM, Peter Maclean <> wrote: > I tried this but did not work: > z0<- by(z, z[,"n"], function(x) subset(x, sum(n==0)>2)) > Peter Maclean > Departm