Re: [R] Calculating correlation

2010-11-22 Thread Tal Galili
Hi there, I'm not sure I understand your question. What are the two vectors you wish to check their correlation? Are they the two rows x and a? Because from your example it seems you are trying to do a correlation between two singular numbers (so probably I didn't get something straight). Tal

Re: [R] How to start default browser on R

2010-11-22 Thread Stephen Liu
Hi David, I see. File: gives the full path to the .html file created/download. Then the browser will open that file. Thanks. I don't have hwriter package installed. A side question, what will be the corresponding command on R for check whether a package already installed? similar to; On R

Re: [R] Some questione about plot

2010-11-22 Thread Jim Lemon
On 11/22/2010 10:14 PM, romzero wrote: Q1: How can i draw LSD (Least significant difference) on a plot? Like this... http://r.789695.n4.nabble.com/file/n3053430/LSD.jpg Q2: How can i draw the axis secondary scale? Hi romzero, This is somewhat of a guess, but: segments(2.3,1.6,2.3,1.6+) text(

[R] Calculating correlation

2010-11-22 Thread gireesh bogu
Hi guys I have an input file with multiple columns and and rows. Is it possible to calculate correlation of certain value of certain No (For example x of S1 = 112) with all other values (for example start with x 112 corr a 3 of S1 = x-a 0.2 ) INPUT *** No S1 S2 S3 S4 Sn a3 4

Re: [R] compare GLM coefficients

2010-11-22 Thread Michael Bedward
Hello Kayce, My (very basic) understanding is that you can't directly compare the coefficients across models that have different response variables, nor could you use AIC and similar metrics of model goodness of fit. Instead, I think you have to carefully define what you mean by "reveal similar po

[R] compare GLM coefficients

2010-11-22 Thread Kayce anderson
I have a data set of repeated abundance counts over time. I am investigating whether count data reduced to presence-absence (presence) data will reveal similar population trends. I am using a negative binomial distribution for the glm (package MASS) because the count data contains many zeros and

[R] Lattice and Quartz

2010-11-22 Thread Sarah Berry
I ran this script in a source file on my Mac: library(lattice) year <- 1900:2000 dollars <- (year-1899)^2 plot(year,dollars) quartz("year") histogram(~dollars) The first plot appears in Quartz 2. The second quartz window, named year, opens but the histogram doesn't appear. However, when I copy

[R] Explained GLZ model variation

2010-11-22 Thread Shai
Hello, I am using the MASS library to create some GLZ models. How can I know how much (%) of the variation is explained by the model, and if it is significant? I did not see this in the anova() or summary() tables... Thanks! Shai __ R-help@r-project.or

Re: [R] question about constraint minimization

2010-11-22 Thread dhacade...@gmail.com
Dear Prof. Ravi Varadhan, Many thanks for the reply. In my case, besides x1=x3, x1=x4 ("x1=x3=x4" was used in last post), another constraint is needed, x2+x3+x4+...+x12=1.5. So there are 9 variables. I have downloaded your code, but I even do not know how to call your code in R program. Actually

Re: [R] factorial ANOVA for block/split-plot design

2010-11-22 Thread RICHARD M. HEIBERGER
Please see the maiz example at the end of ?HH::MMC You will need to all the way to the end of the example. If you don't yet have HH, you can get it with install.packages("HH") If you need to write back to the list, please include your attempts. Rich [[alternative HTML version deleted]]

[R] factorial ANOVA for block/split-plot design

2010-11-22 Thread Mari Pesek
Dear R Help - I am analyzing data from an ecological experiment and am having problems with the ANOVA functions I've tried thus far. The experiment consists of a blocked/split-plot design, with plant biomass as the response. The following is an overview of the treatments applied (nitrogen addition

[R] (no subject)

2010-11-22 Thread Mari Pesek
Dear R Help - I am analyzing data from an ecological experiment and am having problems with the ANOVA functions I've tried thus far. The experiment consists of a blocked/split-plot design, with plant biomass as the response. The following is an overview of the treatments applied (nitrogen addition

Re: [R] Kalman filter

2010-11-22 Thread David Stoffer
It sounds like you've looked at the DLM, DSE, and SSPIR packages. If not, then certainly check them out. Also, we have code for filtering, smoothing and estimation in our text- go to www.stat.pitt.edu/stoffer/tsa3/ and look at the code for chapter 6. There's not a package for the text, but all

[R] overlay histograms on map at map coordinates

2010-11-22 Thread Steve Bellan
Hi all, I'm trying to visualize animal movement data characteristics spatiotemporally by overlaying many different histograms on a map. I want the histograms to be plotted at coordinates in the map that matches a region they describe. If I was just doing this once, I'd fiddle in Illustr

