[R] FYI: APL in R

2008-08-19 Thread Jan de Leeuw
http://idisk.mac.com/jdeleeuw-Public/utilities/apl/apl.R Dedicated to the IBM 2741. Implemented for general multidimensional arrays: drop, take, reshape, shape, rank, select, generalized inner product, generalized outer product, representation, base value, join, expand, reduce, scan, member

Re: [R] Random sequence of days?

2008-08-19 Thread Lauri Nikkinen
Thanks Jeff for pointing me the right direction. "Consecutive" was the right word. This will do it d.samp <- sample(d[1:(length(d)-10)], 1) seq(d.samp, d.samp+10, by="days") Regards, Lauri 2008/8/20, Lauri Nikkinen <[EMAIL PROTECTED]>: > Thanks for quick reply. I meant that the sequence should b

[R] Understanding output of summary(glm(...))

2008-08-19 Thread Daren Tan
Simple example of 5 groups of 4 replicates. >set.seed(5) >tmp <- rnorm(20) >gp <- as.factor(rep(1:5,each=4)) >summary(glm(tmp ~ -1 + gp, data=data.frame(tmp, gp)))$coefficients >Estimate Std. Error t value Pr(>|t|)gp1 -0.1604613084 0.4899868 >-0.3274809061 0.7478301gp2

[R] cmprsk and a time dependent covariate in the model

2008-08-19 Thread phguardiol
Dear R users, I d like to assess the effect of "treatment" covariate on a disease relapse risk with the package cmprsk. However, the effect of this covariate on survival is time-dependent (assessed with cox.zph): no significant effect during the first year of follow-up, then after 1 year

Re: [R] Random sequence of days?

2008-08-19 Thread Lauri Nikkinen
Thanks for quick reply. I meant that the sequence should be like this: "2007-06-16" "2007-06-17" "2007-06-18" "2007-06-19" "2007-06-20" "2007-06-21" "2007-06-22" "2007-06-23" "2007-06-24" "2007-06-25" so that the the days are adjacent... -Lauri 2008/8/20, Moshe Olshansky <[EMAIL PROTECTED]>: >

Re: [R] Random sequence of days?

2008-08-19 Thread Jeff Newmiller
Lauri Nikkinen wrote: Dear list, I tried to find a solution for this problem from the archives but couldn't find any. I would like sample sequence of ten days from vector d d <- seq(as.Date("2007-02-12"), as.Date("2008-08-18"), by="days") so that the days follow each other (sample(d, 10) is no

Re: [R] Random sequence of days?

2008-08-19 Thread Moshe Olshansky
How about d[sample(length(d),10)] --- On Wed, 20/8/08, Lauri Nikkinen <[EMAIL PROTECTED]> wrote: > From: Lauri Nikkinen <[EMAIL PROTECTED]> > Subject: [R] Random sequence of days? > To: [EMAIL PROTECTED] > Received: Wednesday, 20 August, 2008, 4:04 PM > Dear list, > > I tried to find a solutio

[R] Random sequence of days?

2008-08-19 Thread Lauri Nikkinen
Dear list, I tried to find a solution for this problem from the archives but couldn't find any. I would like sample sequence of ten days from vector d d <- seq(as.Date("2007-02-12"), as.Date("2008-08-18"), by="days") so that the days follow each other (sample(d, 10) is not the appropriate soluti

Re: [R] Conversion - lowercase to Uppercase letters

2008-08-19 Thread Moshe Olshansky
Use toupper or tolower (see ?toupper, ?tolower) --- On Wed, 20/8/08, suman Duvvuru <[EMAIL PROTECTED]> wrote: > From: suman Duvvuru <[EMAIL PROTECTED]> > Subject: [R] Conversion - lowercase to Uppercase letters > To: r-help@r-project.org > Received: Wednesday, 20 August, 2008, 2:19 PM > I would

Re: [R] Conversion - lowercase to Uppercase letters

