[R] recursive function - finding connections

2011-07-13 Thread Benton, Paul
Dear all, I'm having some problems getting my recursive function to work. At first I though that maybe my data was too big and I increase option(expressions=5). Then I thought that I would try it on some smaller data. Still not working. :( I would have thought there should be a function for

Re: [R] Using str() in a function.

2011-07-13 Thread Bert Gunter
Folks: To thrash the dead horse a little more ... > So, what about this one: > GG<-c(1:4) > testX3 <- function(X) {summary(X); return(str(X))} > testX3(GG) > > int [1:4] 1 2 3 4 > > I thought this was ignoring the summary() because it evaluates the return() > first.  If it does the return(str(X))

Re: [R] Using str() in a function.

2011-07-13 Thread Daniel Malter
As long as you just want to display it, use print() GG<- c(1,2,3) print(summary(GG),str(GG)) Output: num [1:3] 1 2 3 Min. 1st Qu. MedianMean 3rd Qu.Max. 1.0 1.5 2.0 2.0 2.5 3.0 HTH, Daniel andrewH wrote: > > Using str() in a function. > > I am in th

Re: [R] Using str() in a function.

2011-07-13 Thread andrewH
Dear Peter-- You write: >>Andrew is being seriously confused. The return(ans) is of course executed when you get to it, returning the value of `ans` and terminating the function. Anything after that is _ignored_. There is no such thing as a "previous return()" affecting what str() does -- that woul

Re: [R] glm() scale parameters and predicted Values

2011-07-13 Thread Peter Maclean
In glm() you can use the summary() function to recover the shape parameter (the reciprocal of the dispersion parameter). How do you recover the scale parameter? Also, in the given example, how I estimate and save the geometric mean of the predicted values? For a simple model you can use fitted()

Re: [R] Rcompression on MAC - where is it?

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 9:04 PM, Eduardo M. A. M. Mendes wrote: Dear Peter many thanks for your reply. I am new to R (and MAC) but I had no problem to get my MAC to run gcc and gfortran (years of experience on linux). Although I have Parallels and Vmware Fusion installed on my MAC, I am not

Re: [R] Using str() in a function.

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 10:54 PM, andrewH wrote: David -- Ah! Excellent. OK, that explains Dennis's function's output. Print(str(X)) evaluates str(X), sending the usual str() output to the console as a side effect, and then prints what str() returns, which is NULL. And invisible() prints NULL a

Re: [R] plotting date data over couple of months

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 9:42 PM, vamshi999 wrote: i am sorry again.. this is my dataset.. 'data.frame': 46376 obs. of 19 variables: $ scan.no : int 24 78 61 64 64 64 65 73 79 82 ... $ track.no : int 5 48 105 122 124 121 123 380 1073 1093 ... $ blip.no : int 70 323 514 547 549 553 558 535

Re: [R] grey colored lines and overwriting labels i qqplot2

2011-07-13 Thread Ista Zahn
Hi Sigrid, On Wed, Jul 13, 2011 at 9:47 PM, Sigrid wrote: > Great! Thank you, Brian. > > To answer your question about intercept and slopes, I got them from a > covariance analysis that I had already conducted. It seems like I can not > use the regressions command for the model that I used to get

Re: [R] Using str() in a function.

2011-07-13 Thread andrewH
David -- Ah! Excellent. OK, that explains Dennis's function's output. Print(str(X)) evaluates str(X), sending the usual str() output to the console as a side effect, and then prints what str() returns, which is NULL. And invisible() prints NULL again, but we don't see NULL NULL, because the secon

Re: [R] qplot and for loops

