Re: [R] svm with GRASS GIS

2012-02-16 Thread Etienne B. Racine
2012/2/15 gab > > Errore in scale(newdata[, object$scaled, drop = FALSE], center = > object$x.scale$"scaled:center", : > (subscript) indice logicol troppo lungo > I'm pretty sure the problem is with your data frame. Maybe if you share the result of dput(training[1:10, ]) # (make sure to include

Re: [R] svm with GRASS GIS

2012-02-15 Thread Etienne B. Racine
Gab, Make sure you have variables for each training. training <- data.frame(Training_2006, AST_L1B_1, AST_L1B_2, AST_L1B_3N) If you can't do that, then you don't have as many training observations than you have predictive informations. Make sure to create a line for each set of predictive pixels

Re: [R] Plotting function image

2012-02-15 Thread Etienne B. Racine
Uday, maybe you could have a look at the raster package. Etienne 2012/2/15 uday > Hi , > > Thanks for reply > > My latitude and longitude contains 9-10 observations per file > when I run coords <- expand.grid(lat=1:5,long=1:5) then my computer > > *** caught segfault *** > address 0x695

Re: [R] Sample function in R

2012-02-12 Thread Etienne B. Racine
Supakorn, Try: rm(sample) #then sample(x) Etienne 2012/2/12 SUPAKORN LAOHAPITAKVORN > This is what I got: > > > sessionInfo() > R version 2.14.1 (2011-12-22) > Platform: x86_64-pc-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_United States.1252 > [2] LC_CTYPE=English_United States.

[R] Maximum discrepancy palette

2011-12-12 Thread Etienne B. Racine
I'm looking for a palette that would maximize the discrepancy with neighbouring elements. I have a raster image of objects tagged with integers. I'd like to highlight the different objects by using a palette that would maximize this difference with neighbours as close numbers tend to be neighbours

Re: [R] merging two data frame with colomns of different length

2009-07-31 Thread Etienne B. Racine
Salut Julien, t1 <- table(data1$Id01) t2 <- table(data2$Id02) # compute difference between the two tables diff <- t1-t2 # create your data frame from data2 res <- data2 names(res)[1] <- "Id01" lsAdd <- rep(attributes(diff)$dimnames[[1]],diff) defVal <- NA rbind(res,data.frame(Id01 =lsAdd, Are

Re: [R] Re lative paths in R?

2009-07-30 Thread Etienne B. Racine
Maybe if you could send that path via the arguments, you could get them back using commandArgs(). Then you can setwd() and paste() to generate paths. julien cuisinier wrote: > > > Dear list, > > > > > > > > I use the R CMD BATCH to run a file of R commands (from php for info) > > Th

Re: [R] Subtract matrices within arrays along indices

2009-07-29 Thread Etienne B. Racine
Hi Christian, Christian Langkamp wrote: > > I have the following array: 3 dimensional object, one dimension being > year. Object is 3*3*3 > > library(plyr, reshape) > # reshape won't be loaded that way, use separate library() Christian Langkamp wrote: > > a1<-rep(c(2007,2008,2009),9) > a2<-c

[R] Mixdist producing Na's and NaN's

2009-07-15 Thread Etienne B. Racine
When using mix() form the mixdist package, I sometimes get NA's and NaN's in the Standard Errors estimates. I've understood from the code that mix() it is using Non-linear minimization (nlm) to estimate thoses errors, but I can't understand how to interpret theses results. Does any one have a (web

Re: [R] naming of columns in R dataframe consisting of mixed data (alphanumeric and numeric)

2009-07-09 Thread Etienne B. Racine
Mary A. Marion-2 wrote: > > Hello, > > I have an r function that creates the following dataframe tresults2. > Notice that column 1 does not have a column heading. > > Tresults2: > [,1] > estparam 18.0 > nullval 20.0 > . . . > ciWidth 2.04622 > HalfInter

Re: [R] Deleting repeated rows

2009-06-26 Thread Etienne B. Racine
dreamworx wrote: > > Appologies if this is a simple problem. I have a matrix which is 86x3 and > each row contains three integers. The problem I have is that some of the > rows of integers are repeated in other rows and I only wish to have one > copy of these rows. > > Is there a function that

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread Etienne B. Racine
You could also make some algebra. e.g. : ?rweibull gives the formula of the mean and of the cumulative distribution function in the Details section. So using your known parameters (i.e. mean=30 and p(10)=.10, i.e. cumulative function(10) =.90), I think it is sufficient to determine the exact val

[R] Merge data frame and keep unmatched

2009-06-10 Thread Etienne B. Racine
Hi, With two data sets, one complete and another one partial, I would like to merge them and keep the unmatched lines. The problem is that merge() dosen't keep the unmatched lines. Is there another function that I could use to merge the data frames. Example: completedf <- expand.grid(alpha=lett

Re: [R] ColorRamp different from ColorRampPalette

2009-04-17 Thread Etienne B. Racine
Thanks Hadley, Is it the solution you would recommend ? rgb(pal.cr((0:40)/40), maxColorValue=255) Etienne hadley wrote: > > Look at the output of pal.cr((0:40)/40) > Hadley > > On Fri, Apr 17, 2009 at 2:42 PM, Etienne B. Racine > wrote: >> >> I try to use Colo

[R] ColorRamp different from ColorRampPalette

2009-04-17 Thread Etienne B. Racine
I try to use ColorRamp as ColorRampPalette (i.e. with the same gradient), but it seems there is a nuance that I've missed. pal.crp<-colorRampPalette( c("blue", "white", "red"), space = "rgb") plot(rep(0,40),pch=16,col=pal.crp(40)) # is great But, using the same gradient with colorRamp is giving

Re: [R] ggplot: problem with fill option in stat_smooth()

2009-02-04 Thread Etienne B. Racine
Maybe you could try to open the pdf in Inkscape http://www.inkscape.org/ and export it as a .emf or .png ? Etienne Ian Fiske wrote: > > Hi all, > > I am using ggplot2 and continuing to find it very useful and pretty. > However, I am trying to create some graphics for publication that would

Re: [R] Create data frame from header only

2008-08-04 Thread Etienne B. Racine
Even if it's not so elegant, I will bind it in a function, so I don't have to bother with that anymore. I think there should be a simple function in R to initialize an empty data frame. From what I've read, it is a recurrent question on that list. #Create an empty data frame from a header list em