Re: [R] Is it possible to make a matrix to start at row 0?

2010-11-22 Thread David Stoffer
bogdanno-2 wrote: > > I want to make the matrix to be indexed from row (column) 0, not 1 > Can I do that? How? > Thanks > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http

Re: [R] how to calculate derivative

2010-11-22 Thread Spencer Graves
The "fda" package includes various implementations for smoothing data and differentiating the smooth, per Ravi's alternative approach. This is generally preferable to using first differences of raw data, because differencing raw data amplifies noise, while appropriate smooths eliminate m

Re: [R] How to start default browser on R

2010-11-22 Thread David Scott
On 23/11/10 16:59, Stephen Liu wrote: Hi Ista, I see. Your advice works. Thanks even without: browser="C:/Program Files/Internet Explorer/iexplore.exe") For non default browser it needs; browser="C:/Program Files/Mozilla Firefoe/firefox.exe" What will be "file:" used for? B.R. Stephen L

Re: [R] How to start default browser on R

2010-11-22 Thread Stephen Liu
Hi Ista, I see. Your advice works. Thanks even without: browser="C:/Program Files/Internet Explorer/iexplore.exe") For non default browser it needs; browser="C:/Program Files/Mozilla Firefoe/firefox.exe" What will be "file:" used for? B.R. Stephen L - Original Message From: Ist

Re: [R] how to calculate derivative

2010-11-22 Thread Ravi Varadhan
Here is a simple approach: data <- read.table("test-data.txt") deriv <- diff(data$V2) / diff(data$V1) times <- (data$V1[-1] + data$V1[-3545])/2 plot(times, deriv, type="l") Another approach is to smooth the original data and then obtain derivatives from the smooth Ravi.

Re: [R] How to start default browser on R

2010-11-22 Thread Ista Zahn
Hi Stephen, I'm not sure if this is the problem, but you almost certainly do not want the "file:" part. Try browseURL("http://www.r-project.org";) -Ista On Mon, Nov 22, 2010 at 10:26 PM, Stephen Liu wrote: > Hi David, > > Thanks for your advice. > > According to the Example on ?browseURL I trie

Re: [R] How to start default browser on R

2010-11-22 Thread Stephen Liu
Hi David, Thanks for your advice. According to the Example on ?browseURL I tried: 1) browseURL("file:http://www.r-project.org";, browser="C:/Program Files/Internet Explorer/iexplore.exe") It starts a small windows asking for permission to accept ActiveX -> OK IE doesn't start 2) browseURL("f

Re: [R] using the "apply" method for functions with multiple inputs

2010-11-22 Thread David Winsemius
On Nov 22, 2010, at 8:38 PM, joeponzio wrote: hello r users, i'm trying to use the apply method on a function with several inputs, but cannot figure out how to send multiple arguments to the function (not multiple runs of the same function, but one run of the function including two vari

[R] permalgorithm

2010-11-22 Thread Kere Klein
To whom may it concern, What is a proper way to analyse a dataset generated from permalgorithm with time varying covariates? It seems like to me that interval censoring would be the choice but Surv suggests that the event would be regarded as occurred at the end of the time interval... Best wi

[R] using the "apply" method for functions with multiple inputs

2010-11-22 Thread joeponzio
hello r users, i'm trying to use the apply method on a function with several inputs, but cannot figure out how to send multiple arguments to the function (not multiple runs of the same function, but one run of the function including two variables - each used within the function). a <- c(1:10,999

Re: [R] Find in R and R books

2010-11-22 Thread Spencer Graves
Hi, Mike, et al.: On 11/22/2010 5:43 PM, Mike Marchywka wrote: Date: Mon, 22 Nov 2010 17:28:57 -0800 From: spencer.gra...@structuremonitoring.com To: g...@well.ox.ac.uk CC: r-h...@stat.math.ethz.ch Subject: Re: [R] Find in R and R books Other p

Re: [R] How to start default browser on R

2010-11-22 Thread David Scott
On 23/11/10 14:20, Stephen Liu wrote: Hi folks, Win7 64 bit IE 64 bit How to start IE on R? TIA B.R. Stephen L ?browseURL -- _ David Scott Department of Statistics The University of Auckland, PB 92019

Re: [R] how to loop through variables in R?