2008-08-19 Thread Rolf Turner
On 20/08/2008, at 4:19 PM, suman Duvvuru wrote: I would like to know how to convert a string with characters to all uppercase or all lowercase? If anyone could let me know if there exists a function in R for the conversion, that will be very helpful. ?tolower #

[R] Conversion - lowercase to Uppercase letters

2008-08-19 Thread suman Duvvuru
I would like to know how to convert a string with characters to all uppercase or all lowercase? If anyone could let me know if there exists a function in R for the conversion, that will be very helpful. Regards, Suman [[alternative HTML version deleted]] _

[R] R CMD INSTALL works but not install.packages ...

2008-08-19 Thread Tae-Hoon Chung
Hi, All; I tried to install exon.pmcdf_1.1.tar.gz package using install.packages() but it didn't with the following messages: > install.packages('/Users/thchung/Downloads/exon.pmcdf_1.1.tar.gz', repos=NULL) Error in gzfile(file, "r") : cannot open the connection In addition: Warning message: In g

Re: [R] Confidence Interval

2008-08-19 Thread Prof Brian Ripley
On Tue, 19 Aug 2008, Raphael Saldanha wrote: Hi! With the following script, I'm trying to make a demonstration of a Confidence Interval, but I'm observing some differences on tails. You need to tell us what you are trying to do. You seem to be computing a parametric bootstrap interval, but

[R] Confidence Interval

2008-08-19 Thread Raphael Saldanha
Hi! With the following script, I'm trying to make a demonstration of a Confidence Interval, but I'm observing some differences on tails. # Teste de média entre uma amostra e uma população normal # Autor: Raphael de Freitas Saldanha # Agosto de 2008 n<- 200# Sample size xbar <- 100# S

Re: [R] converting coordinates from utm to longitude / latitude

