Re: [R] Combining Custom and Preset Linetypes

2009-01-21 Thread Deepayan Sarkar
On Wed, Jan 21, 2009 at 6:58 PM, jimdare wrote: > > Dear R-Users, > > I created the xyplot below using 10 groups (9 groups + 'Total' of all > groups) with lty=1:10. I need the 'Total' to be a bold solid line (lty=1) > where as the 9 groups just need to be distinguishable from each other. As > yo

[R] Standard errors of least squares adjusted means

2009-01-21 Thread Bruno Estigarribia
Hello, I have the following model: lm.7 <- lm(Y ~ F + C1 + C2 , data = EM4) F is a 4-level factor, the rest are covariates centered at their mean (Y is a two-column matrix). I have tried to find functions to give the model-adjusted means (adjusted at the covariates'means) and their standard dev

[R] Abu added you as a friend on Reunion.com!

2009-01-21 Thread Abu Naser
Hi, I looked for you on Reunion.com, but you weren't there. Please connect with me so we can keep in touch. -Abu Do You Know Abu? YES - Connect with Abu, and see who's searching for you http://smtp26.mail.reunion.co

[R] Abu added you as a friend on Reunion.com!

2009-01-21 Thread Abu Naser
Hi, I looked for you on Reunion.com, but you weren't there. Please connect with me so we can keep in touch. -Abu Do You Know Abu? YES - Connect with Abu, and see who's searching for you http://smtp26.mail.reunion.co

[R] Forecasting by using ARFIMA(0, d, 0) models in R

2009-01-21 Thread ecarreno
Hello. I'm trying to make k-step-ahead forecasts using ARFIMA(0, d, 0) models by taking the first T+k-1 coefficients in the binomial expansion of (1-B)^d, regarding (1-B)^d x(T+k) as an AR(T+k-1) on x(T+k), where x(T) is the series value at time T and k = 1, 2, 3, …. That is, I forecast the ser

Re: [R] trouble converting an array to a dataframe

2009-01-21 Thread hadley wickham
On Tue, Jan 20, 2009 at 11:10 PM, Christopher W. Ryan wrote: > I start with a dataframe called xrays. It contains scores on films from > each of two radiologists. It is in "long" format. I used the reshape > package to melt a data frame and then cast it into "wide" format, one > line for each pati

[R] Help with Forest Plots

2009-01-21 Thread Philip Twumasi-Ankrah
I will really appreciate help with plotting some forest plots. I am trying to show disparities in hazard ratios (and confidence intervals) for a set of covariates for 2 treatments (A and B say). I will to be able to keep the column of text (covariate names) but plot the 2 forest plots on an ex

[R] Fitting extreme value distributions

2009-01-21 Thread David Scott
On CRAN there are a number of packages concerned with fitting extreme value distributions. More than one refers to the book by Stuart Coles, which I have been using. Could anyone with experience in this area offer opinions on the different packages? David Scott __

[R] Opening a script with the R editor via file association (on Windows)

2009-01-21 Thread pdewitt
I read the posting about opening .R files in windows with the Rgui and was wondering if anything has changed for R-2.8.1 and Windows Vista? I have not yet been able to get the files to open in the Rgui, the association works enough to open R but that is about it. Thanks for the input. -Pete

Re: [R] Defining Solid Line using Line Type Specification

2009-01-21 Thread David Winsemius
The dataset for that graphic cannot be that big. Why not use dput() on it and also include the code? -- David Winsemius On Jan 21, 2009, at 9:23 PM, jimdare wrote: Dear R-Users, I created the xyplot below using 10 groups (9 groups + 'Total' of all groups) with lty=1:10. I need the 'Total'

[R] Combining Custom and Preset Linetypes

2009-01-21 Thread jimdare
Dear R-Users, I created the xyplot below using 10 groups (9 groups + 'Total' of all groups) with lty=1:10. I need the 'Total' to be a bold solid line (lty=1) where as the 9 groups just need to be distinguishable from each other. As you can probably see, when the group reaches CRA6 the lty start

[R] Combining Custom and Preset Linetypes

2009-01-21 Thread jimdare
Dear R-Users, I created the xyplot below using 10 groups (9 groups + 'Total' of all groups) with lty=1:10. I need the 'Total' to be a bold solid line (lty=1) where as the 9 groups just need to be distinguishable from each other. As you can probably see, when the group reaches CRA6 the lty start

[R] Combining Custom and Preset Linetypes

2009-01-21 Thread jimdare
Dear R-Users, I created the xyplot below using 10 groups (9 groups + 'Total' of all groups) with lty=1:10. I need the 'Total' to be a bold solid line (lty=1) where as the 9 groups just need to be distinguishable from each other. As you can probably see, when the group reaches CRA6 the lty start

[R] Combining Custom and Preset Linetypes

2009-01-21 Thread jimdare
Dear R-Users, I created the xyplot below using 10 groups (9 groups + 'Total' of all groups) with lty=1:10. I need the 'Total' to be a bold solid line (lty=1) where as the 9 groups just need to be distinguishable from each other. As you can probably see, when the group reaches CRA6 the lty start

[R] Combining Custom and Preset Linetypes

2009-01-21 Thread jimdare
Dear R-Users, I created the xyplot below using 10 groups (9 groups + 'Total' of all groups) with lty=1:10. I need the 'Total' to be a bold solid line (lty=1) where as the 9 groups just need to be distinguishable from each other. As you can probably see, when the group reaches CRA6 the lty start

[R] Combining Custom and Preset Linetypes

2009-01-21 Thread jimdare
Dear R-Users, I created the xyplot below using 10 groups (9 groups + 'Total' of all groups) with lty=1:10. I need the 'Total' to be a bold solid line (lty=1) where as the 9 groups just need to be distinguishable from each other. As you can probably see, when the group reaches CRA6 the lty start

Re: [R] Problem with cex=0.1 when making jpegs

2009-01-21 Thread David Winsemius
Looking at ?points I see information that appears directed at this question: Value pch="." (equivalently pch = 46) is handled specially. It is a rectangle of side 0.01 inch (scaled by cex). In addition, if cex = 1 (the default), each side is at least one pixel (1/72 inch on the pdf, posts

[R] Defining Solid Line using Line Type Specification

2009-01-21 Thread jimdare
Dear R-Users, I created the xyplot below using 10 groups (9 groups + 'Total' of all groups) with lty=1:10. I need the 'Total' to be a bold solid line (lty=1) where as the 9 groups just need to be distinguishable from each other. As you can probably see, when the group reaches CRA6 the lty start

Re: [R] getting caller's environment

2009-01-21 Thread Gabor Grothendieck
Try this: myassign <- function(x, val, env = parent.frame()) assign(deparse(substitute(x)), val, env) myassign(x, 3) x # 3 On Wed, Jan 21, 2009 at 8:03 PM, Yi Zhang wrote: > On Wed, Jan 21, 2009 at 5:57 PM, Gabor Grothendieck > wrote: >> Try this: >> >> f <- function(env = parent.frame()) env$x

[R] Problem with cex=0.1 when making jpegs

2009-01-21 Thread davidfarr
I am using the following script to make .jpg files. jpeg('plotx.jpg') ddat <-read.table("file",header=T) attach(ddat) tdat<-read.table("file1") plot(xx1,yy1,type='p',pch=1,col="blue",cex=0.2,xlim=c(0,3.5),ylim=c(-75,75)) points(tdat,col="green",pch=1,cex=0.2) dev.off() The problem is that I w

Re: [R] Normality Test and T-Test

2009-01-21 Thread David Winsemius
One of: ?by ?aggregate ?ave Next time include the package name where these functions come from AND code that creates an example data situation and you will increase your probability of getting a more prompt and complete reply. -- David Winsemius On Jan 21, 2009, at 4:54 PM, Ferry wrote:

Re: [R] how to study the lead and lag relation of two time series?

2009-01-21 Thread Jim Porzak
Try a search on "cross correlation" "time series" HTH, Jim Porzak TGN.com San Francisco, CA http://www.linkedin.com/in/jimporzak use R! Group SF: http://ia.meetup.com/67/ On Wed, Jan 21, 2009 at 5:17 PM, Michael wrote: > Hi all, > > Is there a way to study the lead and lag relation of two time

Re: [R] Joint significance of more regressors in summary

2009-01-21 Thread Kingsford Jones
try install.packages('car') ?car::linear.hypothesis hth, Kingsford Jones On Wed, Jan 21, 2009 at 4:20 PM, Roberto Patuelli wrote: > Dear All, > > I was wondering if it is possible to generate a regression summary (it does > not matter at this stage if from an lm or for example a glm estimate)

[R] how to study the lead and lag relation of two time series?

2009-01-21 Thread Michael
Hi all, Is there a way to study the lead and lag relation of two time series? Let's say I have two time series, At and Bt. Is there a systematic way of concluding whether it's A leading B or B leading A and by how much? Thanks! __ R-help@r-project.org

Re: [R] getting caller's environment

2009-01-21 Thread Yi Zhang
On Wed, Jan 21, 2009 at 5:57 PM, Gabor Grothendieck wrote: > Try this: > > f <- function(env = parent.frame()) env$x Thanks. What if the x in "env$x" is an argument passed in? e.g. f <- function(x, env=parent.frame()) { #assign to env$x ? } > g <- function(x=1) f() > x <- 2 > g() # 1 > > On Wed, J

[R] Special function? ["non-R" query]

2009-01-21 Thread Ted Harding
Greetings all, Sorry for posting what is primarily not an R question (though it will have an R target in due course). Let F(x) be the CDF of the Normal -- i.e. pnorm(x) Let f(x) be the density function -- i.e. dnorm(x) Define G(psi) = Integral[-inf,inf] F(x)*f(x)*exp(x*psi) dx Is G(psi) a know

Re: [R] plot: abline() - define line length *solved*

2009-01-21 Thread Jörg Groß
Thanks, that's great! Am 22.01.2009 um 01:18 schrieb Remko Duursma: I use this function (a lot): ablinepiece <- function(a=NULL,b=NULL,reg=NULL,from,to,...){ # Borrowed from abline if (!is.null(reg)) a <- reg if (!is.null(a) && is.list(a)) { temp <- as.vector(coeffici

Re: [R] plot: abline() - define line length

2009-01-21 Thread Remko Duursma
I use this function (a lot): ablinepiece <- function(a=NULL,b=NULL,reg=NULL,from,to,...){ # Borrowed from abline if (!is.null(reg)) a <- reg if (!is.null(a) && is.list(a)) { temp <- as.vector(coefficients(a)) if (length(temp) == 1) { a <- 0

[R] plot: abline() - define line length

2009-01-21 Thread Jörg Groß
Hi, is there a way to define, that a line drawn via abline() should only go from for example -2 to 1 on the x-axis (with something working similiar to xlim()) ? thanks for any help! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

Re: [R] title: words in different colors?

2009-01-21 Thread Duncan Murdoch
Michael Friendly wrote: In ?title I see the plot(cars, main = "") title(main = list("Stopping Distance versus Speed", cex=1.5, col="red", font=3)) I can't seem to generalize this to use several colors in a single title. What I'd like is in latex-ish \red{Hair color} \black{ and } \blue{Ey

Re: [R] title: words in different colors?

2009-01-21 Thread Barry Rowlingson
2009/1/21 Michael Friendly : > In ?title I see the > > plot(cars, main = "") > title(main = list("Stopping Distance versus Speed", cex=1.5, col="red", > font=3)) > > I can't seem to generalize this to use several colors in a single title. Solution from http://tolstoy.newcastle.edu.au/R/e2/help/07

[R] Joint significance of more regressors in summary

2009-01-21 Thread Roberto Patuelli
Dear All, I was wondering if it is possible to generate a regression summary (it does not matter at this stage if from an lm or for example a glm estimate) in which to obtain the joint significance of a set of regressors? Examples could be looking at the joint significance level of a polynomial

[R] title: words in different colors?

2009-01-21 Thread Michael Friendly
In ?title I see the plot(cars, main = "") title(main = list("Stopping Distance versus Speed", cex=1.5, col="red", font=3)) I can't seem to generalize this to use several colors in a single title. What I'd like is in latex-ish \red{Hair color} \black{ and } \blue{Eye color} to serve also as

[R] U R ready for R! Now deploy your R models via cloud computing!

2009-01-21 Thread MZ
Following the recent NYT article about R, I thought this group is not only ready for R but ready to take it one step further. Got models in R? Deploy and score them in ADAPA in minutes on the Amazon EC2 cloud computing infrastructure! Zementis ( http://www.zementis.com ) has been working with the

Re: [R] getting caller's environment

2009-01-21 Thread Gabor Grothendieck
Try this: f <- function(env = parent.frame()) env$x g <- function(x=1) f() x <- 2 g() # 1 On Wed, Jan 21, 2009 at 5:45 PM, Yi Zhang wrote: > Hello, > > I'm writing a function like this: > > f<-function(x,y,...) { > ... > assign(x,y,envir=?) > } > > I need the caller (of f) 's environment for the

[R] Does anyone has this paper in pdf?

2009-01-21 Thread aiminy
de Jong, S. (1993) SIMPLS: an alternative approach to partial least squares regression. Chemometrics and Intelligent Laboratory Systems, 18, 251–263 Thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] getting caller's environment

2009-01-21 Thread Yi Zhang
Hello, I'm writing a function like this: f<-function(x,y,...) { ... assign(x,y,envir=?) } I need the caller (of f) 's environment for the "?" so that the assignment is done at the right place. To be specific, when the code "f(x,1)" appears in environment A, I need the assignment of 1 to x happen

[R] X matrix deemed to be singular;

2009-01-21 Thread Michele Santacatterina
Hello, i'm tring to use a cox's model for a survival analysis. I have a dataset, this is a part: VOD SESSO fonte_sct donor RT_CGY STATOBMT TEMPO morto 1 0 F midrelated 1200 CP651 2 0 M mid

[R] Normality Test and T-Test

2009-01-21 Thread Ferry
Hello R Users, Suppose I have data with the structure below: Group_Name Pre_Test Post_Test Grp_A xxx xxx Grp_A xxx xxx Grp_A xxx xxx ... Grp_B xxx xxx Grp_B xxx xxx ... Grp_Z x

Re: [R] Problem with FAME

2009-01-21 Thread Jeffrey J. Hallman
My bad. I used system("test -r blah") to see if a file was readable, forgetting that not all Windows installations have the "test" program (from Cygwin) installed. I've changed this to use the R function file.access() in version 2.5, which I've just submitted to CRAN. The Windows binary should b

[R] Replacing dates with consecutive observations

2009-01-21 Thread Alina Sheyman
I am working with a list of dates and I would like to replace each date with the one that comes after, ie. 1/1/07 will become 1/5/07, 1/5/07 will become 1/7/07, etc. The number of days between my dates always varies, so I can't just increase each one by 5 days or so. Does anyone know of a way I ca

[R] plotting activity time intervals

2009-01-21 Thread Martin Tomko
Dear All, I have interval data (for Mon-Sun, 00-24h) of an activity and would like to visually plot them in a matrix-like plot, where color A would be assigned to the activity, and color X to unspecified time usage. Note that the activities are not in standardised units (hours or so), but from

[R] Profiling code with lots of 'apply' calls?

2009-01-21 Thread David Reiss
Hi, I have some code with a bunch of apply/sapply/lapply calls to different functions. I am trying to profile it using Rprof, however the resulting summary looks like this (output from 'R CMD Rprof'): % total % self totalseconds selfsecondsname 100.00 14.5

Re: [R] finding row and column indices of date in multiple columns of a data frame

2009-01-21 Thread Jorge Ivan Velez
Dear Gonçalo, If DF is your data set, something like this should do the job: which(DF==yourdate,arr.ind=TRUE) > # Example > Dates<-c('01/18/2009','01/19/2009','01/20/2009','01/21/2009') > DF<-data.frame( +Site=sample(4), + "Site#"=sample(4), + Season=sample(4), +Da

[R] finding row and column indices of date in multiple columns of a data frame

2009-01-21 Thread Gonçalo Ferraz
Hi, I have a data.frame SAMPLES with columns: Site Site# Season Day1 Day2 Day3 Day1, Day2, Day3 are class "Date", the other columns are numeric or factor. I have a date "mydate" that may or may not be listed in my data.frame and I need to find that out. If "mydate" is there,

Re: [R] should I use rbind in my example?

2009-01-21 Thread David Freedman
Are you sure that you want to loop over variables for each subset, and do this within each subset? A simple way to generate summary statistics (across variables and within categories) is the summaryBy function in the doBy package: d=data.frame(wt=rnorm(100,100,10),ht=rnorm(100,2,1),sex=gl(2,1,10

Re: [R] should I use rbind in my example?

2009-01-21 Thread SNN
Hi, This is just for print out so it looks nice. what I have is a loop that loops over my variables and calculates the mean and the sd for these variables. Then I need to rbind them so I can stack them up in one file. the problem is that only the fist header appears and the rest do not. this is

Re: [R] heatmap.2 color issue

2009-01-21 Thread Matthias Kohl
the heatmapCol function of package MKmisc might help ... try: library(MKmisc) example("heatmapCol") Best Matthias Liu, Hao [CNTUS] wrote: Dear All: I tried to use heatmap.2 to generate hierarchical clustering using the following command: heatmap.2(datamatrix, scale="row", trace="none", col=g

Re: [R] seq()

2009-01-21 Thread Felipe Carrillo
It works like a charm,thank you all for your help. --- On Wed, 1/21/09, jim holtman wrote: > From: jim holtman > Subject: Re: [R] seq() > To: mazatlanmex...@yahoo.com > Cc: r-h...@stat.math.ethz.ch > Date: Wednesday, January 21, 2009, 9:40 AM > Is this what you want: > > > x <- seq(1, 52, 2

[R] X matrix deemed to be singular;

2009-01-21 Thread Michele Santacatterina
Hello, i'm tring to use a cox's model for a survival analysis. I have a dataset, this is a part: VOD SESSO fonte_sct donor RT_CGY STATOBMT TEMPO morto 1 0 F midrelated 1200 CP651 2 0 M mid

[R] vegan metaMDS

2009-01-21 Thread Radu Ioviță
Hi, I'm trying to use metaMDS with a dissimilarity matrix of angles, not Bray-Curtis, and I wanted to know if there is an in-built function to produce a plot of stress values against dimensions, that could be used to determine the 'true' dimension of the solution. The number of objects is only a l

Re: [R] seq()

2009-01-21 Thread Gavin Simpson
On Wed, 2009-01-21 at 09:29 -0800, Felipe Carrillo wrote: > HI: > Could someone help me with the seq function? I have a range of values > starting from 1 to 52 but I want seq to start at 27 by=2, but when it reaches > 51 start with with number 1 to 25. is this possible. I can do the basics of >

Re: [R] seq()

2009-01-21 Thread Stephan Kolassa
Hi Felipe, concatenate two sequences using c(): c(seq(from=27,to=51,by=2),seq(from=1,to=25,by=2)) HTH, Stephan Felipe Carrillo schrieb: HI: Could someone help me with the seq function? I have a range of values starting from 1 to 52 but I want seq to start at 27 by=2, but when it reaches 51

Re: [R] seq()

2009-01-21 Thread jim holtman
Is this what you want: > x <- seq(1, 52, 2) > x [1] 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 > (x + 26) %% 52 [1] 27 29 31 33 35 37 39 41 43 45 47 49 51 1 3 5 7 9 11 13 15 17 19 21 23 25 > On Wed, Jan 21, 2009 at 12:29 PM, Felipe Carrillo wrote: > HI:

Re: [R] seq()

2009-01-21 Thread Berwin A Turlach
G'day Felipe, On Wed, 21 Jan 2009 09:29:03 -0800 (PST) Felipe Carrillo wrote: > Could someone help me with the seq function? I have a range of values > starting from 1 to 52 but I want seq to start at 27 by=2, but when it > reaches 51 start with with number 1 to 25. is this possible. I can do >

[R] seq()

2009-01-21 Thread Felipe Carrillo
HI: Could someone help me with the seq function? I have a range of values starting from 1 to 52 but I want seq to start at 27 by=2, but when it reaches 51 start with with number 1 to 25. is this possible. I can do the basics of seq() but I can't figure how to do this one. This is how I want my s

Re: [R] R and Xcode Editor

2009-01-21 Thread Rob Goedman
Gregor, Section 6.1 of the FAQ provides further examples. It does depend on the editor you are using. Several editors come with add-ons that support R. Recently, on the Mac specific r-sig-mac mailing list ( r-sig-...@stat.math.ethz.ch ), Smultron came up. Regards, Rob On Jan 21, 2009, a

Re: [R] Two similar zoo objects with different structures, how to get same structure?

2009-01-21 Thread Gabor Grothendieck
So far we have dput(a). Does that represent what you have? what you want? Can you provide both and a description in words. See the last line to every message to r-help. On Wed, Jan 21, 2009 at 11:13 AM, Sergey Goriatchev wrote: > Dear Dr. Grothendieck, > > My purpose in this case it to have the

Re: [R] Error as.Date on Invalid Dates

2009-01-21 Thread jim holtman
?try On Wed, Jan 21, 2009 at 10:55 AM, Brigid Mooney wrote: > Hi All, > > I have an script in R which accepts user inputs for certain parameters, > particularly dates, which the user inputs as character strings. > eg: > > date1 <- "2009-01-21" > > The script later parses the input via the as.Dat

Re: [R] should I use rbind in my example?

2009-01-21 Thread jim holtman
What do you want to do with it? Is this just for printing out? What other types of transformations are you intending to do? Why not just put them in a 'list' and then write your own specialized print routine. On Wed, Jan 21, 2009 at 10:30 AM, SNN wrote: > > Hi, > > I need to rbind two data fram

[R] should I use rbind in my example?

2009-01-21 Thread SNN
Hi, I need to rbind two data frames. Each one has a header . after the rbind I would like to keep the header for each and have the two data frames separated by a line. Is this possible to do in R? For example weight_meanweight_sd.dev > F 14.3 4.932883 > M 34.7 10.692677 > >

[R] cv.glm: delta squared --> squared q

2009-01-21 Thread Markus Mühlbacher
Dear list members, I am using a cross validation of a generalised linear model (glm). The cv.glm function (from boot package) returns an error as so-called „delta“ value. I would like to get to a (cross-validated) squared q, because I want to directly compare it to the squared correlation coeff

Re: [R] filling blanks with NA

2009-01-21 Thread Richard . Cotton
> I do have a data set with some missing values that appear as blanks. I want > to fill these blanks with an NA. How can this be done? Thanks for your help Please help us to help you. What form are the data in? Are they in a text file, or are they in R already? What do you mean by 'blanks'?

Re: [R] Two similar zoo objects with different structures, how to get same structure?

2009-01-21 Thread Sergey Goriatchev
Dear Dr. Grothendieck, My purpose in this case it to have the structure of the object on non-Bloomberg machine the same as that of the object on the Bloomberg machine. That way I am sure that whatever code I write away from Bloomberg machine will work on it when I copy the code to it. Also, I am v

Re: [R] Two similar zoo objects with different structures, how to get same structure?

2009-01-21 Thread Gabor Grothendieck
Is your purpose to change the times in some way? If z is a zoo series you can change the times like this: library(zoo) library(chron) time(z) <- ...whatever... e.g. > z <- zoo(1:3, 11:13) > z 11 12 13 1 2 3 > time(z) <- as.Date(11:13) > z 1970-01-12 1970-01-13 1970-01-14 1

[R] Error as.Date on Invalid Dates

2009-01-21 Thread Brigid Mooney
Hi All, I have an script in R which accepts user inputs for certain parameters, particularly dates, which the user inputs as character strings. eg: > date1 <- "2009-01-21" The script later parses the input via the as.Date function: > as.Date(date1) However, as.Date encounters an error when the

Re: [R] download/retain text file structure with RCurl/getURL(): Solution

2009-01-21 Thread zack holden
Dear list, I'm posting the solution to my problem in case others may find this useful. This code was sent to me by Phil Spector. With a bit of cleaning, it can easily be converted to a usable format. Thanks to Gabor Grothendieck, David winsemius and Martin Morgan for also sending possible sol

Re: [R] Two similar zoo objects with different structures, how to get same structure?

2009-01-21 Thread Sergey Goriatchev
Dear Dr. Grothendieck, First of all, I realized I did not load zoo package before I tried the first str(bldata). If I load zoo and then do str(bldata) I get the following: 'zoo' series from 7305 to 14609 Data: num [1:5219, 1:12] 91.9 91.8 91.7 91.8 91.7 ... - attr(*, "dimnames")=List of 2 ..

Re: [R] filling blanks with NA

2009-01-21 Thread Henrique Dallazuanna
Try this also: is.na(my.data$var) <- which(my.data$var == "") On Wed, Jan 21, 2009 at 12:33 PM, kayj wrote: > > Hi, > > I do have a data set with some missing values that appear as blanks. I want > to fill these blanks with an NA. How can this be done? Thanks for your > help > > -- > View this

Re: [R] Predictions with GAM

2009-01-21 Thread Robbert Langenberg
In addition to this, is it in anyway possible to get the variance in the prediction graph as a shade similar to the GAM plots? 2009/1/21 Robbert Langenberg > Thanks a lot for all the mails! > > With all the different examples I now have got it working. The problem > finally after I had worked ou

[R] forecasting issue

2009-01-21 Thread diego Diego
Hello everybody! I have a problem when I try to perform a forecast of an ARIMA model produced by an auto.arima function. Here is what I'm doing: c<-auto.arima(fil[[1]],start.p=0,start.q=0,start.P=0,start.Q=0,stepwise=TRUE,stationary=FALSE,trace=TRUE) # fil[[1]] is time series of monthly data

[R] Multifractal detrended fluctuation analysis

2009-01-21 Thread James Dixon
Dear R-users, Has anyone written a function for multifractal detrended fluctuation analysis? The "fractal" package does mono-fractal DFA, but not multifractal as far as I can tell. The MF-DFA approach is presented in: J. W. Kantelhardt, S. Zschiegner, E. Koscielny-Bunde, S. Havlin, A. B

Re: [R] filling blanks with NA

2009-01-21 Thread K. Elo
Hi, kayj wrote: > Hi, > > I do have a data set with some missing values that appear as blanks. I want > to fill these blanks with an NA. How can this be done? Thanks for your help Something like this? > my.data<-data.frame("var"=c(1,2,5,"",66,4,3,"",67,5,3,2,1,4,32,56,23), stringsAsFactors=F)

[R] timeSeries and aggregation() question

2009-01-21 Thread 00alastair00
Hello, I've a time series, T, for an irregular sequence of days (data for bank holidays weekends have been removed). I would like to aggregate this series by into weeks using aggregate(x, by="weeks", FUN=mean). To do this, I think that x needs to be a timeSeries object, and when I try to call

[R] filling blanks with NA

2009-01-21 Thread kayj
Hi, I do have a data set with some missing values that appear as blanks. I want to fill these blanks with an NA. How can this be done? Thanks for your help -- View this message in context: http://www.nabble.com/filling-blanks-with-NA-tp21584278p21584278.html Sent from the R help mailing list

[R] Linux 64-bit server crashes on large dataset

2009-01-21 Thread Katrine Damgaard
Hello everybody! We have a problem with a linux server that crashes when we try to read large datasets in R. The R code is as followed: komplett <- read.spss("komplett2003aar.sav", to.data.frame =TRUE, reencode ="Latin1") The information about the linux server is: Linux version 2.6.24-19-gene

Re: [R] Predictions with GAM

2009-01-21 Thread Robbert Langenberg
Thanks a lot for all the mails! With all the different examples I now have got it working. The problem finally after I had worked out the newd2 as supplied by Gavin was that I found the plot so strange looking. I have altered my newd2 a bit, and after your e-mails Simon I figured out how to finall

Re: [R] merging several dataframes from a list

2009-01-21 Thread Phil Spector
Another possibility is Reduce: Reduce(function(x,y,by='pos')merge(x,y,by='pos'),mylist) pos data.x data.y data 1 A 2 69 2 B 6 23 3 C 3 96 4 D 1 72 5 E 9 51 - Phil Spector

Re: [R] Two similar zoo objects with different structures, how to get same structure?

2009-01-21 Thread Gabor Grothendieck
Please reduce your examples down to small amounts of data and use dput so that they are reproducible. On Wed, Jan 21, 2009 at 9:32 AM, Sergey Goriatchev wrote: > Dear all, > > I have a zoo object that has following structure: > >> str(bldata) > zoo [1:5219, 1:12] 91.9 91.8 91.7 91.8 91.7 ... >

Re: [R] obtaining null components of a list

2009-01-21 Thread jim holtman
Try this: > x <- list(NULL, 1:10, 25, NULL, "more") > x [[1]] NULL [[2]] [1] 1 2 3 4 5 6 7 8 9 10 [[3]] [1] 25 [[4]] NULL [[5]] [1] "more" > which(sapply(x, is.null)) [1] 1 4 > On Wed, Jan 21, 2009 at 7:42 AM, diego Diego wrote: > Hello everybody! > I have a list of length 5000

[R] Two similar zoo objects with different structures, how to get same structure?

2009-01-21 Thread Sergey Goriatchev
Dear all, I have a zoo object that has following structure: > str(bldata) zoo [1:5219, 1:12] 91.9 91.8 91.7 91.8 91.7 ... - attr(*, "index")=Classes 'dates', 'times' atomic [1:5219] 7305 7306 7307 7308 7309 ... .. ..- attr(*, "format")= chr "m/d/y" .. ..- attr(*, "origin")= Named num [1:3]

[R] obtaining null components of a list

2009-01-21 Thread diego Diego
Hello everybody! I have a list of length 5000 whose components are (mostly) "ts" objects, but some these components are intentionally left empty, ie, they are "NULL" components of the list. My question is how can I get the position of these null components in a effective way (I'm trying to avoid a

Re: [R] matching more than two vectors (?)- Resolved

2009-01-21 Thread Juliane Struve
Dear Juliet, I found out that the issue of matching more than two vectors can be avoided by pasting vectors into one using paste(). Also, it is not actually necessary for my problem to use match(). I was looking for a method to match points by coordinates, this can be done be using equal coordi

Re: [R] Looking for a special date function in R

2009-01-21 Thread Sergey Goriatchev
Thank you all for your help! Sergey On Wed, Jan 21, 2009 at 13:25, Gabor Grothendieck wrote: > This will give you 6 months after today. Use negative > numbers to move backwards: > >> d <- Sys.Date() >> seq(d, length = 2, by = paste(6, "months"))[2] > [1] "2009-07-21" > > > On Wed, Jan 21, 2009

Re: [R] merging several dataframes from a list

2009-01-21 Thread Gabor Grothendieck
merge.zoo can do a multiple merge. We create a list of zoo objects, mylist.z, and then perform the merge: > library(zoo) > mylist.z <- lapply(mylist, function(x) zoo(x$data, as.character(x$pos))) > do.call(merge.zoo, mylist.z) df1 df2 df3 A 2 6 9 B 6 2 3 C 3 9 6 D 1 7 2

Re: [R] merging several dataframes from a list

2009-01-21 Thread Henrique Dallazuanna
Hi Antje, Try this: merge(merge(mylist[[1]], mylist[[2]], by = "pos"), mylist[[3]]) On Wed, Jan 21, 2009 at 11:19 AM, Antje wrote: > Henrique Dallazuanna schrieb: > >> Try this also: >> >> cbind(pos = mylist$df1$pos, data.frame(mylist)[grep("data", >> names(data.frame(mylist)))]) >> > > Hi He

Re: [R] merging several dataframes from a list

2009-01-21 Thread Antje
Henrique Dallazuanna schrieb: Try this also: cbind(pos = mylist$df1$pos, data.frame(mylist)[grep("data", names(data.frame(mylist)))]) Hi Henrique, cool solution - that's seems to be the easiest way! though I thought there should be some possibiliy of multiple merge Anyway, this will do it

Re: [R] Sweave: conflict between setwd and \SweaveOpts{prefix.string=}

2009-01-21 Thread Matthieu Stigler
Have you tried specifying an absolute path in prefix.string instead of a relative one? HTH, Thierry Good point! This actually solves the problem, I just wanted to avoid this as I wanted to send it to someone else... so I just reordered the files and it works. Solutions given by Duncan

Re: [R] merging several dataframes from a list

2009-01-21 Thread Henrique Dallazuanna
Try this also: cbind(pos = mylist$df1$pos, data.frame(mylist)[grep("data", names(data.frame(mylist)))]) On Wed, Jan 21, 2009 at 6:19 AM, Antje wrote: > Hi there, > > I have a list of dataframes (generated by reading multiple files) and all > dataframes are comparable in dimension and column na

Re: [R] A question on histogram (hist): coordinates on x-axis are too sparse

2009-01-21 Thread Duncan Murdoch
Li, Hua wrote: Dear R helpers: Let's say I have some data X, X <- runif(1000, 1, 100) pdf('X.pdf', width=100,height=5) hist(X, breaks=1000) dev.off() I find that, on x-axis the coordinates are 0e+00, 2e+09, 4e+09, 6e+09, 8e+09, 1e+10. Only five numbe

Re: [R] Looking for a special date function in R

2009-01-21 Thread Gabor Grothendieck
This will give you 6 months after today. Use negative numbers to move backwards: > d <- Sys.Date() > seq(d, length = 2, by = paste(6, "months"))[2] [1] "2009-07-21" On Wed, Jan 21, 2009 at 6:27 AM, Sergey Goriatchev wrote: > Dear Gabor, > > Thanks for that! > Still, it is not really similar to

Re: [R] Handling of factors

2009-01-21 Thread Peter Dalgaard
Thomas Lumley wrote: > On Tue, 20 Jan 2009, Stavros Macrakis wrote: > >> I'm rather confused by the semantics of factors. >> > >> >> It is all very confusing. Of course, most of this behavior is >> documented and is easily determined by experimentation, but it would >> be easier to learn and tea

Re: [R] Looking for a special date function in R

2009-01-21 Thread Prof Brian Ripley
On Wed, 21 Jan 2009, Sergey Goriatchev wrote: Dear Prof. Ripley, Thank you for help. Yes, that is an interesting question you pose. I already thought myself how February should be handled, as EDATE(31.08.2008; -6) returns 29.02.2008. In Excel it is not a problem, since this nonexisting date is

Re: [R] Looking for a special date function in R

2009-01-21 Thread Sergey Goriatchev
Dear Prof. Ripley, Thank you for help. Yes, that is an interesting question you pose. I already thought myself how February should be handled, as EDATE(31.08.2008; -6) returns 29.02.2008. In Excel it is not a problem, since this nonexisting date is then used in VLOOKUP function where one can have

[R] Help Regarding STL Technique

2009-01-21 Thread Kishore
Team, I have a time series data with lot of seasonality and trends. I am familiar with some forecasting techniques, but for this set, I believe STL would be the best. Please let me know any tips to use STL using R. Best, Kishore [[alternative HTML version deleted]] ___

Re: [R] Looking for a special date function in R

2009-01-21 Thread Prof Brian Ripley
On Wed, 21 Jan 2009, Sergey Goriatchev wrote: Dear Gabor, Thanks for that! Still, it is not really similar to how EDATE works. With julian(Sys.Date(), Sys.Date() - 10) one moves 10 days back. The problem is that I need to move by months, not by days, as months have different number of days. I

Re: [R] Problem with cyrillic in postscript

2009-01-21 Thread Prof Brian Ripley
1) Please update your R as requested in the posting guide, and provide the 'at a mimimum' information requested. 2) Try reading ?postscript and setting the encoding: I suspect yours is not one of the cases that are guessed correctly. 3) If all else fails, give a 'commented, minimal, self-cont

Re: [R] Looking for a special date function in R

2009-01-21 Thread Sergey Goriatchev
Dear Gabor, Thanks for that! Still, it is not really similar to how EDATE works. With julian(Sys.Date(), Sys.Date() - 10) one moves 10 days back. The problem is that I need to move by months, not by days, as months have different number of days. I need to come to the same day when I move backward

[R] Odp: R: Odp: Function able to identify the row and the column in a matrix

2009-01-21 Thread Petr PIKAL
"enrico.fosco...@libero.it" napsal dne 21.01.2009 11:54:49: > I can't use the function "outer" because my function fun() doesn't take vectors > as arguments. If you can not R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:/

[R] Function able to identify the row and the column in a matrix

2009-01-21 Thread enrico.fosco...@libero.it
Good morning to all, I should evaluate a function for every cell of a given matrix with n rows and n columns. This function, named fun(), has got two arguments: the number of the row and the number of the column which characterized every single cell. So the result should be fun(1,1) fun(1,2

  1   2   >