Re: [R] package update

2011-05-10 Thread eric
ok, how do I do root permissions from the RStudio GUI ? What is the specific command that allows me to do that when I type ...update.packages() ? Also, why are the packages installing in the first place if I can't write to that location ? Currently running linux ubuntu 10.04 by the way. -- Vie

Re: [R] spdep::poly2nb problem

2011-05-10 Thread Roger Bivand
This message should have had a more informative subject, and, given its specialist character, been sent to R-sig-geo, as is recommended on the Spatial Task View. From initial trials, the file you are using includes far too much boundary detail, and appears to have been assembled from disparate stat

[R] Scale time series in a way that 90% of the data is in the -0.-9/ +0.9 range

2011-05-10 Thread Mr Copper
Hello, please excuse my ignorance as i am new to R and this might seem trivial to you How can i scale my time series in a way that 90% of the data is in the -0.-9/ +0.9 range? I think i first have to select the 90% closest to the mean and then calculate my scaling parameter on it, then scale the

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread noxyp...@gmail.com
On Fri, May 6, 2011 at 7:41 PM, David Winsemius wrote: > > On May 6, 2011, at 11:35 AM, Pete Pete wrote: > >> >> Gabor Grothendieck wrote: >>> >>> On Tue, Dec 7, 2010 at 11:30 AM, Pete Pete >>> wrote: Hi, consider the following two dataframes: x1=c("232","3

Re: [R] Draw a nomogram after glm

2011-05-10 Thread Komine
Hi, I try always to do my nomogram. I change little my code in order to definite the range of my linear predictor. But I do not succeed to have 0 until 1. I tried this code. library(rms) d <- datadist(Fire) options(datadist='d') Fire$Ignition=c(0,1,by=0.1) f<-lrm(Ignition~FMC+Charge,data=Fire)

Re: [R] Saving multiple 3x3 TIFF graphics inside a loop

2011-05-10 Thread Uwe Ligges
On 10.05.2011 03:36, John S wrote: Dear Friends, I have been trying to save multiple 3x3 (mfrow=c(3,3) graphics inside a loop using tiff figure format (not using PDF or savePlot functions) with no success. Could you please help? Here is a simplified example code: dat=data.frame (ID=rep(1:1

Re: [R] Uniroot - error

2011-05-10 Thread peter dalgaard
On May 6, 2011, at 16:37 , Joshua Wiley wrote: > On Fri, May 6, 2011 at 6:33 AM, CarJabo wrote: >> sorry I am not asking someone to do my homework, as I have finished all the >> procedure. I am just wondering why this technical error occurs, so I can fix >> it myself. > > If whatever insti

Re: [R] Question Using Old R Packages

2011-05-10 Thread Duncan Murdoch
On 11-05-09 8:59 PM, c.hulmelowe wrote: In case anyone else is having similar problems, it turns out it may have been an issue with the interface I was using (R Studio). When I close R Studio and tried it again through R it installed without the error message. You should report this as a seriou

Re: [R] Installing package

2011-05-10 Thread Uwe Ligges
On 10.05.2011 06:34, Hurr wrote: Using install packages pull-down, I chose a mirror and then package rJava. Then it said that it cannot remove the rJava package already installed. Then when I typed library(rJava) it said there was no rjava package. Isn't that rather contradictory for R? Star

[R] Join and Meet on Lattice

2011-05-10 Thread Vahid
Hi, I am using a package to calculate Join and Meet on lattice. I have written a function that generates partitions and then try to see if their meet is the power set. When I give values to this function greater than lets say 6 (n=k=6) and delta =0 , it slows down. I believe it is something d

[R] Cumulative dose in survival models

2011-05-10 Thread klaus
Dear List,   I want to fit a CPH survival model with a time-dependent cumulative exposure variable. More specifically, I have exposure measurements for all cohort members at discrete times (yearly measurements) during follow-up.   I suppose that when estimating the model parameters the most corr

Re: [R] Draw a nomogram after glm

2011-05-10 Thread Frank Harrell
by is not an argument to c( ) datadist needs to know the final coding of variables so run it after doing any re-codes. You are using the wrong syntax for interact= Please take a while to read the full documentation before responding further, and read my earlier posts. Frank Komine wrote: > > Hi,

Re: [R] Creating Observation ID

2011-05-10 Thread Robert Baer
Thanks Bill and William. Both solutions work, and both have introduced me to whole new R functions which I'm still wrapping my head around. What a great resource this list is. Thanks again, Rob -- Robert W. Baer, Ph.D. Professor of Physiology Kirksville

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread David Winsemius
On May 10, 2011, at 3:18 AM, noxyp...@gmail.com wrote: On Fri, May 6, 2011 at 7:41 PM, David Winsemius > wrote: On May 6, 2011, at 11:35 AM, Pete Pete wrote: Gabor Grothendieck wrote: On Tue, Dec 7, 2010 at 11:30 AM, Pete Pete wrote: Hi, consider the following tw

Re: [R] Saving multiple 3x3 TIFF graphics inside a loop

2011-05-10 Thread John S
Thanks Uwe . The parentheses were a typo. Please note that if I have only 9 subjects in my data then the following works (creates 493 KB data file) #windows() {tiff(file=paste("Outfile",1,".tiff",sep=""),width=17.15 ,height=17.15,units="cm", res=1200, pointsize=10, compression = "lzw")}

[R] Plotting confidence Intervals

2011-05-10 Thread Shubham Saxena
Hey guys, Suppose i have X ~ LN(0,1) A = rlnorm(5) How can I plot the 95% Confidence Interval of the ecdf of A in R? Thank You [[alternative HTML version deleted]] __ R-help@r-project.org mailin

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread noxyp...@gmail.com
On Tue, May 10, 2011 at 3:09 PM, David Winsemius wrote: > > On May 10, 2011, at 3:18 AM, noxyp...@gmail.com wrote: > >> On Fri, May 6, 2011 at 7:41 PM, David Winsemius >> wrote: >>> >>> On May 6, 2011, at 11:35 AM, Pete Pete wrote: >>> Gabor Grothendieck wrote: > > On Tue, Dec 7

Re: [R] Cumulative dose in survival models

2011-05-10 Thread peter dalgaard
On May 10, 2011, at 10:52 , kl...@kaae-consult.dk wrote: > > Dear List, > > I want to fit a CPH survival model with a time-dependent cumulative exposure > variable. More specifically, I have exposure measurements for all cohort > members at discrete times (yearly measurements) during follow-

Re: [R] Reading a large netCDF file using R

2011-05-10 Thread David William Pierce
On Mon, May 9, 2011 at 6:29 PM, sulochandhungel wrote: > I got a netCDF file from a climate group and wanted to aggregate the data. > The file summary looks like this > [...] > > I didnt think it worked... can u suggest me some other way ... I could not > use the start and count properly Could

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread noxyp...@gmail.com
On Tue, May 10, 2011 at 3:09 PM, David Winsemius wrote: > > On May 10, 2011, at 3:18 AM, noxyp...@gmail.com wrote: > > On Fri, May 6, 2011 at 7:41 PM, David Winsemius >> wrote: >> >>> >>> On May 6, 2011, at 11:35 AM, Pete Pete wrote: >>> >>> Gabor Grothendieck wrote: > > On Tue

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread David Winsemius
On May 10, 2011, at 9:49 AM, noxyp...@gmail.com wrote: On Tue, May 10, 2011 at 3:09 PM, David Winsemius > wrote: On May 10, 2011, at 3:18 AM, noxyp...@gmail.com wrote: On Fri, May 6, 2011 at 7:41 PM, David Winsemius > wrote: On May 6, 2011, at 11:35 AM, Pete Pete wrote: Gabor Grothendi

Re: [R] Saving multiple 3x3 TIFF graphics inside a loop

2011-05-10 Thread nidal . alhuniti
Try this dat=data.frame (ID=rep(1:27,each=10),IDV=rep(seq(1:10),times=27)) dat$DV <- with(dat, 50+15*IDV) dat=dat[order(dat$ID,dat$IDV),] for(i in 1:27){ dt1 = dat[dat$ID==i,] pagei=as.integer(ceiling(i/9)) #open device for subjects 1-9 if(i==1) {tiff(file=paste("Outfile",pagei,".tiff

Re: [R] Weird read.xls behavior

2011-05-10 Thread Jun Shen
Hi, Kenneth, I would like a bit more advice on how to use gsub to remove the spaces at the beginning or the end for a data frame and still keep the data frame in the same format. The way I see is something like gsub(' *$', '' , unlist(dataframe)). But the result is not a data frame anymore. Thank

Re: [R] Weird read.xls behavior

2011-05-10 Thread David Winsemius
On May 10, 2011, at 10:54 AM, Jun Shen wrote: Hi, Kenneth, I would like a bit more advice on how to use gsub to remove the spaces at the beginning or the end for a data frame and still keep the data frame in the same format. The way I see is something like gsub(' *$', '' , unlist(datafra

[R] Problems with symbol in evaluate expression function in axis labels

2011-05-10 Thread fernando espindola
Hi R-helps I have the follow problem when try to put degree symbol in axis labels via expression function in the next example code, but when put infinity in expression put the degree symbol x<-sample(10);y<-sample(10) plot(x,y,pch="+",axes=FALSE,ylab="",xlab="") ax<-seq(1,10,by=2) axis(1,at=a

[R] need to delete by time, not date

2011-05-10 Thread Schatzi
I have a matrix where one column has a date and another column has a time. I need to delete all times before 6am. I had combined the Date and Time column into DateTime. Mat1: Weight Date Time 7.6 04/28/11 09:03 8.4 04/29/11 03:11 8.6 04/29/11 05:32 8.6 04/29/11 09:53 1.4 05/01

Re: [R] need to delete by time, not date

2011-05-10 Thread Clint Bowman
You may be happy using: strptime(paste(Date,Time,sep=" "),"%m/%d/%y %H:%M")$hour -- Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600

Re: [R] need to delete by time, not date

2011-05-10 Thread Adele_Thompson
I am already using that to combine the date and time (I had it in the code, but took it out for the post to simplify it), but I still have the problem where I want to remove any time before 6am across all dates. -Original Message- From: cl...@ecy.wa.gov [mailto:cl...@ecy.wa.gov] Sent: T

Re: [R] Weird read.xls behavior

2011-05-10 Thread Gabor Grothendieck
On Tue, May 10, 2011 at 10:59 AM, David Winsemius wrote: > > On May 10, 2011, at 10:54 AM, Jun Shen wrote: > >> Hi, Kenneth, >> >> I would like a bit more advice on how to use gsub to remove the spaces at >> the beginning or the end for a data frame and still keep the data frame in >> the same for

Re: [R] need to delete by time, not date

2011-05-10 Thread David Winsemius
On May 10, 2011, at 11:06 AM, Schatzi wrote: I have a matrix where one column has a date and another column has a time. I need to delete all times before 6am. I had combined the Date and Time column into DateTime. Mat1: Weight Date Time 7.6 04/28/11 09:03 8.4 04/29/11 03:11 8.6 04/29/

Re: [R] need to delete by time, not date

2011-05-10 Thread Adele_Thompson
Thanks, that did exactly what I wanted. I realize that I didn't put it in the best form, but was having trouble coming up with a replicable example. I see that many people here quickly create examples and I am learning how to do that, but still struggle, especially when using as.POSIXct and othe

Re: [R] Create subsets of data

2011-05-10 Thread Pavan G
Thanks David and Steve. This is exactly what I was looking for. tapply seems to be one robust command. (Humor of any potency is always a welcome thing in academia :) WSS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list h

Re: [R] Weird read.xls behavior

2011-05-10 Thread Gabor Grothendieck
On Tue, May 10, 2011 at 12:12 AM, Jun Shen wrote: > Kenneth, > > Thanks for the reply. I checked the original data. There is no space. I even > manually added a space to one value. After reading in with read.xls, the > value has two spaces. The reason I don't like it is I am going to do some > com

[R] maximize portfolio return under risk target

2011-05-10 Thread xavier abulker
Hello, I'm trying to build a simple example to maximize the return on a portfolio with a risk target (12%) and long positions only (0 <= weights <=1). I've read all the previous posts on fPortfolio and PortfolioAnalytics but I cannot find anything simple. Could you please help me? My code curre

[R] fitting non-intercept model with lrm

2011-05-10 Thread Clarissa Valim
I would appreciate if someone could tell me how to fit a non-intercept model using lrm (and not glm). The -1 in the formula of the glm does not work with lrm. Thanks, Clarissa [[alternative HTML version deleted]] __ R-help@r-project.org mailin

Re: [R] need to delete by time, not date

2011-05-10 Thread David Winsemius
On May 10, 2011, at 11:23 AM, adele_thomp...@cargill.com wrote: Thanks, that did exactly what I wanted. I realize that I didn't put it in the best form, but was having trouble coming up with a replicable example. I see that many people here quickly create examples and I am learning how to

Re: [R] Multiple comparisons for coxph survival analysis model

2011-05-10 Thread jul 2-pom
Hi ExpeRts, I find this post very interesting... as I have the same problem. I found on other webpages that a solution would be to run simple comparison and then to adjust for the P-value accordingly; However, I am not very satisfied by such approach, and i would very greatful to R if a multiple c

Re: [R] Using $ accessor in GAM formula

2011-05-10 Thread Gene Leynes
Gavin, Yes, I thought I was responding to Berwin, whoops! Since I'm often mixing different data frames, I rarely use this formulation: gam(y ~ s(x), dat) Actually, I often forget about that syntax, and it's a good reminder. It really is much easier to read. In my "real" model that people actua

[R] Default Colors in Script

2011-05-10 Thread Kishorenalluri
Dear Friends, I would appreciate one could help me, to prescribe the colors as default if i have 10 more lines in my Y-Axis. I don't wanna set for all the column color like this n_red <- subset(ts_data, my data>0, select=c(Fraction, column) points(n_red$Fraction, n_red$Column, type =

Re: [R] how to calculate the mean of a group in a table

2011-05-10 Thread tornanddesperate
Just wanted to thank everybody here for their great help. I tried the "tapply" and it worked brilliantly. By changing its parameters I can easily compute the values for the other treatments as well. Without help, I probably would just have despaired. Have a great time mat -- View this message in

Re: [R] Weird read.xls behavior

2011-05-10 Thread Jun Shen
Hi, Gabor, The interim fix solved the problem! Now it's working perfectly. And thanks for everyone's input. Jun On Tue, May 10, 2011 at 10:39 AM, Gabor Grothendieck < ggrothendi...@gmail.com> wrote: > On Tue, May 10, 2011 at 12:12 AM, Jun Shen wrote: > > Kenneth, > > > > Thanks for the reply.

Re: [R] Weird read.xls behavior

2011-05-10 Thread David Winsemius
On May 10, 2011, at 11:39 AM, Gabor Grothendieck wrote: On Tue, May 10, 2011 at 12:12 AM, Jun Shen wrote: Kenneth, Thanks for the reply. I checked the original data. There is no space. I even manually added a space to one value. After reading in with read.xls, the value has two spaces.

Re: [R] need to delete by time, not date

2011-05-10 Thread Adele_Thompson
Good deal. I will do that in the future. Thanks. -Original Message- From: dwinsem...@comcast.net [mailto:dwinsem...@comcast.net] Sent: Tuesday, May 10, 2011 10:45 AM To: Thompson, Adele - adele_thomp...@cargill.com Cc: r-help@r-project.org Subject: Re: [R] need to delete by time, not date

Re: [R] fitting non-intercept model with lrm

2011-05-10 Thread David Winsemius
On May 10, 2011, at 11:38 AM, Clarissa Valim wrote: I would appreciate if someone could tell me how to fit a non- intercept model using lrm (and not glm). The -1 in the formula of the glm does not work with lrm. Can you describe why one might want to have such a facility? I cannot think

[R] ggplot2 and add circle

2011-05-10 Thread Alaios
Dear all, today I have writted the following code, to plot the contents of some matrices I have plot_shad_f function(f){ library(ggplot2) dev.new() plotdata<-melt(f) names(plotdata)<-c('x','y','z') v<-ggplot(plotdata, aes(x, y, z = z)) print(v + geom_tile(aes(fill=z))) } I would like

Re: [R] ggplot2 and add circle

2011-05-10 Thread Scott Chamberlain
You should provide reproducible data in addition to your code. S On Tuesday, May 10, 2011 at 11:54 AM, Alaios wrote: > Dear all, > today I have writted the following code, > to plot the contents of some matrices I have > > plot_shad_f > function(f){ > library(ggplot2) > dev.new() > plotdata<

Re: [R] ggplot2 and add circle

2011-05-10 Thread Alaios
Here you are :) plot_shad_f<-function(f){   library(ggplot2)   dev.new()   plotdata<-melt(f)   names(plotdata)<-c('x','y','z')   v<-ggplot(plotdata, aes(x, y, z = z))   print(v + geom_tile(aes(fill=z))) } f<-matrix(data=seq(1:1),nrow=100,ncol=100) plot_shad_f(f) I would like to add a ci

[R] Converting ordinal dates and time into sensible formats

2011-05-10 Thread Sam Albers
Hello all, I am having a little trouble working with "strptime" and I was hoping someone might be able to give me a hand. I have an instrument that outputs an ordinal date and time in two columns something like this: day.hour min.sec 1125252050 2125182029 3125242023 4

Re: [R] Dual colour ramps based on pos/neg values

2011-05-10 Thread Tyler Hayes
My apologies for the late reply but I was out of town for a while. The solution I wound up using is below. Sorry about the text if it didn't wrap well. You should be able to pick out the code from the comments though. Thanks for all the help! Cheers, t. ## > Start hack ## ##

Re: [R] ggplot2 and add circle

2011-05-10 Thread Scott Chamberlain
Here is a thread that might help. http://groups.google.com/group/ggplot2/browse_thread/thread/7f4238b5658e85bb/25d4cfb6215b7544?lnk=gst&q=circle+size#25d4cfb6215b7544 On Tuesday, May 10, 2011 at 12:15 PM, Alaios wrote: > Here you are :) > > > plot_shad_f<-function(f){ > library(ggplot2) > de

Re: [R] ggplot2 and add circle

2011-05-10 Thread Dennis Murphy
Hi: Here's one way: plot_shad <- function(d, r) { require('ggplot2') plotdata <- melt(d) names(plotdata)<-c('x','y','z') xc <- mean(range(plotdata$x)) yc <- mean(range(plotdata$y)) theta <- seq(-pi, pi, length = 200) circ <- data.frame(xv = xc + r * cos(theta),

[R] for loop populate matrix

2011-05-10 Thread Chris English
Dear List, I am trying to populate a matrix using a for loop.This works. > four<- matrix(nrow=4,ncol=5)> for (j in 1:ncol(four)){+ for (i in > 1:nrow(four)){+ four[i,j]<-i-1}+ }> print(four)     [,1] [,2] [,3] [,4] > [,5][1,]    0    0    0    0    0[2,]    1    1    1    1    1[3,]    2    2  

Re: [R] Reading a large netCDF file using R

2011-05-10 Thread Sulochan Dhungel
Hi Dave, I asked for the climate group for one particular day's data so that I could match it up with the data I got from the codes for the same day. It did not match. So I knew it was not working. Also time is the first thing on the list of summary for "nc" , but when I saw other netCDF files, ti

Re: [R] for loop populate matrix

2011-05-10 Thread Dennis Murphy
Why loop? matrix(rep(3:0, each = 5), ncol = 5, byrow = TRUE) [,1] [,2] [,3] [,4] [,5] [1,]33333 [2,]22222 [3,]11111 [4,]00000 HTH, Dennis On Tue, May 10, 2011 at 11:10 AM, Chris English wrote: > > Dear List, >

Re: [R] Dual colour ramps based on pos/neg values

2011-05-10 Thread Achim Zeileis
On Tue, 10 May 2011, Tyler Hayes wrote: My apologies for the late reply but I was out of town for a while. The solution I wound up using is below. Sorry about the text if it didn't wrap well. You should be able to pick out the code from the comments though. Note that despite computing the ramp

Re: [R] [caret package] [trainControl] supplying predefined partitions to train with cross validation

2011-05-10 Thread Fabon Dzogang
Here is an answer from Max Khun thank you ! Fabon, If I understand the problem, there are two ways of doing it. First, if you are using caret's trian(), rfe() or sbf(), if you set the seed right before you call the models, they end up using the same resampled data sets. (btw, if you use the resam

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-10 Thread Berend Hasselman
Alex Olssen wrote: > > Wow that is really interesting, > > Sorry I was asleep when you emailed these. > > And yes, of course, I had been trying to implement model 18, not 18s, > that was a typo, sorry. > > I will have a look at the code you posted. > > Thanks, > > Alex > I have run nlm wit

[R] specifying scales in lattice xyplot makes the lines disappear?

2011-05-10 Thread Christopher W Ryan
I have a dataframe concerning manner of death from death certificates, from 2005 to 2009 inclusive, with the following structure: > str(MannerYoung.plot.data) 'data.frame': 245 obs. of 4 variables: $ year : Factor w/ 5 levels "2005","2006",..: 1 2 3 4 5 1 2 3 4 5 ... $ manner :

Re: [R] sample weights in ols

2011-05-10 Thread Thomas Lumley
On Tue, May 10, 2011 at 2:50 PM, jour4life wrote: > Hello all, > > I am wondering if there is a way to specify sampling weights for an ols > model using sample weights. > > For instance, right now, my code is: > > fit.ex<-lm(y~x1+x2+x3+...xk,data=dataset,weights=weightvariable.) > summary(fit.ex)

[R] multinomial regression model

2011-05-10 Thread Thomas Mang
Hi, Consider the need for a regression model which can handle an ordered multinomial response variable. There are, for example, proportional odds / cumulative logit models, but actually the regression should include random effects (a mixed model), and I would not be aware of multinomial regr

Re: [R] for loop populate matrix

2011-05-10 Thread Chris English
Indeed! Your example works perfectly. I think I was using the for-loop to try to address cases where thesize of the matrix was unknown. But your suggestion works forarbitrary sizes, just have to know the range of values to rep (repeat) and have"each" and "ncol" equal. Thank you.ChrisMy apologies

Re: [R] sample weights in ols

2011-05-10 Thread jour4life
On 5/10/2011 3:12 PM, Thomas Lumley-2 [via R] wrote: > On Tue, May 10, 2011 at 2:50 PM, jour4life <[hidden email] > > wrote: > > > Hello all, > > > > I am wondering if there is a way to specify sampling weights for an ols > > model using sample weights. > > > > For instance, right now, my code is:

Re: [R] ANOVA 1 too few degrees of freedom

2011-05-10 Thread Rovinpiper
So what is the difference between a colon and an asterisk in this code? For that matter what does the slash mean? -- View this message in context: http://r.789695.n4.nabble.com/ANOVA-1-too-few-degrees-of-freedom-tp3493349p3512977.html Sent from the R help mailing list archive at Nabble.com.

[R] Power Spectrum from STFT (e1071)?

2011-05-10 Thread ajf226
Hello. Does anyone know how to generate a power spectrum from the STFT function in package e1071? The output for this function supplies the Fourier coefficients, but I do not know how to relate these back to the power spectrum. Alternatively, if anyone is aware of other packages/functions that pe

[R] metaMDS and envfit: Help reading output

2011-05-10 Thread Songer, Katherine B - DNR
Hello R experts, I've used metaMDS to run NMDS on some fish abundance data, and am also working on correlating environmental data to the NMDS coordinates. I'm fairly new to metaMDS and NMDS in general, so I have what are probably some very basic questions. My fish abundance data consists of 66

Re: [R] specifying scales in lattice xyplot makes the lines disappear?

2011-05-10 Thread Peter Ehlers
On 2011-05-10 13:10, Christopher W Ryan wrote: I have a dataframe concerning manner of death from death certificates, from 2005 to 2009 inclusive, with the following structure: str(MannerYoung.plot.data) 'data.frame': 245 obs. of 4 variables: $ year : Factor w/ 5 levels "2005","20

Re: [R] ANOVA 1 too few degrees of freedom

2011-05-10 Thread Richard M. Heiberger
David, Please read the first two paragraphs of Details from ?formula You can try out the formulas with the notation > expand.formula <- function(f) colnames(attr(terms(f), "factors")) > expand.formula(~a+b) [1] "a" "b" > expand.formula(~a:b) [1] "a:b" > expand.formula(~a*b) [1] "a" "b" "a:b"

[R] DCC-GARCH model and AR(1)-GARCH(1, 1) regression model - help needed..

2011-05-10 Thread Marcin P?�ciennik
Hello, I have a rather complex problem... I will have to explain everything in detail because I cannot solve it by myself...i just ran out of ideas. So here is what I want to do: I take quotes of two indices - S&P500 and DJ. And my first aim is to estimate coefficients of the DCC-GARCH model for th

Re: [R] Converting ordinal dates and time into sensible formats

2011-05-10 Thread Steven Kennedy
How about something like: > data$DateTime<- strptime(paste(data$day.hour,data$min.sec,sep=" > "),format="%j%H %M%S") > data$Date <- strftime(data$DateTime,format="%Y-%m-%d") > data$Time <- strftime(data$DateTime,format="%H:%M:%S") > data day.hour min.secDateTime Date Time

Re: [R] Converting ordinal dates and time into sensible formats

2011-05-10 Thread Sam Albers
Yep that did the trick! I was sort stumbling along to this solution albeit less efficiently. Thanks for your help! Sam On Tue, May 10, 2011 at 3:01 PM, Steven Kennedy wrote: > How about something like: > > > data$DateTime<- strptime(paste(data$day.hour,data$min.sec,sep=" > "),format="%j%H %M%S"

Re: [R] metaMDS and envfit: Help reading output

2011-05-10 Thread Scott Chamberlain
Here is a thread I found on this issue:http://www.mail-archive.com/r-sig-ecology@r-project.org/msg00755.html It's not a simple correlation apparently, but I can't figure out how they get the output from envfit using lm(Y ~ scores1 + scores2). You can plot the data like: library(MASS); require(

[R] Help documentation in extractAIC

2011-05-10 Thread Adler, Avraham
Hello. The sentence in extractAIC's help which discusses AIC's estimate of -2logL from RSS reads: "AIC only handles unknown scale and uses the formula n log (RSS/n) - n + n log 2pi - sum(log w) where w are the weights. Furthe

[R] Problem rgl

2011-05-10 Thread tarnus
Dear List, I'm using R on a Fedora 14 32 bit machine and I'm trying to use the rgl-package, but get the following error-messages: > library(rgl) Warnmeldungen: 1: In rgl.init(initValue) : RGL: no suitable visual available 2: In fun(...) : error in rgl_init > plot3d() Fehler in rgl.cur() : rgl_de

Re: [R] Problem rgl

2011-05-10 Thread Duncan Murdoch
On 11-05-10 6:23 PM, tarnus wrote: Dear List, I'm using R on a Fedora 14 32 bit machine and I'm trying to use the rgl-package, but get the following error-messages: library(rgl) Warnmeldungen: 1: In rgl.init(initValue) : RGL: no suitable visual available 2: In fun(...) : error in rgl_init p

Re: [R] Problem rgl

2011-05-10 Thread Prof Brian Ripley
On Tue, 10 May 2011, Duncan Murdoch wrote: On 11-05-10 6:23 PM, tarnus wrote: Dear List, I'm using R on a Fedora 14 32 bit machine and I'm trying to use the rgl-package, but get the following error-messages: library(rgl) Warnmeldungen: 1: In rgl.init(initValue) : RGL: no suitable visual ava

Re: [R] ggplot2 and add circle

2011-05-10 Thread Alaios
Thanks a lot this worked nice. It it possible also in ggplot2 to add a small figure? Let's say that I want to have somewhere in the plot the value of r printed. How can I do that with ggplot 2? Regards Alex --- On Tue, 5/10/11, Dennis Murphy wrote: > From: Dennis Murphy > Subject: Re: [R] g