2008-08-19 Thread Jim Regetz
Werner Wernersen wrote: It would be nicer to convert directly the entire shapefile object to long/lat coordinates but if that is not possible, I will convert the other points to UTM. Hence, I am playing around with rgdal. library(rgdal) SP <- SpatialPoints(cbind(32.29252, -0.3228500), proj4s

[R] bug in lme4?

2008-08-19 Thread Antonio.Gasparrini
Dear all, I found a problem with 'lme4'. Basically, once you load the package 'aod' (Analysis of Overdispersed Data), the functions 'lmer' and 'glmer' don't work anymore: library(lme4) (fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)) (gm1 <- glmer(cbind(incidence, size - incidence)

Re: [R] Writing R Extensions : A new R package for Gini Index decomposition to prupose

2008-08-19 Thread Robert Duval
there are many useful decompositions of the Gini... which one did you implement? On Tue, Aug 19, 2008 at 8:42 AM, stephen sefick <[EMAIL PROTECTED]> wrote: > See if there is interest. If there is not make your own package or > see if someone else would like to include it into a package that is >

Re: [R] matrix question

2008-08-19 Thread Rolf Turner
On 20/08/2008, at 10:08 AM, Altaweel, Mark R. wrote: Hi, I have a vector and a list, with data I would like to multiply together. No you haven't. You have two ***lists***. Lists and vectors are not the same thing. If you don't distinguish between them you will co

Re: [R] converting coordinates from utm to longitude / latitude

2008-08-19 Thread Dylan Beaudette
If you would like to convert the entire shapfile check out GDAL: http://www.gdal.org/ http://casoilresource.lawr.ucdavis.edu/drupal/node/98 Cheers, Dylan On Tuesday 19 August 2008, Werner Wernersen wrote: > It would be nicer to convert directly the entire shapefile object to > long/lat coordi

Re: [R] converting coordinates from utm to longitude / latitude

2008-08-19 Thread Werner Wernersen
It would be nicer to convert directly the entire shapefile object to long/lat coordinates but if that is not possible, I will convert the other points to UTM. Hence, I am playing around with rgdal. library(rgdal) SP <- SpatialPoints(cbind(32.29252, -0.3228500), proj4string=CRS("+proj=longlat")

[R] matrix question

2008-08-19 Thread Altaweel, Mark R.
Hi, I have a vector and a list, with data I would like to multiply together. So for instance I have a vector s: [[1]] [1] 44308 [[2]] [1] 4371 Also, I have a list d: [[1]] [1] 1201 6170 2036 2927 1625 1391 2074 1453 3172 3027 4691 3719 1185 320 2071 1027 1046 1186 1403 580 1382 4408

Re: [R] Multiple Plotting help (lines don't always connect)

2008-08-19 Thread Carl Witthoft
Just my view on the lines/interpolate/don't interpolate controversy here: I was taught once upon a time to plot actual data as points (with or without error bars), and plot fitted curves as lines. Only when the density of data points is so high as to make a 'mess' of the chart is it ok to plot

Re: [R] address (nil), cause 'memory not mapped'

2008-08-19 Thread Juan Manuel Barreneche
just to mention that the loop was already running for about 20 hours... Juan On Tue, Aug 19, 2008 at 6:31 PM, Juan Manuel Barreneche <[EMAIL PROTECTED]>wrote: > Dear users, > I got this problem and i don't have a clue of what it could be happening... > > The context: i'm running a loop in which

[R] address (nil), cause 'memory not mapped'

2008-08-19 Thread Juan Manuel Barreneche
Dear users, I got this problem and i don't have a clue of what it could be happening... The context: i'm running a loop in which i extract information from a raster map (I work with GRASS and R, using spgrass6 package), and rearrange it to create a matrix. I've tried it with small maps and it work

Re: [R] Survey Design / Rake questions

2008-08-19 Thread Farley, Robert
While I'm trying to catch up on the statistical basis of my task, could someone point me to how I should fix my R error? Thanks > library(survey) > SurveyData <- read.spss("C:/Data/R/orange_delivery.sav", use.value.l

Re: [R] conditional with and operators

2008-08-19 Thread Altaweel, Mark R.
Hi, Ok that worked...im from a Java background so I guess Im used to the && rather than & Thanks! Mark -Original Message- From: Steven McKinney [mailto:[EMAIL PROTECTED] Sent: Tue 8/19/2008 3:33 PM To: Altaweel, Mark R.; r-help@r-project.org Subject: RE: [R] conditional with and opera

Re: [R] conditional with and operators

2008-08-19 Thread Christos Hatzis
Mark, It is not clear whether you are dealing with a single list or something more complex, such as a list of lists or a list of data frames. In the case of a single list, you don't really need any of the 'apply' functions. The main problem in your code is the use of '&&' instead of '&': > test

Re: [R] conditional with and operators

2008-08-19 Thread Steven McKinney
Did you try it with the vector '&' and operator? d<-sapply(res,function(.df){(.df$TimesVisited[.df$Tick>912 & .df$Id>0])}) (The '&&' operator is designed for use in e.g. if() clauses where you want a scalar logical answer) HTH Steve McKinney -Original Message- From: [EMAIL PROTECTED

Re: [R] Histogram binning

2008-08-19 Thread jim holtman
Is this what you want: cuts <- c(0,209,429,719,1500) x <- runif(1000,0,1447) barplot(table(cut(x, breaks=cuts))) On Tue, Aug 19, 2008 at 4:17 PM, Ben Cox <[EMAIL PROTECTED]> wrote: > I am trying to produce frequencies in defined intervals however I can't seem > to figure out how to get R to bin

[R] Histogram binning

2008-08-19 Thread Ben Cox
I am trying to produce frequencies in defined intervals however I can't seem to figure out how to get R to bin my data the way I want it to. I have several thousand lengths of fish that I want to be binned as follows: Ex. Length Bin 209 200 219 210 431

[R] conditional with and operators

2008-08-19 Thread Altaweel, Mark R.
Hi, I have a problem in which I am parsing data from a list. I am simply trying to return data that has several conditions being true. Here is my syntax below: d<-sapply(res,function(.df){(.df$TimesVisited[.df$Tick>912 && .df$Id>0])}) #res is the list, and I am trying to return a result tha

[R] converting coordinates from utm to longitude / latitude

2008-08-19 Thread Werner Wernersen
Hi, is there a function in R to convert data read with read.shape and which is originally in UTM coordinates into longitude / latitude coordinates? I found the convUL() function from the PBSmapping package but I have no idea how I could apply that to the read.shape object. Many thanks, Werner

[R] environment problems

2008-08-19 Thread Matias Salibian-Barrera
Hello, I realize this is not a new problem, but I'm hoping somebody can point me in the right direction. The function silly() below calls gam() (from package gam) with different values of the span parameter for lo(), which is used inside the formula of gam. The values for span are stored in a

[R] panel function with zoo

2008-08-19 Thread stephen sefick
n <- c("m", "j", "j", "a", "s", "o", "n", "d", "j", "f", "m", "a", "m", "j", "j", "a","s", "o", "n", "d", "j") pnl.xaxis <- function(...) { lines(...) panel.number <- parent.frame()$panel.number nser <- parent.frame()$nser # if bottom panel if (!length(panel.number) || panel.nu

Re: [R] nonlinear constrained optimization

2008-08-19 Thread Hans W. Borchers
Paul Smith gmail.com> writes: > > Up to my best knowledge, R cannot deal with optimization problems with > nonlinear constraints, unless one uses the penalty method. Outside R, > Ipopt and Algencan can solve problems like yours, but one needs to > program in AMPL and/or C/Fortran. > > Paul > P

Re: [R] Calling a windows program

2008-08-19 Thread Uwe Ligges
See ?shell Uwe Ligges Benjamin E. Alexander-Eitzman wrote: Greetings, How do I make a call to a windows program from R? For example in windows, I would run this in a shortcut: "C:\Program Files\WinBUGS14\WinBUGS14.exe" /PAR "myownscript.odc" Thanks, Ben Alexander-Eitzman

Re: [R] Calling a windows program

2008-08-19 Thread Henrique Dallazuanna
See shell command On Tue, Aug 19, 2008 at 3:48 PM, Benjamin E. Alexander-Eitzman <[EMAIL PROTECTED]> wrote: > Greetings, > > > > How do I make a call to a windows program from R? For example in > windows, I would run this in a shortcut: > > > > "C:\Program Files\WinBUGS14\WinBUGS14.exe" /PAR "myo

[R] Calling a windows program

2008-08-19 Thread Benjamin E. Alexander-Eitzman
Greetings, How do I make a call to a windows program from R? For example in windows, I would run this in a shortcut: "C:\Program Files\WinBUGS14\WinBUGS14.exe" /PAR "myownscript.odc" Thanks, Ben Alexander-Eitzman [[alternative HTML version deleted]] _

Re: [R] how can i get hessian matrix at "constrOptim"

2008-08-19 Thread Ravi Varadhan
Hi, Hessian for a consttarined problem can be tricky, when the converged parameter vector lies on the boundary, i.e. when one or more of the constraints are active at convergence. This can be handled by reparametrization when the constraints are linear, but is difficult otherwise. Ravi. -

Re: [R] nonlinear constrained optimization

2008-08-19 Thread Ravi Varadhan
Hi, The "Tango project" website (from Brazil) has some R functions to implement Algencan. I haven't used it, but I would be interested to hear others' experience if someone has already used it or will be using it. Ravi. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTE

Re: [R] A doubt about "lm" and the meaning of its summary

2008-08-19 Thread Charles C. Berry
Alberto, Moshe was actually on the right track. Your model does not satisfy enough of the details in the usual Gauss-Markov setup to guarantee unbiasedness of the LS solution. In particular, the errors must be orthogonal to the design columns for the unbiasedness of the LS solution. But,

Re: [R] Exponential smoothing?

2008-08-19 Thread Giovanni Petris
See also package forecast. Giovanni > Date: Tue, 19 Aug 2008 15:25:35 +0100 > From: S Ellison <[EMAIL PROTECTED]> > Sender: [EMAIL PROTECTED] > Precedence: list > > An r hel search picks up > http://tolstoy.newcastle.edu.au/R/help/01a/1162.html > > from 2001, which points towards the ts packa

Re: [R] nonlinear constrained optimization

2008-08-19 Thread Paul Smith
On Tue, Aug 19, 2008 at 8:35 AM, Chua Siang Li <[EMAIL PROTECTED]> wrote: > > Hi. I need some advises on how to use R to find pi (i is the index) with > the following objective function and constraint: > > max (sum i)[ f(ai, bi, pi) * g(ci, di, pi) * Di ] > > s.t. (sum i)[ f(ai, bi, pi) *

Re: [R] how to import from SPSS without shortening variable names

2008-08-19 Thread Prof Brian Ripley
On Tue, 19 Aug 2008, Timo Stolz wrote: Hello, as I import '.sav' files from SPSS, the variable names are shortened to 8 uppercase characters: "sex_of_therapist" will become "SEX_OF_TH" Is there a way around this? How can I retrieve the full names? Have you updated your 'foreign' package rec

Re: [R] jpeg, dev.off() inside function

2008-08-19 Thread Prof Brian Ripley
On Tue, 19 Aug 2008, Henrik Bengtsson wrote: In your function, split up your code in two lines as: pathname <- paste("test ", deparse(substitute(series)), i, ".jpg"); jpeg(filename=pathname, width=1200, height=800, pointsize=12, quality=400, bg="white"); The focus on what 'pathname' is/becomes

Re: [R] To package or not to package?

2008-08-19 Thread Greg Snow
Not a full function to do this, but one of the examples for the clipplot function in the TeachingDemos package shows one way to do something similar to what you describe. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -O

Re: [R] how can i get hessian matrix at "constrOptim"

2008-08-19 Thread Roland Rau
Hi, Kanak Choudhury wrote: Hi, i have made a code for optimizing a function using "constrOptim". i need hessain matrix of the parameters. how could i get hessain matrix when i will use "constrOptim"? May i get get any help from anyone? the function fdHess from package 'nlme' can help you? li

Re: [R] Restricted Least Squares

2008-08-19 Thread Greg Snow
Nelson, It sounds like you should create a factor (or some factors) for your dummy variables, then use contr.sum to automatically create the dummy variables for you such that the coeficients would sum to 0. See ?C, ?contrasts, ?contr.sum, and ?dummy.coef for details. -- Gregory (Greg) L. Snow

[R] spatial probit/logit for prediction

2008-08-19 Thread Freeman, Robert
Hello all, I am wondering if there is a way to do a spatial error probit/logit model in R? I can't seem to find it in any of the packages. I can do it in MATLAB with Gibbs sampling, but would like to confirm the results. Ideally I would like to use this model to predict probability of parce

Re: [R] jpeg, dev.off() inside function

2008-08-19 Thread Henrik Bengtsson
In your function, split up your code in two lines as: pathname <- paste("test ", deparse(substitute(series)), i, ".jpg"); jpeg(filename=pathname, width=1200, height=800, pointsize=12, quality=400, bg="white"); The focus on what 'pathname' is/becomes when you put it inside your function. That wil

Re: [R] how to import from SPSS without shortening variable names

2008-08-19 Thread Peter Dalgaard
Timo Stolz wrote: > Hello, > > as I import '.sav' files from SPSS, the variable names are shortened to > 8 uppercase characters: > > "sex_of_therapist" will become "SEX_OF_TH" > > Is there a way around this? How can I retrieve the full names? > > Well as long as it didn't become sex_of_the_rapis

[R] S.O.S.

2008-08-19 Thread Mauro Belleggia
Hi, My name is Mauro Belleggia, I m doing an ANOSIM (using "vegan" package) to test statistically whether there is a significant difference between 3 (1,2 and 3) groups of sampling units. My results were: Call: anosim(dis = distancias, grouping = Lt) Dissimilarity: bray ANOSIM statistic R: 0.1313

Re: [R] Exponential smoothing?

2008-08-19 Thread S Ellison
An r hel search picks up http://tolstoy.newcastle.edu.au/R/help/01a/1162.html from 2001, which points towards the ts package. >>> Öhagen Patrik <[EMAIL PROTECTED]> 19/08/2008 09:00:12 >>> Dear List, I have used all my resources (i.e. "help.search) and I still havn't been able to figure out i

Re: [R] another GARCH problem

2008-08-19 Thread Yohan Chalabi
"C" == collonil <[EMAIL PROTECTED]> on Mon, 18 Aug 2008 07:35:09 -0700 (PDT) C> Hallo, C> i want to fit a GARCH model with a extern regressor (without arma C> components), so i found the following function in package fGarch. I tryed C> out a lot of things but usually I get th

[R] how to import from SPSS without shortening variable names

2008-08-19 Thread Timo Stolz
Hello, as I import '.sav' files from SPSS, the variable names are shortened to 8 uppercase characters: "sex_of_therapist" will become "SEX_OF_TH" Is there a way around this? How can I retrieve the full names? Greets from Southern Germany, Timo Stolz

Re: [R] Wichmann-Hill Random Number Generator and the Birthday Problem

2008-08-19 Thread Shengqiao Li
Prof Brian Ripley wrote: Your coincidence calculations may be correct for _independent_ draws from a discrete distribution on M values, but independence is not satisfied. Yet again, you are trying to do things that any good text on simulation would warn you against, and which (in a thread on

[R] Querry

2008-08-19 Thread Basnet, Ram Kumar
Dear all, I am student and doing cluster analysis using "pvclust" package. I found this package very useful. After bootstrapping, i found the edges number 88, 16, 6 have very high standard error. I got this information "seplot" fuction and "identify ()". Now i am interested to see the name list o

[R] jpeg, dev.off() inside function

2008-08-19 Thread marciarr
Dear all, I am trying to plot and save the plots. I have written a small function for that in which I use the jpeg and dev.off() commands. Strangely, when these commands are inside the function, they are not working anymore. For instance: dataframe<- data.frame (x=c(1:20),y=seq(0,9.5, length=20))

Re: [R] Wichmann-Hill Random Number Generator and the Birthday Problem

2008-08-19 Thread Shengqiao Li
In fact, that is what I saw in your RNG help in R 2.7.1: '"Wichmann-Hill"' The seed, '.Random.seed[-1] == r[1:3]' is an integer vector of length 3, where each 'r[i]' is in '1:(p[i] - 1)', where 'p' is the length 3 vector of primes, 'p = (30269, 30307, 30323)'. The

Re: [R] ARMA(0,2) & GARCH(1,1) - code & hessian

2008-08-19 Thread Yohan Chalabi
Hi, As far as I can tell, your code looks very similar to the example of the paper "Parameter Estimation of ARMA Models with GARCH/APARCH Errors" available at the rmetrics website. In this paper you can also find an example how to calculate the hessian matrix. What is the dataset and the paramete

[R] [R-pkgs] New packages bpca: biplot (2d and 3d) and diagnostic tools

2008-08-19 Thread Jose Claudio Faria
Dear R Community, We am pleased to announce the release of the 'bcpa' package. The source code and binaries is now on CRAN (http://cran.r-project.org/web/packages/bpca/index.html). The bpca package implements biplot (2d and 3d) and diagnostic tools of the quality of the reduction. It depends R (

Re: [R] Writing R Extensions : A new R package for Gini Index decomposition to prupose

2008-08-19 Thread stephen sefick
See if there is interest. If there is not make your own package or see if someone else would like to include it into a package that is complementary. Stephen Sefick On Tue, Aug 19, 2008 at 3:46 AM, Ndoye Souleymane <[EMAIL PROTECTED]> wrote: > > Dear All, > > I have developed a programme the ana

[R] R-code: for those who like a challenge; HELP

2008-08-19 Thread Jan Akko Eleveld
I'll try to be more clear, but will have to give much more info. Here we go As part of my Masters in Public Health I writing a dissertation reviewing the mortality trend of internally displaced persons in camp settings in Sub Saharan Africa. I have 50 surveys with - crude mortality rate (cm

Re: [R] R vs Stata on generalized linear mixed models: glmer and xtmelogit

2008-08-19 Thread Douglas Bates
On Mon, Aug 18, 2008 at 7:55 PM, <[EMAIL PROTECTED]> wrote: > Hello, > I have compared the potentials of R and Stata about GLMM, analysing the > dataset 'ohio' in the package 'faraway' (the same dataset is analysed with > GEE in the book 'Extending the linear model with R' by Julian Faraway). >

Re: [R] Format with n significant figures / digits

2008-08-19 Thread wannymahoots
In case anyone has the same problem and wants a solution, here is mine (albeit with some horrible hacks): "my.signif" <- function(vec, digits=6) { # get correct number of significant figures vec = signif(vec, digits) # now get correct number of trailing zeros by calling sprintf and sp

[R] how can i get hessian matrix at "constrOptim"

2008-08-19 Thread Kanak Choudhury
Hi, i have made a code for optimizing a function using "constrOptim". i need hessain matrix of the parameters. how could i get hessain matrix when i will use "constrOptim"? May i get get any help from anyone? thank you in advance. Kanak Choudhury. [[alternative HTML version deleted]] __

Re: [R] Converting monthly data to quarterly data

2008-08-19 Thread Denise Xifara
Wonderful! Thank you very much Gabor! I'll check it out now. Kind regards, Denise 2008/8/19 Gabor Grothendieck <[EMAIL PROTECTED]> > Another possibility is to use the yearmon and yearqtr classes in the > zoo package. Assuming quarters end in Feb, May, Aug and Nov > we have (using dat from the p

Re: [R] Converting monthly data to quarterly data

2008-08-19 Thread Gabor Grothendieck
Another possibility is to use the yearmon and yearqtr classes in the zoo package. Assuming quarters end in Feb, May, Aug and Nov we have (using dat from the prior post): > library(zoo) > z <- zoo(dat$price, dat$date) > aggregate(z, as.yearqtr(as.yearmon(time(z)) + 1/12), mean) 2008 Q1 2008 Q2

[R] atomic value

2008-08-19 Thread Laura Cordero Llana
Hi all, I am trying to run a code using the function "tapply", and after test it and see that the value is atomic, when I run the script it gives an error: Error in sort(unique.default(x), na.last = TRUE) : 'x' must be atomic for (i in 1:50){ year.name <- paste("year",i,sep="") year.t

Re: [R] Jitter in xYplot?

2008-08-19 Thread Jim Lemon
On Mon, 2008-08-18 at 19:25 -0400, John Poulsen wrote: > Hello, > > The simple example below plots three species by year and site. However, > I would like the points to occur in groups horizontally, rather than > on top of each other. > > I thought jitter might work, but haven't been success

Re: [R] Converting monthly data to quarterly dataMonday, August 18, 2008 11:38 AM

2008-08-19 Thread Denise Xifara
Dear Gavin, This is really great, thank you! I created some long loops to get rid of extra months at the beginning and the end of my data but your code is great for putting it then together quarterly. thanks again, Denise On Mon, 2008-08-18 at 14:31 +0100, Denise Xifara wrote: > Thank you very m

[R] gam.check in gam (mgcv)

2008-08-19 Thread Van Wyk, Jaap
Hallo I need some help with the output provided by gam.check after a gam fit (using the package mgcv). To give a brief description of my data, I have claims: a vector of values, which include NA's and one large negative value - otherwise all positive (55 values in total that are not NA). origin:

Re: [R] Fwd: Parsing XML or KML into CSV /Using R for geo coding , OR problem

2008-08-19 Thread Roger Bivand
Ajay ohri gmail.com> writes: > > Hi, > > I have a data file in a KML format which is Google Earth's format for > geographic data. I need to import it into a csv file . How can I do that. > KML format is just like XML format .example below The easiest way is most likely to use the rgdal KML dri

Re: [R] "nested" getInitial calls; variable scoping problems: Solved??

2008-08-19 Thread Keith Jewell
Hi All, I've found a solution to my problems which I think is optimal, but I've been wrong before (!!) so comments are welcome. To avoid scoping problems in the 'inner' getInitial I modify the formula so that all variable values are specified explitly in the formula, the inner getInitial need

Re: [R] changing plot font for Times new roman

2008-08-19 Thread Prof Brian Ripley
For X11 the family is "Times" (not "times"). See ?X11Fonts for the alternative "serif". Font values > 5 apply only to the Windows family of devices, and can be changed there via the Rdevga file. But family="serif" works there too (although its 'Times New Roman' may not be identical to that o

[R] Scaling lattice tiffs

2008-08-19 Thread Dieter Menne
Dear ListeRs, Since I normally produce output by Sweave, I never had to care about pixel resolution. Now someone asked me for 600dpi tiffs of lattice. I did not find an easy way to simply scale a tiff-image that looks good in default display. See example below. Dieter library(lattice) p = xyp

Re: [R] Exponential smoothing?

2008-08-19 Thread Hans W. Borchers
Öhagen Patrik mpa.se> writes: > > Dear List, > > I have used all my resources (i.e. "help.search) and I still havn't been > able to figure out if there is an Exponential Smoothing command in R. A few weeks ago the book "Forecasting with Exponential Smoothing" by Hyndman et al. has appeared

Re: [R] variance components

2008-08-19 Thread Pablo G Goicoechea
Dear John: Weir, BS 1996 Genetic Data Analysis II . Sinaur Associates, Sunderland, MA,; should get you started for methods in population genetics (otherreferencecouldbetheArlequin'smanual: [1]http://cmpg.unibe.ch/software/arlequin3/) However, you are p

[R] No object with name: PDE

2008-08-19 Thread Birgitle
Hello R-User! When I plot my rpart-object: plot(data.rpart); text(data.rpart,cex=0.2, use.n=T) I get this error message No object with name: PDE Can somebody tell me why and what the meaning of the message is? Many thanks in advance B. - The art of living is more like wrestling tha

Re: [R] Exponential smoothing?

2008-08-19 Thread Søren Højsgaard
Try ?HoltWinters and ?filter Regards Søren -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Öhagen Patrik Sendt: 19. august 2008 10:00 Til: R hELP Emne: [R] Exponential smoothing? Dear List, I have used all my resources (i.e. "help.search) and I sti

[R] Exponential smoothing?

2008-08-19 Thread Öhagen Patrik
Dear List, I have used all my resources (i.e. "help.search) and I still havn't been able to figure out if there is an Exponential Smoothing command in R. Thank you in advance! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

[R] Writing R Extensions : A new R package for Gini Index decomposition to prupose

2008-08-19 Thread Ndoye Souleymane
Dear All, I have developed a programme the anable the decomposition of the Gini index, it complets tha valuable work of Achim Zeileis, the author of the ineq package. I would like to make it to be part of all R package. How should I proceed. Must I sent it to the the Core developement team ? Th

Re: [R] Open directory within a menu in tcltk

2008-08-19 Thread Peter Dalgaard
Judith Flores wrote: Hello, I am trying to setup a menu to open files and directories. I have the following code: opendir<-function() { dirname<<-tclvalue(tkchooseDirectory()) } openfile<-function() { filename<<-tclvalue(tkgetOpenFile()) } require(tcltk) t1<-tktoplevel() topMenu<-

[R] nonlinear constrained optimization

2008-08-19 Thread Chua Siang Li
Hi. I need some advises on how to use R to find pi (i is the index) with the following objective function and constraint: max (sum i)[ f(ai, bi, pi) * g(ci, di, pi) * Di ] s.t. (sum i)[ f(ai, bi, pi) * Di * pi] / (sum i)[ f(ai, bi, pi) * Di ] <= constant f and g are diffent

Re: [R] Wichmann-Hill Random Number Generator and the Birthday Problem

2008-08-19 Thread Peter Dalgaard
Prof Brian Ripley wrote: Your coincidence calculations may be correct for _independent_ draws from a discrete distribution on M values, but independence is not satisfied. Yet again, you are trying to do things that any good text on simulation would warn you against, and which (in a thread on R-