2010-11-22 Thread watashi
d<-read.table("D:\\Working\\Statics.txt") df <- cbind("Q1", "Q2", "Q3", "Q4", "Q5", "Q5A", "Q5B", "Q5C", "Q5D", "Q5E", "Q5F", "Q5G", "Q6", "Q6A", "Q6B", "Q6C", "Q6D", "Q6E", "Q6F", "Q7", "Q8", "Q9") #Than you can loop through them simply by doing: result <- numeric(length(df)) for (i in 1:(leng

Re: [R] Fast Two-Dimensional Optimization

2010-11-22 Thread Ben Bolker
Wonsang You ifn-magdeburg.de> writes: > I have attempted "optim" function to solve a two-dimensional optimization > problem. It took around 25 second to complete the procedure. > However, I want to reduce the computation time: less than 7 second. Is there > any optimization function in R which is

Re: [R] Find in R and R books

2010-11-22 Thread Mike Marchywka
> Date: Mon, 22 Nov 2010 17:28:57 -0800 > From: spencer.gra...@structuremonitoring.com > To: g...@well.ox.ac.uk > CC: r-h...@stat.math.ethz.ch > Subject: Re: [R] Find in R and R books > > Other people like R Site Search > (http://search.r-project.org/n

Re: [R] calculating martingale residual on new data using "predict.coxph"

2010-11-22 Thread Shi, Tao
Thank you, David! You've been always helpful! ...Tao - Original Message > From: David Winsemius > To: "Shi, Tao" > Cc: r-help@r-project.org; dieter.me...@menne-biomed.de; r_ting...@hotmail.com > Sent: Sun, November 21, 2010 5:50:31 AM > Subject: Re: [R] calculating martingale resid

Re: [R] calculating martingale residual on new data using

2010-11-22 Thread Shi, Tao
Thank you for the advice, Frank! ...Tao - Original Message > From: Frank Harrell > To: r-help@r-project.org > Sent: Sun, November 21, 2010 5:49:36 AM > Subject: Re: [R] calculating martingale residual on new data using > > > The tendency is to use residual-like diagnostics on the en

Re: [R] calculating martingale residual on new data using "predict.coxph"

2010-11-22 Thread Shi, Tao
Thank you, Terry! - Original Message > From: Terry Therneau > To: "Shi, Tao" > Cc: r-help@r-project.org; dieter.me...@menne-biomed.de; r_ting...@hotmail.com > Sent: Mon, November 22, 2010 6:11:15 AM > Subject: Re: calculating martingale residual on new data using "predict.coxph" >

Re: [R] Find in R and R books

2010-11-22 Thread Spencer Graves
Other people like R Site Search (http://search.r-project.org/nmz.html), which is available via the standard R function "RSiteSearch". For me, the fastest literature search on virtually anything statistical is the "findFn" function in the "sos" package. (Disclaimer: I'm the lead

[R] question on "uniCox"

2010-11-22 Thread Shi, Tao
Hi list, I’m testing out uniCox R package (version 1.0, on R2.12.0, WinXP). When I ran uniCox on my data, there are always some NA’s in the beta matrix, which in turn causes problems in uniCoxCV call. I don’t see anything wrong with the corresponding data (e.g. no NAs) and if I fit a univa

[R] How to start default browser on R

2010-11-22 Thread Stephen Liu
Hi folks, Win7 64 bit IE 64 bit How to start IE on R? TIA B.R. Stephen L __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide com

Re: [R] how to loop through variables in R?

2010-11-22 Thread watashi
-Original Message- From: Yuliya Matveyeva To: wata...@post.com Sent: Mon, Nov 22, 2010 4:32 pm Subject: Re: [R] how to loop through variables in R? If you want to have a name-specific loop. Assign names to your variables after inserting them into the data.frame like that: colnames(df)

[R] R on Androids?

2010-11-22 Thread Erin Hodgess
Dear R People: Does R run on the Android, yet, please? I'm about 99% sure that it does not, but thought that I would double check. Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail.com

Re: [R] Gap between graph and axis

2010-11-22 Thread Bill.Venables
perhaps you need something like this. par(yaxs = "i") plot(runif(10), type = "h", ylim = c(0, 1.1)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Sebastian Rudnick Sent: Tuesday, 23 November 2010 10:37 AM To: r-help@r-project.

[R] Gap between graph and axis

2010-11-22 Thread Sebastian Rudnick
Hi everyone! I want to plot some precipitation data via plot(type="h"). Unfortunately there is always a gap between the bars and the x-axis, so that the bars reach in the "negative area" below 0 at the y-axis, which is very misleading. The ylim-parameter is set to 0 and max of precipitation, the m

Re: [R] plotting a timeline

2010-11-22 Thread Peter Ehlers
On 2010-11-20 14:26, Marcin Gomulka wrote: I was trying to recreate this kind of timeline plot: http://www.vertex42.com/ExcelArticles/create-a-timeline.html As you can see in their excel example, the events are nicely placed out on both sides of the timeline axis. AFAIK there is no function to

Re: [R] how do remove those predictor which have p value greater than 0.05 in GLM?

2010-11-22 Thread David Winsemius
On Nov 22, 2010, at 5:10 PM, shubha wrote: Thanks for the response, Frank. I am not saying that I want to delete a variables because of p>0.5. Presumably that was meant to be p > 0.05 But my concern was: I am using backward stepwise logistic regression, it keeps the variables in the fina

Re: [R] I need a very specific unique like function and I don't know even how to properly call this

2010-11-22 Thread Phil Spector
Given a vector, x, we can test if the value above it is equal to itself with abv = c(FALSE,x[-l] == x[-1]) and if the value below is equal to itself with blw = c(x[-l] == x[-1],FALSE) So, for your problem: abv = c(FALSE,dat[,2][-l] == dat[,2][-1]) blw = c(dat[,2][-l] == dat[,2][-1],FAL

[R] Sporadic errors when training models using CARET

2010-11-22 Thread Kendric Wang
Hi. I am trying to construct a svmLinear model using the "caret" package (see code below). Using the same data, without changing any setting, sometimes it constructs the model successfully, and sometimes I get an index out of bounds error. Is this unexpected behaviour? I would appreciate any insigh

Re: [R] ?summaryRprof running at 100% cpu for one hour ...

2010-11-22 Thread Mike Marchywka
> Date: Mon, 22 Nov 2010 19:59:04 -0300 > Subject: Re: [R] ?summaryRprof running at 100% cpu for one hour ... > From: kjetilbrinchmannhalvor...@gmail.com > To: marchy...@hotmail.com > CC: lig...@statistik.tu-dortmund.de; r-help@r-project.org > > see

Re: [R] empity value in colnames

2010-11-22 Thread David Winsemius
On Nov 22, 2010, at 5:36 PM, M.Ribeiro wrote: Hi Guys. I have a matrix which has names in every other column and the other one is empity ("") example X1 X10001 X10002 [1,] "A""G" "A""G" "G" [2,] "G""G" "A""G" "A" [3,] "G""G" "A""A" "A" [4,] "G""G

Re: [R] ?summaryRprof running at 100% cpu for one hour ...

2010-11-22 Thread Kjetil Halvorsen
see below. On Mon, Nov 22, 2010 at 12:57 PM, Mike Marchywka wrote: > > > > > > > > > >> Date: Mon, 22 Nov 2010 12:41:06 -0300 >> Subject: Re: [R] ?summaryRprof running at 100% cpu for one hour ... >> From: kjetilbrinchmannhalvor...@gmail.com >> To: marchy

[R] empity value in colnames

2010-11-22 Thread M.Ribeiro
Hi Guys. I have a matrix which has names in every other column and the other one is empity ("") example X1 X10001 X10002 [1,] "A""G" "A""G" "G" [2,] "G""G" "A""G" "A" [3,] "G""G" "A""A" "A" [4,] "G""G" "A""A" "A" [5,] "A""G" "A"

Re: [R] Probit Analysis: Confidence Interval for the LD50 using Fieller's and Heterogeneity (UNCLASSIFIED)

2010-11-22 Thread Dennis Murphy
Hi: The MASS package has a function dose.p() to produce a CI for ED50, ED90 or EDp in general (0 < p < 100). It takes a model object (presumably from a suitable logistic regression) as input. You could always take the code already available and adapt it to your situation or you could investigate

Re: [R] Probit Analysis: Confidence Interval for the LD50 using Fieller's and Heterogeneity (UNCLASSIFIED)

2010-11-22 Thread David Winsemius
On Nov 22, 2010, at 2:24 PM, Kenney, Colleen T CTR USA AMC wrote: Classification: UNCLASSIFIED Caveats: NONE A similar question has been posted in the past but never answered. My question is this: for probit analysis, how do you program a 95% confidence interval for the LD50 (or LC50, ec50,

Re: [R] cpgram: access data, confidence bands

2010-11-22 Thread David Scott
On 22/11/10 22:54, Henri Mone wrote: Dear R experts, beginners and everyone else, I'm calculating "cumulative periodogram" using the command "cpgram" [1] from the MASS library. Here is a short example with the "lh" (hormone level) dataset: library(MASS) plot(lh,type="l",ylab="value",xlab

[R] Probit Analysis: Confidence Interval for the LD50 using Fieller's and Heterogeneity (UNCLASSIFIED)

2010-11-22 Thread Kenney, Colleen T CTR USA AMC
Classification: UNCLASSIFIED Caveats: NONE A similar question has been posted in the past but never answered. My question is this: for probit analysis, how do you program a 95% confidence interval for the LD50 (or LC50, ec50, etc.), including a heterogeneity factor as written about in "Probit A

Re: [R] Help: Standard errors arima

2010-11-22 Thread Dennis Murphy
Hi: Here's an example (never mind the model fit...or lack of it thereof...) str(AirPassengers) # a built-in R data set # Series is seasonal with increasing trend and increasing variance plot(AirPassengers, type = 'l') # STL decomposition plot(stl(AirPassengers, 'periodic')) # ACF and PACF o

Re: [R] how do remove those predictor which have p value greater than 0.05 in GLM?

2010-11-22 Thread shubha
Thanks for the response, Frank. I am not saying that I want to delete a variables because of p>0.5. But my concern was: I am using backward stepwise logistic regression, it keeps the variables in the final model if the variable significantly contributing in the model. Otherwise, it should not be

Re: [R] R2WinBUGS help

2010-11-22 Thread bmiddle
When I use the 'bugs' function from R, WinBUGS runs correctly, but R freezes. > The only way to use R after this is to stop calculations (without my file > that documents the calculation). R "freezes" as long as the WinBUGS process is opened. AFter closing it, R should "respond" again. If

Re: [R] I need a very specific unique like function and I don't know even how to properly call this

2010-11-22 Thread Ista Zahn
Here is a method for piecing it together using diff and indexing: dat <- structure(c(3L, 6L, 7L, 3L, 7L, 5L, 8L, 2L, 7L, 0L, 7L, 5L, 5L, 5L, 5L, 5L, 4L, 4L, 4L, 6L), .Dim = c(10L, 2L), .Dimnames = list( NULL, c("V1", "V2"))) diffs <- abs(diff(dat[,2], 1)) # get the difference between each v

Re: [R] R package "kernlab" can not be properly loaded

2010-11-22 Thread Uwe Ligges
On 22.11.2010 21:55, Xiaoqi Cui wrote: Hi, I tried to load the package "kernlab" under R-v11 and R-v10, however it gave error message: Error in library.dynam(lib, package, package.lib) : shared library 'kernlab' not found In addition: Warning message: package 'kernlab' was built under R v

Re: [R] R package "kernlab" can not be properly loaded

2010-11-22 Thread David Winsemius
On Nov 22, 2010, at 3:55 PM, Xiaoqi Cui wrote: Hi, I tried to load the package "kernlab" under R-v11 and R-v10, however it gave error message: Error in library.dynam(lib, package, package.lib) : shared library 'kernlab' not found In addition: Warning message: package 'kernlab' was built u

Re: [R] R2WinBUGS help

2010-11-22 Thread Uwe Ligges
On 22.11.2010 21:41, bmiddle wrote: When I use the 'bugs' function from R, WinBUGS runs correctly, but R freezes. The only way to use R after this is to stop calculations (without my file that documents the calculation). R "freezes" as long as the WinBUGS process is opened. AFter closing it,

Re: [R] Help: Standard errors arima

2010-11-22 Thread David Winsemius
On Nov 22, 2010, at 4:29 PM, lucia wrote: Hello, I'm an R newbie. I've tried to search, but my search skills don't seem up to finding what I need. (Maybe I don't know the correct terms?) I need the standard errors and not the confidence intervals from an ARIMA fit. I can get fits: >

[R] Help: Standard errors arima

2010-11-22 Thread lucia
Hello, I'm an R newbie. I've tried to search, but my search skills don't seem up to finding what I need. (Maybe I don't know the correct terms?) I need the standard errors and not the confidence intervals from an ARIMA fit. I can get fits: > coef(test) ar1

Re: [R] how do remove those predictor which have p value greater than 0.05 in GLM?

2010-11-22 Thread Frank Harrell
What would make you want to delete a variable because P > 0.05? That will invalidate every aspect of statistical inference for the model. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/how-do-remove-

Re: [R] "negative alpha" or custom gradient colors of data dots in...

2010-11-22 Thread madr
Well I "hacked" it i maybe not so elegant way: x <- rnorm(10) y <- rnorm(10) png('out.png',width=600,height=500,units="px") op <- par(bg='black',fg='gray',col='gray',col.axis='gray',col.lab='gray',col.main='gray',col.sub='gray',mai=c(0,0,0,0), tck = 0.01, mgp = c(0, -1.4, 0), xaxs = "i",

Re: [R] aggregate a Date column does not work?

2010-11-22 Thread Gabor Grothendieck
On Mon, Nov 22, 2010 at 3:39 PM, Tan, Richard wrote: > Hi, I am trying to aggregate max a Date type column but have weird > result, how do I fix this? > >> a <- rbind( > > + data.frame(name='Tom', payday=as.Date('1999-01-01')), > + data.frame(name='Tom', payday=as.Date('2000-01-01')), > + data.fra

Re: [R] aggregate a Date column does not work?

2010-11-22 Thread Tan, Richard
Yes, I meant something like one of these: b <- aggregate(a$payday, list(a$name), max) b$x <- as.Date('1970-01-01') + b$x or b$x <- as.Date(b$x, origin='1970-01-01') Thanks. -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Monday, November 22, 2010 3:58 PM

Re: [R] aggregate a Date column does not work?

2010-11-22 Thread David Winsemius
On Nov 22, 2010, at 3:54 PM, Tan, Richard wrote: Thanks, add as.Date('1970-01-01') to the result column works. But that should make them all the same date in 1970. Since aggregate renames the date column to "x", this should work: as.Date( aggregate(a$payday, list(a$name), max)$x ) [1] "20

Re: [R] Rexcel

2010-11-22 Thread Erich Neuwirth
a) RExcel has its own mailing list (as the documentation tell you). Please post RExcel related questions to the mailing list accessible at rcom.univie.ac.at b) For running code at startup, you have to create a worksheet (not a workbook) named RCode in your workbook. On 11/22/2010 7:15 PM, csrabak

[R] R package "kernlab" can not be properly loaded

2010-11-22 Thread Xiaoqi Cui
Hi, I tried to load the package "kernlab" under R-v11 and R-v10, however it gave error message: Error in library.dynam(lib, package, package.lib) : shared library 'kernlab' not found In addition: Warning message: package 'kernlab' was built under R version 2.12.0 Error: package/namespace loa

Re: [R] aggregate a Date column does not work?

2010-11-22 Thread Tan, Richard
Thanks, add as.Date('1970-01-01') to the result column works. Richard -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Monday, November 22, 2010 3:51 PM To: Tan, Richard Cc: r-help@r-project.org Subject: Re: [R] aggregate a Date column does not work? On No

[R] I need a very specific unique like function and I don't know even how to properly call this

2010-11-22 Thread madr
consider this matrix: [,1] [,2] [1,]3 7 [2,]6 5 [3,]7 5 [4,]3 5 [5,]7 5 [6,]5 5 [7,]8 4 [8,]2 4 [9,]7 4 [10,]0 6 I need to delete all rows where column 2 above and below has the same value, so the effect would be:

Re: [R] aggregate a Date column does not work?

2010-11-22 Thread David Winsemius
On Nov 22, 2010, at 3:39 PM, Tan, Richard wrote: Hi, I am trying to aggregate max a Date type column but have weird result, how do I fix this? In the process of getting max() you coerced the Dates to numeric and now you need to re-coerce them back to Dates ?as.Date as.Date() (possibly wi

Re: [R] Is it possible to make a matrix to start at row 0?

2010-11-22 Thread Mike Marchywka
> To: r-h...@stat.math.ethz.ch > From: bbol...@gmail.com > Date: Mon, 22 Nov 2010 19:59:23 + > Subject: Re: [R] Is it possible to make a matrix to start at row 0? > > Bert Gunter gene.com> writes: > > > > > Eh??? Why would you want to do that?? (

Re: [R] FW: help with time Series regression please

2010-11-22 Thread tomreilly
Cathy, How does this model look? [(1-B**4)]Y(T) = 20.767 +[X1(T)][(1-B**4)][(+ 56.1962)] :PULSE 7/ 4 I~P00028test +[X2(T)][(1-B**

[R] R2WinBUGS help

2010-11-22 Thread bmiddle
When I use the 'bugs' function from R, WinBUGS runs correctly, but R freezes. The only way to use R after this is to stop calculations (without my file that documents the calculation). However, I want to save the output in R so I can use it in further models. Does anyone know how to fix this probl

[R] aggregate a Date column does not work?

2010-11-22 Thread Tan, Richard
Hi, I am trying to aggregate max a Date type column but have weird result, how do I fix this? > a <- rbind( + data.frame(name='Tom', payday=as.Date('1999-01-01')), + data.frame(name='Tom', payday=as.Date('2000-01-01')), + data.frame(name='Pete', payday=as.Date('1998-01-01')), + data.frame(n

Re: [R] How to call web service in R

2010-11-22 Thread Steve Lianoglou
Hi, On Mon, Nov 22, 2010 at 4:51 AM, 夏高 wrote: > Hello everyone, > > I would like to call web service in R, how can I do this? Thank you! Is RCurl what you're looking for? http://cran.r-project.org/web/packages/RCurl/index.html -steve -- Steve Lianoglou Graduate Student: Computational Systems

Re: [R] how to round only one column of a matrix ?

2010-11-22 Thread Phil Spector
Is this what you're looking for? mymatrix = matrix(rnorm(15),5,3,dimnames=list(NULL,c('x','y','z'))) mymatrix x y z [1,] -0.4459162 -2.3936837 -0.7401963 [2,] 0.9886466 -1.3955161 -1.3390314 [3,] -0.2086743 1.7984620 -0.8532579 [4,] 1.0985411 0.9315553 -1.398

Re: [R] Is it possible to make a matrix to start at row 0?

2010-11-22 Thread baptiste auguie
Apparently He who starts from 0 needn't be called unfortunate, fortune('indexed') baptiste On 22 November 2010 20:59, Ben Bolker wrote: > Bert Gunter gene.com> writes: > >> >> Eh??? Why would you want to do that?? (R isn't C). >> >> So the simple answer is: you can't. >> >> The other answer is

[R] how to round only one column of a matrix ?

2010-11-22 Thread madr
round() function affects all values of a matrix, I want only to round column that is called 'y'. -- View this message in context: http://r.789695.n4.nabble.com/how-to-round-only-one-column-of-a-matrix-tp3054363p3054363.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] save a regression model that can be used later

2010-11-22 Thread David Winsemius
On Nov 22, 2010, at 10:02 AM, Ni, Melody Zhifang wrote: Hi everyone I have a question about how to save a regression model in R and how to retrieve it for making predictions in a new session. To be more specific, I fitted a multilevel logistic regression model using the lmer from the "l

Re: [R] Is it possible to make a matrix to start at row 0?

2010-11-22 Thread Ben Bolker
Bert Gunter gene.com> writes: > > Eh??? Why would you want to do that?? (R isn't C). > > So the simple answer is: you can't. > > The other answer is, well of course you sort of can via, e.g. > > for(i in 0:9) { >z <- myMatrix[i+1,] > ... > } > > But as Josh said, I think this falls in

Re: [R] Ordeing Zoo object

2010-11-22 Thread Gabor Grothendieck
On Mon, Nov 22, 2010 at 1:35 PM, Manta wrote: > > And how about if I want to order the series from the smallest to the largest > value, keeping the date index in order to see when the values were > predominantly negative etc... > If you just want to look at it in this order then: as.data.frame(d

Re: [R] Wait for user input with readline()

2010-11-22 Thread Joshua Wiley
Hi Nate, There may be better ways, but on the couple instances I've wanted to wait for keyboard input I used this type of paradigm: foo <- function() { x <- 1:10 y <- rnorm(10) input <- NA while(!isTRUE(input == "1") && !isTRUE(input == "2")) { cat("Please type '1' if you want the fir

Re: [R] sm.ancova graphic

2010-11-22 Thread Peter Ehlers
On 2010-11-22 09:47, Lucia Cañas wrote: Hi R-Users, I am working with sm.ancova (in the package sm) and I have two problems with the graph, which is automatically generated when sm.ancova() is run. 1-Besides of the fitted lines, the observed data appeared automatically in the graph. I prefer

Re: [R] RGoogleDocs stopped working

2010-11-22 Thread Harlan Harris
No joy for me. :( I'd had version 0.4-1 installed previously, and re-pulling that URL and reinstalling, plus setting RCurlOptions as specified, do not help for me. Exactly the same behavior. It doesn't matter whether I call getGoogleAuth directly or let getGoogleDocsConnection do it for me. -Har

Re: [R] Is it possible to make a matrix to start at row 0?

2010-11-22 Thread Bert Gunter
Eh??? Why would you want to do that?? (R isn't C). So the simple answer is: you can't. The other answer is, well of course you sort of can via, e.g. for(i in 0:9) { z <- myMatrix[i+1,] ... } But as Josh said, I think this falls into the class of "You are just asking for trouble, so don't

Re: [R] question about constraint minimization

2010-11-22 Thread Ravi Varadhan
I do not understand the constraint x1 = x3 = x4. If this is correct, you only have 10 unknown parameters. If you can correctly formulate your problem, you can have a look at the packages "alabama" or "BB". The function `auglag' in "alabama" or the function `spg' in "BB" may be useful. Ravi. --

Re: [R] Is it possible to make a matrix to start at row 0?

2010-11-22 Thread Joshua Wiley
Hi, You can do it, but it would be very difficult (think reworking all indexing yourself) and you probably should not even try (nothing else that was expecting indexing to work as the R gods intended it to would work once you had done your rework). What has lead you to want to index from 0? If i

[R] save a regression model that can be used later

2010-11-22 Thread Ni, Melody Zhifang
Hi everyone I have a question about how to save a regression model in R and how to retrieve it for making predictions in a new session. To be more specific, I fitted a multilevel logistic regression model using the lmer from the "lme4" package. I then successfully make predictions using fitt

[R] How to call web service in R

2010-11-22 Thread 夏高
Hello everyone, I would like to call web service in R, how can I do this? Thank you! Gao Xia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

[R] Wait for user input with readline()

2010-11-22 Thread Nathan Miller
Hello, I am trying write a script that includes a prompt for user input using readlines(). I am running into the problem that when I run readlines() as a single line the prompt works perfectly, but when I try to run a block of code which includes the readline function, the script doesn't wait for

[R] how do remove those predictor which have p value greater than 0.05 in GLM?

2010-11-22 Thread shubha
Hi R user, I am a kind of an intermediate user of R. Now I am using GLM model (library MASS, VEGUS). I used a backward stepwise logistic regression, but i got a problem in removing those predictors which are above 0.05. I don't want to include those variables which were above 0.05 in final backw

Re: [R] arima

2010-11-22 Thread tomreilly
Nuncio, No, there is no requirement to subtract the mean. It is required that the residuals are N.I.I.D. (ie constant mean and constant variance). If you have an upward trending series, for example, then the series would need to be "deseasonalized" so that it is constant. There are many many s

Re: [R] how to apply sample function to each row of a data frame?

2010-11-22 Thread wangwallace
I tried it. it works out perfectly. you save my life. -- View this message in context: http://r.789695.n4.nabble.com/Re-how-to-apply-sample-function-to-each-row-of-a-data-frame-tp3050933p3054117.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] txtProgressBar strange behavior in R 2.12.0

2010-11-22 Thread Viechtbauer Wolfgang (STAT)
I believe nobody has responded to far, so maybe this is not a wide-spread issue. However, I have also encountered this since upgrading to R 2.12.0 (Windows 7, 64-bit). In my simulations where I use txtProgressBar(), the problem usually disappears after the bar has progressed to a certain amount,

Re: [R] using rpart with a tree misclassification condition

2010-11-22 Thread meytar
Thank you for your prompt reply! Yes, I meant the apparent error rate. According to your advice, if I use "rpart" to build a full tree, what pruning command will be appropriate and will able me to add as an input to the pruning procedure the total error rate i'm looking for? Thank you very much Me

Re: [R] memory profiling

2010-11-22 Thread Patrick Leyshock
Using: summaryRprof(memory="both") did the trick, thank you. I had not been using that setting when calling summaryRprof. Thanks, Patrick 2010/11/20 Uwe Ligges > > > On 19.11.2010 21:48, Patrick Leyshock wrote: > >> I'm trying to configure Version 2.12.0 or R to do memory profiling. >> >>

Re: [R] Rexcel

2010-11-22 Thread csrabak
Em 22/11/2010 10:11, Luis Felipe Parra escreveu: Hello I am new to RExcel and I would like to run a source code form the excel worksheet. I would like to run the following code source("C:\\Quantil Aplicativos\\Genercauca\\BackwardSelectionNC.r") from the excel wroksheet. Does anybody know how t

Re: [R] question about constraint minimization

2010-11-22 Thread dhacade...@gmail.com
Hi, I have struggled on this "bound optimization with equality constraint" by using optim function for two days, but still fail to prepare a good input. Can anyone help to prepare the input for my specific case? Many thanks. Best, Hao On Sat, Nov 20, 2010 at 3:17 AM, Hans W Borchers [via R] <

[R] Some questione about plot

2010-11-22 Thread romzero
Q1: How can i draw LSD (Least significant difference) on a plot? Like this... http://r.789695.n4.nabble.com/file/n3053430/LSD.jpg Q2: How can i draw the axis secondary scale? Thanks for help. -- View this message in context: http://r.789695.n4.nabble.com/Some-questione-about-plot-tp3053430

Re: [R] Lost in POSIX

2010-11-22 Thread Dimitri Shvorob
> Nor would I call this much of an improvement in clarity... what about "min"? You want to know the minimum? LOL. (And apologies for the insensitivity). Thank you for help, Jeff. This works, but I am still curious to see a solution based on "trunc", if anyone can find it. -- View this message i

  1   2   >