Re: [R] Flipping axis 1 in CCA plot - vegan

2011-02-16 Thread Jari Oksanen
esgarbanzo uw.edu> writes: > > > Hello, > I've successfully run my CCA and the ordination is not displayed quite > right. Is it possible to flip the x-axis (ie., make it a mirror image of > itself)? > Howdy, I don't know wha tyou mean when you say that the ordination is not displayed "right".

Re: [R] package ChemometricsWithR

2011-02-16 Thread Prof Brian Ripley
On Wed, 16 Feb 2011, deborahsills wrote: Did you find out where one can get the package ChemometricsWithR. All we *know* is that it is said to be with the book, but it has been submitted to CRAN. If accepted, it will appear there. Thank you! Deborah PLEASE do read the posting guide ht

Re: [R] incomplete final line

2011-02-16 Thread Joshua Wiley
Hi, On Wed, Feb 16, 2011 at 10:11 AM, mipplor wrote: > Hi, > > I work like this: > >> data<‐read.table('E:/my documents/r/consumer.xls',header=TRUE) > Warning message: > In read.table("E:/my documents/r/consumer.xls", header = TRUE) : >  incomplete final line found by readTableHeader on 'E:/my >

Re: [R] logsumexp function in R

2011-02-16 Thread Petr Savicky
On Wed, Feb 16, 2011 at 04:14:38PM -0500, Brian Tsai wrote: > Hi, > > I was wondering if anyone has implemented a numerically stable function to > compute log(sum(exp(x))) ? Try the following log(sum(exp(x - max(x + max(x) If this is not sufficient, consider using CRAN package Rmpfr with

Re: [R] summary in functions

2011-02-16 Thread Simon Blomberg
On 17/02/11 09:44, Sam Steingold wrote: summary() in functions seems to print nothing. str() does print something. why? summary() returns the summary information as its value. If you want to see this value from inside a function, use print(summary()). The reason you see the summary informat

Re: [R] Timeseries Data Plotted as Monthly Boxplots

2011-02-16 Thread Thomas Adams
Katrina, What I have done, if I understand what you are after, was to create a list for each month of data - in order. Then, create a boxplot - in order - by month/year. I do this for our ensemble streamflow forecasts. The key us to create the list of values by month. Regards, Tom Sent from m

Re: [R] leap years in temporal series command ts

2011-02-16 Thread Gabor Grothendieck
On Wed, Feb 16, 2011 at 11:37 AM, Peter Zorglub wrote: > Ok thanks. I got now a temporal series of 2557 elements thanks to the below > code: > >> seriezoo=zooreg(serie, start=as.Date("2002-01-01")) >> seriezooTS=as.ts(seriezoo) > > The structure of seriezooTS is then the following one (str command

[R] 3 questions about the poisson regression of contingency table

2011-02-16 Thread Lao Meng
Hi all: I have 3 questions about the poisson regression of contingency table. Q1¡¢How to understand the "independent poisson process"as many books or paper mentioned? For instance: Table1 --- treat canernon-cancersum -

[R] calling pairs of variables into a function

2011-02-16 Thread squamous
Hi, I have imported three text files into R using read.table. Their variables are called d, e and f. I want to run a function on all the possible combinations of these three files. The only way I know how to do that is like this: bigfunction(d,e) bigfunction(d,f) bigfunction(e,d) bigfunction(

[R] vector splicing

2011-02-16 Thread Sam Steingold
the following seems to work for numeric but not for times: parse.vec <- function (vec, parser = as.numeric, vmode = "numeric", na.string = "N/A") { bad <- (vec == na.string); ret <- vector(mode = vmode, length = length(vec)); if (some(bad)) ret[bad] <- NA; if (so

Re: [R] Cannot allocate memory block

2011-02-16 Thread poisontonic
Uwe Ligges-3 wrote: > > If the available space got too fragmented, there is not single 3.8 block > of memory available any more > Is there anything I can do to prevent this? I've restarted and rerun the whole thing straight up, and still the error...? Ben -- View this message in context

[R] create a data frame with the given column names

2011-02-16 Thread Sam Steingold
how do I create a data frame with the given column names _NOT KNOWN IN ADVANCE_? i.e., I have a vector of strings for names and I want to get an _EMPTY_ data frame with these column names. is it at all possible? -- Sam Steingold (http://sds.podval.org/) on CentOS release 5.3 (Final) http://openvo

[R] predict not complete?

2011-02-16 Thread cosmokramer
take this code library(dynlm) test=dynlm(diff(log(y))~ lag(x, -1) + lag(z, -1)) fc=predict(test) fc when I run this and look at "fc", the values there only go as long as the sample (of y) goes, but it should be one further, right? since the other values are lagged. Is predict the wrong functi

Re: [R] string parsing

2011-02-16 Thread Sam Steingold
> * David Winsemius [2011-02-16 13:33:32 -0500]: > >> parse.num <- function (s) { >> as.numeric(gsub("M$","e6",gsub("B$","e9",s))); } > > data[1] <- parse.num( data[[1]] ) # as.numeric and gsub are vectorized because parse.num turned out to not be as simple as that: I need to handle "N/A" specia

[R] incomplete final line

2011-02-16 Thread mipplor
Hi, I work like this: > data<‐read.table('E:/my documents/r/consumer.xls',header=TRUE) Warning message: In read.table("E:/my documents/r/consumer.xls", header = TRUE) : incomplete final line found by readTableHeader on 'E:/my documents/r/consumer.xls' could someone shoot the trouble for me ?

[R] confused by lapply

2011-02-16 Thread Sam Steingold
Description: 'lapply' returns a list of the same length as 'X', each element of which is the result of applying 'FUN' to the corresponding element of 'X'. I expect that when I do > lapply(vec,f) f would be called _once_ for each component of vec. this is not what I see: parse.num

[R] Function scope issues

2011-02-16 Thread Sébastien Bihorel
Dear R-users, I have some questions about the scope of functions, which I would like to illustrate with the following example: ### First example require(Hmisc) combine.levels <- function(x,y) browser() whatever <- function(x,y) combine.levels(x,y) x <- 1:5 names(x) <- LETTERS[x] y <- 6: 10 name

Re: [R] leap years in temporal series command ts

2011-02-16 Thread Peter Zorglub
Ok thanks. I got now a temporal series of 2557 elements thanks to the below code: > seriezoo=zooreg(serie, start=as.Date("2002-01-01")) > seriezooTS=as.ts(seriezoo) The structure of seriezooTS is then the following one (str command): > str(seriezooTS) Time-Series [1:2557] from 11

Re: [R] caret::train() and ctree()

2011-02-16 Thread Max Kuhn
Andrew, ctree only tunes over mincriterion and ctree2 tunes over maxdepth (while fixing mincriterion = 0). Seeing both listed as the function is being executed is a bug. I'll setup checks to make sure that the columns specified in tuneGrid are actually the tuning parameters that are used. Max O

Re: [R] A Math question

2011-02-16 Thread rex.dwyer
If y'all want to discuss this more, do it somewhere else, please. This has little to do with R except that both depend on Peano's Axioms. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of jlu...@ria.buffalo.edu Sent: Tuesday, February

[R] help with spatstat ppp transformation data

2011-02-16 Thread Ana María Prieto
Hello I am currently studying spatial distribution of lizards in Spain and Germany. For this I am using the spatstat package of R to make a Kolmogorov-Smirnov test of CSR of unmarked points data. I have problems transforming the data to ppp class, and I would like to know if you can help me. I h

[R] summary in functions

2011-02-16 Thread Sam Steingold
summary() in functions seems to print nothing. str() does print something. why? -- Sam Steingold (http://sds.podval.org/) on CentOS release 5.3 (Final) http://mideasttruth.com http://truepeace.org http://iris.org.il http://pmw.org.il http://jihadwatch.org http://ffii.org A year spent in artificial

[R] VAR with HAC

2011-02-16 Thread Marta Lachowska
Hello, I would like to estimate a VAR model with HAC corrected standard errors. I tried to do this by using the sandwich package, for example: > library(vars) > data(Canada) > myvar = VAR(Canada, p = 2, type = "const") > coeftest(myvar, vcov = vcovHAC) Error in umat - res : non-conformable ar

[R] 3 questions about the poisson regression of contingency table

2011-02-16 Thread Lao Meng
Hi all: I have 3 questions about the poisson regression of contingency table. Q1¡¢How to understand the "independent poisson process"as many books or paper mentioned? For instance: Table1 --- treat canernon-cancersum ---

[R] Linear regressions: producing multiple outputs

2011-02-16 Thread RTSlider
Hello all, I’m running simple linear regressions on multiple species of plants, comparing abiotic factor X against plant trait Y (e.g. Species1: leaf length vs air temperature). Ideally, what I’m looking for is an output giving me the R2, p value, coefficient, and Y intercept for each regression.

[R] speed up the code

2011-02-16 Thread Hui Du
Hi All, The following is a snippet of my code. It works fine but it is very slow. Is it possible to speed it up by using different data structure or better solution? For 4 runs, it takes 8 minutes now. Thanks a lot fun_activation = function(s_k, s_hat, x_k, s_hat_len) { common = inte

Re: [R] R package error

2011-02-16 Thread ycherkas
It worked! Many-many thanks! On Wed, Feb 16, 2011 at 11:49 AM, Uwe Ligges-3 [via R] < ml-node+3309233-468204624-213...@n4.nabble.com> wrote: > > > On 15.02.2011 19:20, ycherkas wrote: > > > > Hi, > > I have a package I was previously able to compile and use for R 2.6. > > In the newer versions o

Re: [R] package ChemometricsWithR

2011-02-16 Thread deborahsills
Did you find out where one can get the package ChemometricsWithR. Thank you! Deborah -- View this message in context: http://r.789695.n4.nabble.com/package-ChemometricsWithR-tp3264902p3309927.html Sent from the R help mailing list archive at Nabble.com. _

[R] Evaluating model fits for ordinal multinomial regressions with polr()

2011-02-16 Thread Ben Haller
Hi all. I'm just starting to explore ordinal multinomial regression. I've been doing logistic regression in the past, and I've gotten used to various functions for getting pseudo-R2 metrics and other metrics to evaluate the quality of a model. For example: val.prob() NagelkerkeR2() ClassLo

[R] Flipping axis 1 in CCA plot - vegan

2011-02-16 Thread esgarbanzo
Hello, I've successfully run my CCA and the ordination is not displayed quite right. Is it possible to flip the x-axis (ie., make it a mirror image of itself)? Thanks! Jeremy -- View this message in context: http://r.789695.n4.nabble.com/Flipping-axis-1-in-CCA-plot-vegan-tp3309726p3309726.html

[R] error in optim, within polr(): "initial value in 'vmmin' is not finite"

2011-02-16 Thread Ben Haller
Hi all. I'm just starting to explore ordinal multinomial regression. My dataset is 300,000 rows, with an outcome (ordinal factor from 1 to 9) and five independent variables (all continuous). My first stab at it was this: pomod <- polr(Npf ~ o_stddev + o_skewness + o_kurtosis + o_acl_1e + di

Re: [R] string parsing

2011-02-16 Thread rex.dwyer
It's only "awfully" inefficient if it's a bottleneck. You're not doing this more than once per item fetched from the network, and the time is insignificant relative to the fetch. If it were somehow in your inner loop, it would be worth worrying about, but your purpose is to eliminate Ms and Bs

[R] Timeseries Data Plotted as Monthly Boxplots

2011-02-16 Thread Katrina Bennett
Hello, I'm trying to develop a box plot of time series data to look at the range in the data values over the entire period of record. My data initially starts out as a list of hourly data, and then I've been using this code to make this data into the final ts array. # Read in the station list stn

[R] logsumexp function in R

2011-02-16 Thread Brian Tsai
Hi, I was wondering if anyone has implemented a numerically stable function to compute log(sum(exp(x))) ? Thanks! Brian [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] How to ignore data

2011-02-16 Thread agent dunham
Hi, I have tried what you suggest here, and it seems not to work, can you help me? I want to do a lm regression, some of the variables are going to be affected with log, I would like not no take into account those rows which imply doing log(0) for just one variable I have done the following bu

[R] Fwd: D parameter on qqplots

2011-02-16 Thread Chiara Della Libera
Hello everyone, I would like to plot (or highlight in some way) the D parameter of KS tests in qqplots displaying the distributions of my two data sets, and get a result similar to this: http://www.physics.csbsju.edu/stats/bothB_log_a.gif Is there a way to do it with R? Thank you all, Chiara

[R] Parzen fractional degree of differencing estimator

2011-02-16 Thread Fologo Dubois
Does R have a function for Parzen fractional degree of differencing estimator? I am referring to the non-parametric kernel density estimator set forth by Parzen in Parzen (1983)   [[alternative HTML version deleted]] __ R-help@r-projec

[R] ParallelR Lite on Mac OSX?

2011-02-16 Thread Scott Chamberlain
Dear R users, I tried to use the built in parallelization in RevolutionR 2.10.0 on my Mac OSX, with i5 processor (so 4 cores). Nothing happens when I use %dopar% for parallelization in RevolutionR 2.10.0, and using 2.12.1 I just get errors: library(doMC) registerDoMC() getDoParWorkers() x <-

Re: [R] how to set chart output size in rgl (surface3d)?

2011-02-16 Thread cuass
You can put the following at the beginning library(rgl) r3dDefaults$windowRect <- c(0,50, 700, 700) -- View this message in context: http://r.789695.n4.nabble.com/how-to-set-chart-output-size-in-rgl-surface3d-tp2066054p3309628.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Returning NA from lm

2011-02-16 Thread agent dunham
Hi, thanks for your post, I tried what you said, and it runs, however when I type summary ... I obtain the following: What's happening? How can I solve it? lmod1.lm <- tryCatch(lm(log(dat$inaltu)~log(dat$indiam),na.action=na.fail),error=function(err){NA}) summary(lmod1.lm,

[R] Rjdbc dbGetquery execution error

2011-02-16 Thread Hasan Diwan
Rjdbc consistently gives me an execution error with postgresql 9.0s JDBC4 driver. It's probably something trivial so am including my code below: library("RJDBC") param <- 249 param2 <- 188129 postgres <- JDBC("org.postgresql.Driver", ".m2/repository/postgresql/postgresql/9.0-801.jdbc4/postgresql-9

[R] tikzDevice compiling problem

2011-02-16 Thread cuass
Hi guys. The tex file which compile the following graphic has many problems. I don't know what's happening. Any input would be really appreciated. # Cargo el prgrama que produce el código en Latex require(tikzDevice) # Establezco directorio del programa setwd('/Users/fabiangarcia/Documents/R')

[R] hel on leveneTest

2011-02-16 Thread netrunner
Dear all, For my research I need to perform a Levene's test on my data.I have not large experience with this test and with R,so I have some problems to use the leveneTest function. I read some previous posts on this topic but I cannot understand what I have to do. I have a five-columns data fram

[R] y-axis slightly cut-off after printing plots to tiff

2011-02-16 Thread alfredo
Hi Folks, I'm hoping someone could help me a bit. I have plotted the following: ### tiff("plot7.tiff",units="cm",width=15,height=36,res=700) layout(matrix(c(1,2,3,4,5,6),3,1),widths=lcm(c(15)),heights=lcm(c(12,12,12)),respect=TRUE) plot.t1<-plot(data.dist

[R] caret::train() and ctree()

2011-02-16 Thread Andrew Ziem
Like earth can be trained simultaneously for degree and nprune, is there a way to train ctree simultaneously for mincriterion and maxdepth? Also, I notice there are separate methods ctree and ctree2, and if both options are attempted to tune with one method, the summary averages the option it

Re: [R] which functions are being debugged?

2011-02-16 Thread Henrique Dallazuanna
Try this: isDebug <- lapply(sapply(search(), lapply, ls), function(f)sapply(f, function(.f)tryCatch(isdebugged(.f), error = function(...)FALSE))) which(unlist(isDebug)) On Wed, Feb 16, 2011 at 10:28 PM, Shi, Tao wrote: > Hi list, > > Is there a function that can let me know which functions are

[R] which functions are being debugged?

2011-02-16 Thread Shi, Tao
Hi list, Is there a function that can let me know which functions are being debugged? I know I'm probably not doing a very good job of keeping track of things, but it does get messier when you dig into different layers of a function. I know there is "isdebugged", but it only works on one fun

Re: [R] Saturated model in binomial glm

2011-02-16 Thread Bill.Venables
This is a very good question. You have spotted something that not many people see and it is important. The bland assertion that the "deviance can be used as a test of fit" can be seriously misleading. For this data the response is clearly binary, "Admitted" (success) or "Rejected" (failure) a

Re: [R] Confidence interval of Survival Curve of Weighted Cox Regression

2011-02-16 Thread Terry Therneau
--- begin included message --- May I know how to obtain the confidence interval of the survival curve of weighted Cox regression model? I tried coxph, cph, and coxphw, but they did not work. Any help would be much appreciated. end inclusion --- Use the latest version of the survival pacakge

Re: [R] error with demo in gsubfn on Mac; Re: string parsing

2011-02-16 Thread Gabor Grothendieck
On Wed, Feb 16, 2011 at 5:09 PM, David Winsemius wrote: > require(gsubfn) >>> >>> Loading required package: gsubfn >>> Loading required package: proto demo("gsubfn-si") >>> >>> >>>       demo(gsubfn-si) >>>       ~ >>> >>> Type     to start : >>> Error in source(availab

Re: [R] error with demo in gsubfn on Mac; Re: string parsing

2011-02-16 Thread David Winsemius
On Feb 16, 2011, at 4:13 PM, Gabor Grothendieck wrote: On Wed, Feb 16, 2011 at 3:42 PM, David Winsemius > wrote: On Feb 16, 2011, at 3:25 PM, Gabor Grothendieck wrote: On Tue, Feb 15, 2011 at 5:20 PM, Sam Steingold wrote: Check the example at the end of section 2 of the gsubfn vignette

[R] Saturated model in binomial glm

2011-02-16 Thread Giovanni Petris
Hi all, Could somebody be so kind to explain to me what is the saturated model on which deviance and degrees of freedom are calculated when fitting a binomial glm? Everything makes sense if I fit the model using as response a vector of proportions or a two-column matrix. But when the response is

[R] formal concept analysis in R?

2011-02-16 Thread Mark Heckmann
I am looking for an R package for formal concept analysis (http://en.wikipedia.org/wiki/Formal_concept_analysis). I want to produce concept lattices (http://en.wikipedia.org/wiki/File:Concept_lattice.svg). I was wondering if there are packages that can produce similar graphics? Thanks, Mark ––

Re: [R] error with demo in gsubfn on Mac; Re: string parsing

2011-02-16 Thread Gabor Grothendieck
On Wed, Feb 16, 2011 at 3:42 PM, David Winsemius wrote: > > On Feb 16, 2011, at 3:25 PM, Gabor Grothendieck wrote: > >> On Tue, Feb 15, 2011 at 5:20 PM, Sam Steingold wrote: >>> >>> >> >> Check the example at the end of section 2 of the gsubfn vignette: >> >> http://cran.r-project.org/web/package

[R] error with demo in gsubfn on Mac; Re: string parsing

2011-02-16 Thread David Winsemius
On Feb 16, 2011, at 3:25 PM, Gabor Grothendieck wrote: On Tue, Feb 15, 2011 at 5:20 PM, Sam Steingold wrote: Check the example at the end of section 2 of the gsubfn vignette: http://cran.r-project.org/web/packages/gsubfn/vignettes/gsubfn.pdf OK. I'm impressed. So I loaded gsubfn to do

Re: [R] string parsing

2011-02-16 Thread Gabor Grothendieck
On Tue, Feb 15, 2011 at 5:20 PM, Sam Steingold wrote: > I am trying to get stock metadata from Yahoo finance (or maybe there is > a better source?) > here is what I did so far: > > yahoo.url <- "http://finance.yahoo.com/d/quotes.csv?f=j1jka2&s=";; > stocks <- c("IBM","NOIZ","MSFT","LNN","C","BODY"

Re: [R] help needed for strptime "000000" !

2011-02-16 Thread Dieter Menne
JESSICA wrote: > > > I have a text file stored in notepad: > > DATE TIME Q > 2004-11-01233311 1 > 2004-11-01234227 1 > ... > I run > > x<-read.table("C:/R/Sample.txt",header=T) > then get a table > > ... > I am trying to > > strptime(x$TIME,"%H%M%S"

[R] covar

2011-02-16 Thread Val
Hi all, I want to construct relatedness among individuals and have a look at the following script. # rm(list=ls()) N=5 id = c(1:N) dad = c(0,0,0,3,3) mom = c(0,0,2,1,1) sex = c(2,2,1,2,2) # 1= M and 2=F A=diag(nrow = N) for(i in 1:N){ for(j in i:N)

Re: [R] string parsing

2011-02-16 Thread David Winsemius
On Feb 16, 2011, at 2:26 PM, David Winsemius wrote: On Feb 16, 2011, at 2:09 PM, Sam Steingold wrote: * David Winsemius [2011-02-16 13:33:32 -0500]: parse.num <- function (s) { as.numeric(gsub("M$","e6",gsub("B$","e9",s))); } data[1] <- parse.num( data[[1]] ) # as.numeric and gsub ar

[R] command history in slave mode

2011-02-16 Thread Jannis
Dear list, I am running R in slave mode to run some calculations on a remote cluster and would like to somehow retrieve the last command in the case that it causes an error. When an error occours, my job is just quitted and it takes me a lot of work to find out which command in my rather lengt

Re: [R] how to create normalized pdf plot?

2011-02-16 Thread Dennis Murphy
Hi: There are some reasonably efficient ways to do this if you're a little clever. If you use 16 histograms per page, you can get 928 of them onto 58 pages - with 4 per page, with one left over, that would generate 233 pages of output. I could think of something like the following (pseudocode): 1

Re: [R] string parsing

2011-02-16 Thread David Winsemius
On Feb 16, 2011, at 2:09 PM, Sam Steingold wrote: * David Winsemius [2011-02-16 13:33:32 -0500]: parse.num <- function (s) { as.numeric(gsub("M$","e6",gsub("B$","e9",s))); } data[1] <- parse.num( data[[1]] ) # as.numeric and gsub are vectorized because parse.num turned out to not be

Re: [R] string parsing

2011-02-16 Thread David Winsemius
On Feb 15, 2011, at 5:20 PM, Sam Steingold wrote: I am trying to get stock metadata from Yahoo finance (or maybe there is a better source?) here is what I did so far: yahoo.url <- "http://finance.yahoo.com/d/quotes.csv?f=j1jka2&s=";; stocks <- c("IBM","NOIZ","MSFT","LNN","C","BODY","F"); # j

Re: [R] string parsing

2011-02-16 Thread jim holtman
try this: > x <- c('15.5B', '13.6M') > x <- sub("B", 'e9', x) > x <- sub("M", 'e6', x) > as.numeric(x) [1] 1551360 On Tue, Feb 15, 2011 at 5:20 PM, Sam Steingold wrote: > I am trying to get stock metadata from Yahoo finance (or maybe there is > a better source?) > here is what I

Re: [R] read.table - reading text variables as text

2011-02-16 Thread Ista Zahn
Hi Nick, On Wed, Feb 16, 2011 at 7:28 AM, Nick Riches wrote: > Hi > > I've resolved the following query by adding the option "stringsAsFactors = > FALSE" Sure, that works, but it doesn't explain why as.is="stim" didn't work. Unfortunately I cannot reproduce: > dat <- data.frame(stim=letters[10]

Re: [R] problem running scripts

2011-02-16 Thread Uwe Ligges
On 14.02.2011 19:58, jose Bartolomei wrote: Dear all, I have encounter an odd situation. I have various R scripts interconnected via the source () function. After examining the results I noticed that not all the functions or procedures within a script were adequately conducted. Especia

Re: [R] R not working after loading lattice

2011-02-16 Thread Uwe Ligges
On 14.02.2011 16:50, Rita Carreira wrote: Hello! Happy Valentine's Day... After I loaded the package lattice in R, it did not work. Then when I closed R and restarted it, R started with an error message and here is the feedback that I got from the R Console: Loading required package: Hmisc

Re: [R] Cannot allocate memory block

2011-02-16 Thread Uwe Ligges
On 15.02.2011 21:05, poisontonic wrote: Hi, I'm using the latest version of 64-bit R for Windows: R x64 2.12.1 I'm using it because I currently need to do hierarchical clustering on a very large object (too big for MATLAB, which I normally use). When I try to cluster my distance matrix d (obt

Re: [R] R package error

2011-02-16 Thread Uwe Ligges
On 15.02.2011 19:20, ycherkas wrote: Hi, I have a package I was previously able to compile and use for R 2.6. In the newer versions of R it did not work, so I am making it from scratch using Rtools and new R version. Looks like you have designed "mypack" in a way that it is supposed to run

Re: [R] boot.ci error with large data sets

2011-02-16 Thread Peter Ehlers
On 2011-02-16 04:44, Lars Dalby wrote: Dear List I have run into some problems with boot.ci from package boot. When I try to obtain a confidence interval of type bca, boot.ci() returns the following error when the data set i large: Error in bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 =

Re: [R] retrieving partial residuals of gam fit (mgcv)

2011-02-16 Thread Simon Wood
The partial residuals for a smooth term are just the whole model residuals + the corresponding estimate of the smooth term. You can use predict to access the latter and compute them quite easily. For example... set.seed(0) ## simulate some data... dat <- gamSim(1,n=400,dist="normal",sc

Re: [R] ExpertFit

2011-02-16 Thread Ben Bolker
Arnau Mir uib.es> writes: > Somebody knows if there exists some R package that it is capable of > doing the same of the software ExpertFit > (see http://www.averill-law.com/ExpertFit-distribution-fitting-software.htm)? Not that I'm aware of: see e.g.

Re: [R] A Math question

2011-02-16 Thread JLucke
I just found out that the sum of 1+2+3+... is -1/12. !?! Crazy. Not really. Google on divergent series or Euler summation. The result explains why bosonic string theory must operate only in 26 dimensions! It would then appear that ... -3 - 2 - 1 + 0 +1 +2 +3 + ... is zero. pete

Re: [R] NeweyWest

2011-02-16 Thread Achim Zeileis
On Wed, 16 Feb 2011, stif...@gmx.de wrote: Hey everyone, For an investment strategy I built some portfolios of historical stock returns (every 6 month for 10 years->20observations). To get more observations I´m using overlapping observations(40obs. which means lag=1).The goal is to test whet

Re: [R] id number by group and correlative

2011-02-16 Thread Sarah Goslee
You don't really need to do all of that, since you can use group directly. But if you want to have a numeric value for some reason, here's one possible way: group <- c("A", "A", "A", "A", "B", "B", "B", "C", "C", "C", "C", "C") id_group <- as.numeric(as.factor(group)) correlative_group <- unlist(l

[R] Arima contents

2011-02-16 Thread Downey, Patrick
Hello, I'm running a number of arima models using the "arima" function. Often, when lag length gets too high, these model don't converge and an error message appears as this: > reg <- arima(y,order=c(7,0,7),xreg=isr) Warning message: In arima(y, order = c(7, 0, 7), xreg = isr) : possible converg

Re: [R] monitor variable change

2011-02-16 Thread Duncan Murdoch
On 16/02/2011 9:04 AM, Jan van der Laan wrote: One possible solution is to use something like: a<- 0 for (i in 1:1E6) { old.a<- a # do something e.g. a<- runif(1)< 1E-6 if (a != old.a) browser() } Another solution is to write your output to file (using sink for examp

Re: [R] leap years in temporal series command ts

2011-02-16 Thread Gabor Grothendieck
On Wed, Feb 16, 2011 at 6:51 AM, Peter Zorglub wrote: > Hi R community! > > I'd like to create a temporal series with ts command for the interval 1st > January 2002 - 31 December 2008. I have daily values, so this is a 2557 days > temporal series. I'm using this command : > >    ts(observations, s

[R] Hartley's table

2011-02-16 Thread Silvano
Hi, I used the commands below to make Hartley's table, but some values are NA. require(SuppDists) trat = seq(2, 15, 1) gl = seq(2, 40, 1) har = matrix(0, nr=length(gl), nc=length(trat)) for(i in 1:length(gl)) for(j in 1:length(trat)) har[i,j] <- qmaxFratio(.95, df=gl[i], k=trat[j]) rownames(h

[R] NeweyWest

2011-02-16 Thread stiff83
Hey everyone, For an investment strategy I built some portfolios of historical stock returns (every 6 month for 10 years->20observations). To get more observations I´m using overlapping observations(40obs. which means lag=1).The goal is to test whether the reruns are positiv or market efficient

Re: [R] How to group data by day

2011-02-16 Thread Michela Ferron
Many thanks Mikhail, aggregate() is fine! Il 14/02/2011 20.42, Mikhail Titov ha scritto: It depends what would you like to get at the end. Perhaps you don't necessary need this type of numbering. For instance, if you'd like to calculate daily average. london$id<- as.Date(london$id) For sum by

[R] leap years in temporal series command ts

2011-02-16 Thread Peter Zorglub
Hi R community! I'd like to create a temporal series with ts command for the interval 1st January 2002 - 31 December 2008. I have daily values, so this is a 2557 days temporal series. I'm using this command : ts(observations, start=2002, end=2009, freq=365) However, I don't get the corre

Re: [R] String manipulation

2011-02-16 Thread rex.dwyer
A quick way to do this is to replace \d and \D with character classes [0-9.] and [^0-9.] . This assumes that there is no scientific notation and that there is nothing like 123.45.678 in the string. You did not account for a leading minus sign. The book Mastering Regular Expressions is probably

[R] read.table - reading text variables as text

2011-02-16 Thread Nick Riches
Hi I've resolved the following query by adding the option "stringsAsFactors = FALSE" Thanks Nick Riches -- Forwarded message -- From: Nick Riches Date: 16 February 2011 12:16 Subject: read.table - reading text variables as text To: r-help@r-project.org Hi I'm reading a CSV f

[R] Need Assistance in Stacked Area plot

2011-02-16 Thread Kishorenalluri
Dear All, I need the assistance to plot the staked area plot using ggplot2 What i am expecting is to plot in X-axis the time(Shown in column1) from range of 0 to 100 seconds, and in the y axis the stable increment in area in both directions (less than and greater than zero) for columns 3, 4, 5 (

[R] while loop / ICA

2011-02-16 Thread jankov
Hello, after (1) getting independent components from the (200*20) data matrix X_t by applying PearsonICA(data matrix, n.comp = 2, row.norm = FALSE, maxit = 200, tol = 1e-04, border.base = c(2.6, 4), border.slope = c(0, 1), verbose = FALSE, w.init = NULL, na.rm = FALSE, whitening.only = FALSE

[R] read.table - reading text variables as text

2011-02-16 Thread Nick Riches
Hi I'm reading a CSV file using read.table, and it keeps importing a text variable as a factor. To overcome this, I've used the as.is command referring to the variable in question (called "stim") data<-read.table(file.choose(), header=T, sep=",", as.is = "stim") However, "stim" is still imported

[R] leap years in temporal series command ts

2011-02-16 Thread Peter Zorglub
Hi R community! I'd like to create a temporal series with ts command for the interval 1st January 2002 - 31 December 2008. I have daily values, so this is a 2557 days temporal series. I'm using this command : ts(observations, start=2002, end=2009, freq=365) However, I don't get the corre

[R] Shading of a boxplot

2011-02-16 Thread Roger Bordoy
Dears, I would like to know how could I change the shading type of a box plot. Thanks a lot. Sincerely, Roger Bordoy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proj

[R] using the bootstrap method for latent class analysis

2011-02-16 Thread Debbie Naudi
Hi I was wondering whether anyone can provide any help or suggestions on the boostrap method for latent class analysis please. My main question is: can the bootstrap procedure sometimes be less precise than the non-bootstrap procedure when carrying out latent class analysis? I am asking this que

[R] id number by group and correlative

2011-02-16 Thread Sebastián Daza
Hello everyone, I am new in R and I am trying to create a id number (a correlative sequence of numbers) by group, and a correlative sequence of numbers inside each group (my idea is to get statistics by group without having to aggregate the database). Here an example: group id_group

Re: [R] monitor variable change

2011-02-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/16/2011 03:29 PM, Hadley Wickham wrote: > One way to implement this functionality is with a task manager callback: > > watch <- function(varname) { > old <- get(varname) > > changed <- function(...) { > new <- get(varname) > if (!id

Re: [R] boot.ci error with large data sets

2011-02-16 Thread Matthew Dowle
Hello Lars, (cc'd) Did you ask maintainer("boot") first, as requested by the posting guide? If you did, but didn't hear back, then please say so, so that we know you did follow the guide. That maintainer is particularly active, and particularly efficient though, so I doubt you didn't hear back.

Re: [R] monitor variable change

2011-02-16 Thread Hadley Wickham
One way to implement this functionality is with a task manager callback: watch <- function(varname) { old <- get(varname) changed <- function(...) { new <- get(varname) if (!identical(old, new)) { message(varname, " is now ", new) old <<- new } TRUE } invisible

[R] ExpertFit

2011-02-16 Thread Arnau Mir
Hello. Somebody knows if there exists some R package that it is capable of doing the same of the software ExpertFit (see http://www.averill-law.com/ExpertFit-distribution-fitting-software.htm)? Thanks, Arnau. Arnau Mir Torres Edifici

Re: [R] monitor variable change

2011-02-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/16/2011 03:24 PM, Hadley Wickham wrote: >> You can replace the previous line by: >> >> browser(expr=(a!=old.a) >> >> see ?browser for details. > > I don't understand why you'd want to do that - using if is much more > readable to me (and is much

Re: [R] monitor variable change

2011-02-16 Thread Hadley Wickham
> You can replace the previous line by: > > browser(expr=(a!=old.a) > > see ?browser for details. I don't understand why you'd want to do that - using if is much more readable to me (and is much more general!) Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics

Re: [R] monitor variable change

2011-02-16 Thread Erich Neuwirth
You could use any of the gui toolkits (tcltk, gWidgets ...) and create a watch window which displays the changing value of your variable in a popup widged. On 2/16/2011 10:54 AM, Rainer M Krug wrote: > On 02/16/2011 10:38 AM, Alaios wrote: >> Dear all I would like to ask you if there is a way in R

Re: [R] monitor variable change

2011-02-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/16/2011 03:04 PM, Jan van der Laan wrote: > > One possible solution is to use something like: > > a <- 0 > for (i in 1:1E6) { > old.a <- a > > # do something e.g. > a <- runif(1) < 1E-6 > > if (a != old.a) browser() You can re

Re: [R] monitor variable change

2011-02-16 Thread Jan van der Laan
One possible solution is to use something like: a <- 0 for (i in 1:1E6) { old.a <- a # do something e.g. a <- runif(1) < 1E-6 if (a != old.a) browser() } Another solution is to write your output to file (using sink for example) and to watch this file using a tool like tail.

  1   2   >