2011-07-13 Thread wwreith
I just wanted the post the results of the emails I been sending/getting. The following command will create the graphs and save them to the location of your choice. The names are graph1.png, graph2.png etc. for(i in 1:4) { png( file=paste("C:/Insert file location/graph",i,".png", sep="") )

Re: [R] plotting date data over couple of months

2011-07-13 Thread vamshi999
i am sorry again.. this is my dataset.. 'data.frame': 46376 obs. of 19 variables: $ scan.no : int 24 78 61 64 64 64 65 73 79 82 ... $ track.no : int 5 48 105 122 124 121 123 380 1073 1093 ... $ blip.no : int 70 323 514 547 549 553 558 5355 7014 7119 ... $ date : chr "2011-04-2

Re: [R] grey colored lines and overwriting labels i qqplot2

2011-07-13 Thread Sigrid
Great! Thank you, Brian. To answer your question about intercept and slopes, I got them from a covariance analysis that I had already conducted. It seems like I can not use the regressions command for the model that I used to get the intercepts and slopes. I guess 2 factors are the maximum. + ddp

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Lyndon Estes
Hi Eik, Thanks very much for those helpful coding suggestions, and for confirming the error. The apply function is much nicer, and I will incorporate that plus the correct quantile type. The function I had written actually gives the option to calculate in the manner you suggest in one of your com

Re: [R] Rcompression on MAC - where is it?

2011-07-13 Thread Eduardo M. A. M. Mendes
Dear Peter many thanks for your reply. I am new to R (and MAC) but I had no problem to get my MAC to run gcc and gfortran (years of experience on linux). Although I have Parallels and Vmware Fusion installed on my MAC, I am not running windows. I have downloaded rcompression.tar, untared it

Re: [R] plotting date data over couple of months

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 8:32 PM, vamshi999 wrote: I am sorry again.. I am posting the sample data.. my data set is huge.. dimension of my data set is 5 x 6 scan.nobird.no date time height "1" 24 5"2011-04-29" "21:17:56" 3

Re: [R] Using str() in a function.

2011-07-13 Thread peter dalgaard
On Jul 14, 2011, at 01:48 , David Winsemius wrote: > > On Jul 13, 2011, at 7:31 PM, andrewH wrote: > >> Thanks, David & Dennis, that is very helpful. >> >> Let me state what I think I have learned, to see if I understand it >> correctly. Then I have two remaining questions. >> >> If a functio

Re: [R] plotting date data over couple of months

2011-07-13 Thread vamshi999
I am sorry again.. I am posting the sample data.. my data set is huge.. dimension of my data set is 5 x 6 scan.nobird.no date time height "1" 24 5"2011-04-29""21:17:56" 357 "2" 78 48

Re: [R] Add coordinates at specific points...

2011-07-13 Thread Duncan Murdoch
On 13/07/2011 7:49 PM, David Winsemius wrote: On Jul 13, 2011, at 7:42 PM, JIA Pei wrote: Hi, Thanks David Winsemius: "mtext" works !! However, in R plot, "mtext" will automatically overlap/overwrite the existing coordinates, which makes the coordinates a messy. Refer to http://www.visiono

Re: [R] plotting date data over couple of months

2011-07-13 Thread David Winsemius
So, post some data. I'm tired of unsuccessful attempts at mind reading. If the data set is too big, then just use: dput(data2[which( data2$date < as.Date("2011-05-05") & data2$date > as.Date("2011-04-27") ), ] ) -- David On Jul

Re: [R] plotting date data over couple of months

2011-07-13 Thread vamshi999
I am sorry i was not clear in my early post I have used the below code to change my data into date format.. r<-as.POSIXlt(paste(data2$date,data2$time)) library(gsubfn) library(chron) r<-as.chron(r) data2$date<-strftime(strptime(r, format="(%m/%d/%y %H:%M:%S)"),"%Y-%m-%d") data2$time<-strft

Re: [R] Adding vertical space before and after Sweave chunk

2011-07-13 Thread Duncan Murdoch
On 13/07/2011 7:14 PM, Mark Heckmann wrote: I would like to have a bigger default space in front of and behind every Sweave chunk. I have seen that space between input and output is removed as follows: \fvset{listparameters={\setlength{\topsep}{0pt}}} \renewenvironment{Schunk}{\vspace{\topsep}}

Re: [R] Add coordinates at specific points...

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 7:59 PM, JIA Pei wrote: Thanks David, for your prompt reply. Ok... just avoid this mess. I'd love to emphasize the key point M(2.1, sin(2.1)), and just write a point coordinate by the side of M .How to do that easily? Have you worked through the examples on the help(tex

Re: [R] Add coordinates at specific points...

2011-07-13 Thread JIA Pei
Thanks David, for your prompt reply. Ok... just avoid this mess. I'd love to emphasize the key point *M(2.1, sin(2.1))*, and just write a point coordinate by the side of M .How to do that easily? By the way, if there is another point *N(2.2, sin(2.2))*, will M and N conflict (overlap) each other?

Re: [R] Add coordinates at specific points...

2011-07-13 Thread JIA Pei
Hi, Thanks David Winsemius: "mtext" works !! However, in R plot, "mtext" will automatically overlap/overwrite the existing coordinates, which makes the coordinates a messy. Refer to http://www.visionopen.com/Rplot.png , which is produced by only 3 lines. dev.new(width = 640, height = 480) > plot(

Re: [R] Add coordinates at specific points...

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 7:42 PM, JIA Pei wrote: Hi, Thanks David Winsemius: "mtext" works !! However, in R plot, "mtext" will automatically overlap/overwrite the existing coordinates, which makes the coordinates a messy. Refer to http://www.visionopen.com/Rplot.png , which is produced by

Re: [R] Using str() in a function.

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 7:31 PM, andrewH wrote: Thanks, David & Dennis, that is very helpful. Let me state what I think I have learned, to see if I understand it correctly. Then I have two remaining questions. If a function contains more than one expression in its {}, it always returns the valu

Re: [R] plotting date data over couple of months

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 6:56 PM, vamshi999 wrote: Hi .. i am a beginner in R I have data in the format of date 04/27/11 04/27/11 04/30/11 04/30/11 05/03/11 05/03/11 05/04/11 So they are not yet dates, but rather character vectors. R dates don't look like that unless you make special effor

Re: [R] Using str() in a function.

2011-07-13 Thread andrewH
Thanks, David & Dennis, that is very helpful. Let me state what I think I have learned, to see if I understand it correctly. Then I have two remaining questions. If a function contains more than one expression in its {}, it always returns the value of the last evaluated expression in its definiti

[R] Adding vertical space before and after Sweave chunk

2011-07-13 Thread Mark Heckmann
I would like to have a bigger default space in front of and behind every Sweave chunk. I have seen that space between input and output is removed as follows: \fvset{listparameters={\setlength{\topsep}{0pt}}} \renewenvironment{Schunk}{\vspace{\topsep}}{\vspace{\topsep}} Still, I can't figure out

Re: [R] Very slow optim()

2011-07-13 Thread aaron Greenberg
Why use a hammer when you need a wrench? Admb seems to be the best tool for the job. It has several slick interfaces with R. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-

[R] plotting date data over couple of months

2011-07-13 Thread vamshi999
Hi .. i am a beginner in R I have data in the format of date 04/27/11 04/27/11 04/30/11 04/30/11 05/03/11 05/03/11 05/04/11 Now i want to plot the data something like this on x-axis... -- 27 28 29 30 1 2 3 4 April

[R] Sum weights of independent variables across models (AIC)

2011-07-13 Thread Michael Just
Hello, I'd like to sum the weights of each independent variable across linear models that have been evaluated using AIC. For example: > library(MuMIn) > data(Cement) > lm1 <- lm(y ~ ., data = Cement) > dd <- dredge(lm1, beta = TRUE, eval = TRUE, rank = "AICc") > get.models(dd, su

Re: [R] dev.off and Cairo and ggplot2

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 5:55 PM, Stephen Eick wrote: I have a weird example which fails and I don't understand why. If I put dev.off() inside my function, it produces a bad image file. But if I run what I think should be equivalent code with dev.off() running outside my function, it works. Why d

Re: [R] Plotting parametrized curves (2D or 3D)

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 6:08 PM, amenning wrote: The curve() function plots an expression in x over an interval [from,to]. I am looking for a function that would allow me to plot a parametrized curve t -> x(t) where x is a vector in 2 or 3 dimensions. For example (cos(t), sin(t)) (a2D circle

[R] Plotting parametrized curves (2D or 3D)

2011-07-13 Thread amenning
The curve() function plots an expression in x over an interval [from,to]. I am looking for a function that would allow me to plot a parametrized curve t -> x(t) where x is a vector in 2 or 3 dimensions. For example (cos(t), sin(t)) (a2D  circle) or (cos(t), sin(t), t) (a 3D helix). It seems that

[R] dev.off and Cairo and ggplot2

2011-07-13 Thread Stephen Eick
I have a weird example which fails and I don't understand why. If I put dev.off() inside my function, it produces a bad image file. But if I run what I think should be equivalent code with dev.off() running outside my function, it works. Why does the location of dev.off matter? library(Cairo)

Re: [R] How to read 20 columns from the file

2011-07-13 Thread Steven Kennedy
Hi Kishore, There should be no problem reading in your data if you have followed the directions posted by Jim and myself. I suggest you do a search for a basic R tutorial and follow that through. Steve On Wed, Jul 13, 2011 at 10:08 PM, Kishorenalluri wrote: > Hi Jim, >        Saving is not a pr

Re: [R] Tukey HSD with repeated measure ANOVA

2011-07-13 Thread Daniel Malter
Try TukeyHSD(anova). TukeyHSD is implemented in the base package, i.e., ready to use with the base installation of R. Also, the TukeyHSD for the interaction term should have a colon ":" not a "*". The "which" argument in TukeyHSD() must be identical to the name of the coefficient in the summary tab

Re: [R] R in Batch mode

2011-07-13 Thread Duncan Murdoch
On 11-07-13 4:15 PM, Jorge Cornejo wrote: Hi, I'm running long code in Batch mode (as a process in ubuntu using $nohup R CMD BATCH MyCode.R out.out&), but every one in a while it fail and the process stops. When the code finish with no problems, it sends an e-mail, but if fails, I'm not aware un

[R] apsrtable package notes no longer working?

2011-07-13 Thread Joshua Gubler
Hi all, I have used the apsrtable package to generate tables (using LaTeX and Sweave) for quite some. However, suddenly the notes option in the package appears to have stopped working (or I am doing something wrong). So, when I try to run the following commands (in the R console): > attach(N

Re: [R] Scaling in SVM

2011-07-13 Thread Steve Lianoglou
Hi Matthias, On Wed, Jul 13, 2011 at 5:22 AM, Meffy wrote: > Dear Community! > I'm using the svm method of package e1071 for classifying my data. This > really works fine, but however I have to work after creating the support > vectors and the parameters with unscaled data. So the problem is when

Re: [R] Executing a function correctly

2011-07-13 Thread Marc Schwartz
On Jul 13, 2011, at 1:38 PM, saskay wrote: > Hello All, > I've created a function as follows so as to use it in a loop. > > freq<-function(i) > { > library(RODBC) > paste(i,"<-sqlQuery(conn,","'","select click_flg, open_flg,", i ," from > modeling_5')",sep="") > } > > freq(i="AQI") > [1] "AQI<

Re: [R] Add coordinates at specific points...

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 1:22 PM, JIA Pei wrote: Hi, all: I used two lines of very simple code to draw a sin curve. dev.new(width = 640, height = 480) plot(sin, -pi, 2*pi) First look at: ?mtext # then try mtext(text="2.5000", side = 1, line = 1, at = 2.5) Now, I added a specific line (re

Re: [R] Very slow optim()

2011-07-13 Thread Mike Marchywka
> > Hamazaki, Hamachan (DFG alaska.gov> writes: > > > > > Dear list, > > > > I am using optim() function to MLE ~55 parameters, but it is very slow to > converge (~ 25 min), whereas I can do > > the same in ~1 sec. using ADMB, and ~10 sec using MS EXCEL Solver. > > > > Are there any tricks to

Re: [R] Colors in R

2011-07-13 Thread Ben Bolker
Trevino, Lisa bcm.edu> writes: > I'm trying to assign colors to multiple lines in a graph. > Problem is I don't want to type in as many colors as > there are linesis there a way around this? In brief, > I'm plotting the logratio for up to 60 samples and > want a different color for each sam

Re: [R] simple save question

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 1:10 PM, Tom La Bone wrote: I want to assign the value of rmean from a survfit object to a variable so that it can be used in subsequent calculations, which is also what I interpreted the original poster to want. I did not understand Dr. Therneau's answer to the original

Re: [R] 3D density plot of point set

2011-07-13 Thread Lutz Gehlen
Hello Duncan, thank you for your reply. I will have a look at the misc3d package and at contour3d and kde3d in particular. Cheers, Lutz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide h

[R] R in Batch mode

2011-07-13 Thread Jorge Cornejo
Hi, I'm running long code in Batch mode (as a process in ubuntu using $nohup R CMD BATCH MyCode.R out.out &), but every one in a while it fail and the process stops. When the code finish with no problems, it sends an e-mail, but if fails, I'm not aware unless I check the working process, and I ca

Re: [R] Very slow optim()

2011-07-13 Thread Ben Bolker
Hamazaki, Hamachan (DFG alaska.gov> writes: > > Dear list, > > I am using optim() function to MLE ~55 parameters, but it is very slow to converge (~ 25 min), whereas I can do > the same in ~1 sec. using ADMB, and ~10 sec using MS EXCEL Solver. > > Are there any tricks to speed up? > > Are th

Re: [R] foreach not recognizing functions in memory

2011-07-13 Thread Bos, Roger
Saskay, Thanks so much for that example. It worked fine on my system. I didn't realized SNOW worked on windows. I will have to read more about it. Thanks again, Roger -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of saskay Sen

[R] Very slow optim()

2011-07-13 Thread Hamazaki, Hamachan (DFG)
Dear list, I am using optim() function to MLE ~55 parameters, but it is very slow to converge (~ 25 min), whereas I can do the same in ~1 sec. using ADMB, and ~10 sec using MS EXCEL Solver. Are there any tricks to speed up? Are there better optimization functions? Thanks Toshihide

[R] Tukey HSD with repeated measure ANOVA

2011-07-13 Thread Roberto
Hi, I need to determinate HSD value from a matrix like that Thesis Days A1 Cx 0 66.07 Cx 0 60.24 Cx 0 42.86 Tw 0 66.07 Tw 0 60.24 Tw 0 42.86 Aa 0 66.07 Aa 0 60.24 Aa 0 42.86 Qe 0 66

[R] Smart legend ???

2011-07-13 Thread JIA Pei
Hi, all: Is there an automatic smart legend for R? Since my R code is running in a row, which will produce a bunch of R plots in a single run, some of the produced plots are really "ridiculous". Because my legend is fixed to "topleft", sometimes, which occludes the key parts of the figure/plots, b

[R] Executing a function correctly

2011-07-13 Thread saskay
Hello All, I've created a function as follows so as to use it in a loop. freq<-function(i) { library(RODBC) paste(i,"<-sqlQuery(conn,","'","select click_flg, open_flg,", i ," from modeling_5')",sep="") } freq(i="AQI") [1] "AQI<-sqlQuery(conn,'select click_flg, open_flg,AQI from modeling_5')"

Re: [R] foreach not recognizing functions in memory

2011-07-13 Thread saskay
Try the below code: == library(foreach) library(doSNOW) getDoParWorkers() getDoParName() registerDoSNOW(makeCluster(2, type = "SOCK")) getDoParWorkers() getDoParName() testFun <- function(m) { out <- m*m } out <- foreach(m=1:10, .combine=rbind,*.verbose=T*) %dopar

Re: [R] life table and Kaplan-Meier

2011-07-13 Thread stat999
Thank you very much. -- View this message in context: http://r.789695.n4.nabble.com/life-table-and-Kaplan-Meier-tp3664246p3665671.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

[R] Add coordinates at specific points...

2011-07-13 Thread JIA Pei
Hi, all: I used two lines of very simple code to draw a sin curve. dev.new(width = 640, height = 480) > plot(sin, -pi, 2*pi) Now, I added a specific line (red line in the picture at http://www.visionopen.com/Rplot.png) by using abline. However, I still love to add the X-coordinate "2.5" out

Re: [R] Plot command overwrites existing plot in multiple figure plot

2011-07-13 Thread marcel
This problem has been an opportunity for me to learn about issues mixing base graphics with lattice plots. From the many pdfs and blogs and other things I have found, it seems that I have two options: 1) insert a viewport of my bar graph into a basic environment; or 2) do all of my plots in lattice

Re: [R] simple save question

2011-07-13 Thread Tom La Bone
I want to assign the value of rmean from a survfit object to a variable so that it can be used in subsequent calculations, which is also what I interpreted the original poster to want. I did not understand Dr. Therneau's answer to the original poster, so I figured I would provide a simple example a

[R] Toroidal Edge Correction for a 3-d point pattern

2011-07-13 Thread jai1408
Hi, I have a 3-d point pattern. I want to find the K-estimate using toroidal edge corrections. Anyone has a code for this in R? I would also like to compare these results with the K-estimate border edge corrections. Spatstat allows me to do so only for a 2-d data set. Any idea how to do it for a

Re: [R] foreach not recognizing functions in memory

2011-07-13 Thread Bos, Roger
My apologies for not mentioning which backend and OS I am using. I am using doSMP on a windows machine. I read up on doSMP, but all the examples they show are based on calling foreach directly, not from within a function. The code works fine using %do% instead of %dopar%. Does anyone have an e

Re: [R] Latent Transition Analysis in R ?

2011-07-13 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of David Joubert > Sent: Wednesday, July 13, 2011 9:55 AM > To: r-help@r-project.org > Subject: [R] Latent Transition Analysis in R ? > > > Are there any packages in R that allow f

Re: [R] Error non-numeric argument to binary operator

2011-07-13 Thread Uwe Ligges
On 13.07.2011 17:46, Bansal, Vikas wrote: Dear all, I have a data frame df and i am using a code shown below. df[, "total"]<- rowSums(df[, 3:6]) MAKING A NEW COLUMN total in df BY ROWSUMS defineSamples<- function() { readline("enter the number of INDIVIDUALS IN POOL: ") } d

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Eik Vettorazzi
Hi Lyndon, I'm sorry, I just saw that you provided your dataset. I checked my program and it reproduced the same error. con <- url("http://sites.google.com/site/ldemisc/r_general/tpfpdat.Rdata";) load(con) close(con) bins<-quantile(x,0:200/200) ctch<-t(sapply(bins,function(b)c(b,sum(x>b),sum(y>b)

Re: [R] max possible rsquare

2011-07-13 Thread Uwe Ligges
On 13.07.2011 14:42, Rilana Prenger wrote: Dear all, I have a question regarding the output of the coxph function. What does the 'max possible' exactly mean in the output below? Many thanks. coef exp(coef) se(coef) robust se z Pr(>|z|) smocc_zyban -0.43840.6451

Re: [R] How to translate string to variable inside a command in an easy way in R

2011-07-13 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of UriB > Sent: Wednesday, July 13, 2011 9:28 AM > To: r-help@r-project.org > Subject: Re: [R] How to translate string to variable inside a command in > an easy way in R > > Thanks >

Re: [R] AR-GARCH with additional variable - estimation problem

2011-07-13 Thread Joshua Ulrich
Please don't cross-post: https://mailman.stat.ethz.ch/pipermail/r-sig-finance/2011q3/008230.html -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Wed, Jul 13, 2011 at 11:11 AM, Marcin P?�ciennik wrote: > Dear list members, > > I am trying to estimate parameters of the AR(1)-GARCH(1,1)

Re: [R] UNIX diff function

2011-07-13 Thread Sarah Goslee
Hi Dennis, It still uses paste(), but this isn't so bad: SET2[!(do.call(paste, SET2) %in% do.call(paste, SET1)),] You could even turn it into a function. This one checks for matching rows in the data frame with more rows, but you could take out the conditional if you want order of arguments to be

[R] UNIX diff function

2011-07-13 Thread Dennis Fisher
Colleagues, (R: 2.13.0; OS X) I often receive sequential datasets in which there are new rows interposed between existing rows. For example: SET1 <- data.frame(list(LETTERS=LETTERS[c(1:4, 6:10)], NUMBERS=c(1:4, 6:10))) SET2 <- data.frame(list(LETTERS=LETTERS[1:10], NUMBERS=1:10

Re: [R] Meaning of "%%"

2011-07-13 Thread Bert Gunter
Folks: As Peter Dalgaard gently pointed out to me, the last time that we looked, %% is a BINARY, not a unary operator. Of course, the Help details are still germane. -- Bert __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Eik Vettorazzi
to cut a long story short, how about that: bins<-quantile(x,0:200/200) #maybe replacing x by c(x,y) ctch<-t(sapply(bins,function(b)c(b,sum(x>b),sum(y>b colnames(ctch)<-c("bin","tp","fp") Cheers. Am 13.07.2011 18:49, schrieb Eik Vettorazzi: > Hello Lyndon, > I'm still puzzled what x and y act

[R] Latent Transition Analysis in R ?

2011-07-13 Thread David Joubert
Are there any packages in R that allow for estimation of LTA models ? Thank you, David Joubert [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Eik Vettorazzi
Hello Lyndon, I'm still puzzled what x and y actually are and how they are related. Your "bins" are calculated from x only, so you might missing some range of y and since you use a fixed number of bins of equal size, some bins might be empty (and therefore reproducing the result from the bin before

Re: [R] adding text to spplot

2011-07-13 Thread Oscar Perpiñan Lamigueiro
Hi, help(spplot): The ‘sp.layout’ argument is either a single layout item, or a list with a layout items. A layout item is a list with its first argument the name of the layout function to be called: ‘sp.points’ for SpatialPoints, ‘sp.polygons’ for SpatialPolygons object,

Re: [R] How to translate string to variable inside a command in an easy way in R

2011-07-13 Thread UriB
Thanks Here is another question I want to have a function that get a string for example y="AMI" and make commands like the following agg<-aggregate(numAMI ~MemberID,right.a,sum) Note that I know that numAMI is part of right.a because another function with the string AMI already generated it. I

Re: [R] simple save question

2011-07-13 Thread Sarah Goslee
Just an observation, since this email has no indication of what you're trying to get at and I'm not inspired to dig back through the list: On Wed, Jul 13, 2011 at 11:16 AM, Tom La Bone wrote: > > No cigar. This is what I get and my session info. Any suggestions? >> >> library(survival) >> library

Re: [R] fitdistr() Error

2011-07-13 Thread Uwe Ligges
On 13.07.2011 02:00, Peter Maclean wrote: There is no missing value nor zero values. OK, but to say more about your problem, we need the example to be reproducible but we do not have Gdata2 available. Please see the posting guide. Uwe Ligges - Original Message From: Uwe Ligg

Re: [R] Colors in R

2011-07-13 Thread Arun.stat
may be this is of some help http://research.stowers-institute.org/efg/R/Color/Chart/ _ Arun Kumar Saha, FRM QUANTITATIVE RISK AND HEDGE CONSULTING SPECIALIST Visit me at: http://in.linkedin.com/in/ArunFRM _

Re: [R] simple save question

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 11:16 AM, Tom La Bone wrote: No cigar. This is what I get and my session info. Any suggestions? First think ... try this sfit <- summary(fit, rmean = "individual") sfit$table[5] Hmmm. Second think. I suppose it's also possible that some of my unsuccessful efforts last

Re: [R] question on formula and terms.formula()

2011-07-13 Thread William Dunlap
Does your code work if you omit the match.call step? terms() generally doesn't need that. Also, do not call terms.formula(formula): call just terms(formula). The terms method appropriate to the class of the formula will be used. > f1 <- function(formula, ...) { + terms(formula, ...) +

Re: [R] Colors in R

2011-07-13 Thread Curt Seeliger
> I'm trying to assign colors to multiple lines in a graph. Problem is > I don't want to type in as many colors as there are lines You'll find your answer over the ?rainbow, I bet. cur -- Curt Seeliger, Data Ranger Raytheon Information Services - Contractor to ORD seeliger.c...@epa.gov 541/7

Re: [R] Error when writing to Excel files using the packages xlsx and xlsx2

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 11:49 AM, David Winsemius wrote: In particular: The xls.write function in gdata uses Perl. Wrong name I was thinking of read.xls in gdata. David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list ht

[R] AR-GARCH with additional variable - estimation problem

2011-07-13 Thread Marcin P?�ciennik
Dear list members, I am trying to estimate parameters of the AR(1)-GARCH(1,1) model. I have one additional dummy variable for the AR(1) part. First I wanted to do it using garchFit function (everything would be then estimated in one step) however in the fGarch library I didn't find a way to includ

[R] Colors in R

2011-07-13 Thread Trevino, Lisa
HI everyone, I'm trying to assign colors to multiple lines in a graph. Problem is I don't want to type in as many colors as there are linesis there a way around this? In brief, I'm plotting the logratio for up to 60 samples and want a different color for each sample. Here is the code I'm us

Re: [R] simple save question

2011-07-13 Thread Tom La Bone
No cigar. This is what I get and my session info. Any suggestions? > > library(survival) > library(ISwR) > dat.s <- Surv(melanom$days,melanom$status==1) > fit <- survfit(dat.s~1) > print(fit, print.rmean=TRUE) Call: survfit(formula = dat.s ~ 1) records n.maxn.start events *rm

Re: [R] help with spatstat ppp transformation data

2011-07-13 Thread jai1408
Hi, Did you receive a solution to your problem. I have a 3-D data set. X, Y and Z co ordinates. I want to read it as ppp data to be able to use it to find Kestimate. Do let me know if you had any success and how you did it. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/h

Re: [R] 3D density plot of point set

2011-07-13 Thread Duncan Murdoch
On 13/07/2011 3:56 AM, Lutz Gehlen wrote: Hello everybody, I would like to solve the problem described below in R (if possible). I am very new to R and have therefore no idea what to even look for in the docu. Therefore, if someone could tell me if this is possible in R and where I might find the

Re: [R] Package rrcov, functions PcaCov, PcaHubert, PcaGrid

2011-07-13 Thread albina1985
Ok, thank you Mark. I also found out, that it is not a good idea to perform a Pca with the equal numbers of observation and variables. It is preferable to have much more observations. Regards, Albina. -- View this message in context: http://r.789695.n4.nabble.com/Package-rrcov-functions-PcaCov

Re: [R] when to use `which'?

2011-07-13 Thread William Dunlap
x[which(condition)], like the subset function, treats NAs in condition as FALSE and hence does not output NAs for them. I was also surprised to see that it runs a trifle faster than x[condition] in R 2.13.0 if there are few TRUEs in condition and a trifle slower if there are many TRUEs. A danger o

Re: [R] Error when writing to Excel files using the packages xlsx and xlsx2

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 9:14 AM, syrvn wrote: Hi, thanks for this web page! Grothendieck had offered: - There are quite a few approaches listed here: http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows - We decided to go for XLConnect because it can read and write xlsx she

[R] Error non-numeric argument to binary operator

2011-07-13 Thread Bansal, Vikas
Dear all, I have a data frame df and i am using a code shown below. df[, "total"] <- rowSums(df[, 3:6]) MAKING A NEW COLUMN total in df BY ROWSUMS defineSamples<- function() { readline("enter the number of INDIVIDUALS IN POOL: ") } df$ind=definesamples() CALLING THE FUNCTI

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Lyndon Estes
Hi Bert, Just to clarify, I used that particular construction simply to remove the name from the vector, which I thought had something to do with the problem I was having, which was that two seemingly identical answers resulting from the quantile function where producing different results in a con

Re: [R] Import big xml data

2011-07-13 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of David Winsemius > Sent: Wednesday, July 13, 2011 8:17 AM > To: Sebastian Kruk > Cc: r-help@r-project.org > Subject: Re: [R] Import big xml data > > > On Jul 13, 2011, at 8:09 AM

Re: [R] Meaning of "%%"

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 6:27 AM, Vincy Pyne wrote: help("%%") GIVES ME Error in file(out, "wt") : cannot open the connection In addition: Warning message: In file(out, "wt") : cannot open file 'C:\DOCUME~1\LOCALS~1\Temp\RtmpoCnAxB\Rtxt52325f7': No such file or directory It gives me perf

Re: [R] adding text to spplot

2011-07-13 Thread Matevž Pavlič
Hi, still have troubles, if I have a code like this : spplot(enaD2, "var1.pred",sp.layout=pts, main = "globina 60 cm", sub="D2", col.regions=terrain.colors(64), contour=T) i get a nice plot with contours but without text. If ia use your code : spplot(enaD2, "var1.pred",sp.layout=pts, main

Re: [R] Import big xml data

2011-07-13 Thread David Winsemius
On Jul 13, 2011, at 8:09 AM, Sebastian Kruk wrote: Dear R users, I would like to import a big xml file. I don't want to learn about xml structures, just to import all the data to a data frame. How can I do it? I am reminded of this: library(fortunes) fortune("brain surgery") -- David W

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Bert Gunter
Rather strange ... Why would one convert a numeric to character and then back again to numeric? Why would one assume that such a conversion would retain full machine precision? In fact, ?as.character tells you: as.character represents real and complex numbers to 15 significant digits (technica

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Lyndon Estes
Hello Eik, Thanks very much for your response and for directing me to a useful explanation. To make sure I am grasping your answer correctly, the two problems I was experiencing are related to the fact that the floating point numbers I was calculating and using in subsequent indices were not enti

Re: [R] Subsetting NaN values in localG()

2011-07-13 Thread dab98
Still have not solved this problem with package 'spdep'. It appears localG() cannot handle either SpatialPoints or a matrix of point coordinates that are not in a rectangular matrix when plotted. It cannot take NaN values and, after I successfully used dnearnigh() to create an "nb" object for ONLY

  1   2   >