Re: [R] Contour - data points not in ascending order?

2010-06-29 Thread Kirkeby
Hi again. I have made an example of my data: x<-c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4) y<-c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) z <- c(12,23,23,42,12,1,1,32,5,45,65,76,32,21,23,43) data <- unique(cbind(x,y,z)) contour(x,y,z, col="red", xlim=c(0,1), ylim=c(0,1), labcex=0.7, cex="12") -which gives an e

[R] Contour - data points not in ascending order?

2010-06-29 Thread Kirkeby
Hello everyone. I have been dealing with this for a while. I have built a spatial prediction model for densities of mosquitoes on a field, based om empirical data. I need to plot the field area with the predicted densities in a heatmap, contour or likewise, and compare it visually with i.e. a loe

Re: [R] Stacked Histogram, multiple lines for dates of news stories?

2010-06-29 Thread Jim Lemon
On 06/29/2010 01:04 AM, Simon Kiss wrote: Dear colleagues, I have extracted the dates of several news stories from a newspaper data base to chart coverage trends of an issue over time. They are in a data frame that looks just like one generated by the reproducible code below. I can already genera

[R] mixed-effects model with two fixed effects: interaction

2010-06-29 Thread Ilona Leyer
Dear all, In a greenhouse experiment we tested performance of 4 different species (B,H,P,R) under 3 different water levels in 10 replications. As response variable e.g. the number of emerging sprouts were measured on three dates. A simple Anova considering every measurement date separately shows

Re: [R] Contour - data points not in ascending order?

2010-06-29 Thread Ted Harding
On 29-Jun-10 08:53:48, Kirkeby wrote: > Hi again. > > I have made an example of my data: > > x<-c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4) > y<-c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) > z <- c(12,23,23,42,12,1,1,32,5,45,65,76,32,21,23,43) > data <- unique(cbind(x,y,z)) > contour(x,y,z, col="red", xlim=c(0,1)

[R] Link to a pdf document

2010-06-29 Thread cgenolin
Hi the list, I would like to put a link in a .Rd file to a PDF document (not a vignette, just a regular PDF). I put my PDF in the folder inst/doc/toto.pdf. In the bible "2.5 Cross-references", I read that \link can point to PDF file, but I did not manage to do it. How shall I do that ? Christoph

[R] generate irregular series of dates

2010-06-29 Thread Simon Kiss
Dear colleagues, particularly academic ones, So I'm creating a Microsoft Word template for myself so that every time I teach a new course, I don't have to enter in the dates manually for each class session. I'd like to use an R script that can generate an irregular series of dates starting f

Re: [R] plotmeans

2010-06-29 Thread cheba meier
Thanks a lot. ?HTH :) Regards, Cheba 2010/6/28 Jannis > Try adding > > par(new=TRUE) > after plotting the first plot and then just plot the second one. You have > to make sure that both use the same y axis but I will leave it to you to > find out how ;-) (I would fix the y limits of both plots

Re: [R] Link to a pdf document

2010-06-29 Thread Duncan Murdoch
cgenolin wrote: Hi the list, I would like to put a link in a .Rd file to a PDF document (not a vignette, just a regular PDF). I put my PDF in the folder inst/doc/toto.pdf. In the bible "2.5 Cross-references", I read that \link can point to PDF file, but I did not manage to do it. How shall I do

[R] gsub issue in R 2.11.1, but not present in 2.9.2

2010-06-29 Thread Jason Rupert
Previously in R 2.9.2 I used the following to convert from an improperly formatted NA string into one that is a bit more consistent. gsub("N\A", "NA", "N\A", fixed=TRUE) This worked in R 2.9.2, but now in R 2.11.1 it doesn't seem to work an throws the following error. Error: '\A' is an unr

Re: [R] Link to a pdf document

2010-06-29 Thread cgenolin
Thanks, Duncan. And where am I suppose to put the file toto.pdf ? In "/myPack/doc/" or in "myPack/inst/doc/" Christophe -- View this message in context: http://r.789695.n4.nabble.com/Link-to-a-pdf-document-tp2271973p2272016.html Sent from the R help mailing list archive at Nabble.com.

[R] table() of a factor

2010-06-29 Thread Robin Hankin
Hi suppose I have a factor 'x': > x <- as.factor(c(rep("a",3),"b","d")) > table(x) x a b d 3 1 1 > > But this is not what I want because I need to include the fact that the count of "c" is zero. I can't just change the levels of x: > levels(x) <- c("a","b","c","d") > table(x) x a b c d 3 1 1

Re: [R] table() of a factor

2010-06-29 Thread Gavin Simpson
On Tue, 2010-06-29 at 11:59 +0100, Robin Hankin wrote: > Hi > > suppose I have a factor 'x': > > > x <- as.factor(c(rep("a",3),"b","d")) > > table(x) > x > a b d > 3 1 1 > > > > > > But this is not what I want because > I need to include the fact that the count of "c" is zero. > > I can't j

Re: [R] table() of a factor

2010-06-29 Thread Allan Engelhardt
You could try x<- factor(c(rep("a",3),"b","d"), levels=letters[1:4]) table(x) # x # a b c d # 3 1 0 1 Hope this helps Allan On 29/06/10 11:59, Robin Hankin wrote: Hi suppose I have a factor 'x': > x <- as.factor(c(rep("a",3),"b","d")) > table(x) x a b d 3 1 1 > > But this is not what I wa

Re: [R] Link to a pdf document

2010-06-29 Thread Duncan Murdoch
On 29/06/2010 6:55 AM, cgenolin wrote: Thanks, Duncan. And where am I suppose to put the file toto.pdf ? In "/myPack/doc/" or in "myPack/inst/doc/" The latter. When your package is installed, it will be installed to myPack/doc. Duncan Murdoch ___

Re: [R] gsub issue in R 2.11.1, but not present in 2.9.2

2010-06-29 Thread Duncan Murdoch
On 29/06/2010 6:47 AM, Jason Rupert wrote: Previously in R 2.9.2 I used the following to convert from an improperly formatted NA string into one that is a bit more consistent. gsub("N\A", "NA", "N\A", fixed=TRUE) This worked in R 2.9.2, but now in R 2.11.1 it doesn't seem to work an throws

Re: [R] Need help for SVM code for microarray classification

2010-06-29 Thread Aadhithya
Following is the error I am getting: Error in svm.default(train, cl) : Need numeric dependent variable for regression. My dataset looks like this in both training and testing: ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL AML AML AML AML AML

Re: [R] gsub issue in R 2.11.1, but not present in 2.9.2

2010-06-29 Thread Uwe Ligges
On 29.06.2010 12:47, Jason Rupert wrote: Previously in R 2.9.2 I used the following to convert from an improperly formatted NA string into one that is a bit more consistent. gsub("N\A", "NA", "N\A", fixed=TRUE) This worked in R 2.9.2, but now in R 2.11.1 it doesn't seem to work an throws t

Re: [R] table() of a factor

2010-06-29 Thread Felix Andrews
Just use factor(), not levels(); you can pass a factor to factor() too. > x <- factor(c(rep("a",3),"b","d"), levels = letters[1:5]) > table(x) x a b c d e 3 1 0 1 0 Cheers, -Felix On 29 June 2010 20:59, Robin Hankin wrote: > Hi > > suppose I have a factor 'x': > >> x <- as.factor(c(rep("a",3),

Re: [R] mixed-effects model with two fixed effects: interaction

2010-06-29 Thread Setlhare Lekgatlhamang
When I replied to this message I just hit the reply button. I am resending it using reply to all, in case it did not go to the list. Dear Ilona, Looking at the estimation results you have, I think your regression equations are correctly specified. Just thinking aloud, I do not think the results a

Re: [R] table() of a factor

2010-06-29 Thread Robin Hankin
thanks everyone. I think the motto should be "always specify the levels of a factor when you create it if you possibly can". best wishes Robin On 06/29/2010 12:39 PM, Felix Andrews wrote: Just use factor(), not levels(); you can pass a factor to factor() too. x<- factor(c(rep("a",3

Re: [R] linear predicted values of the index function in an ordered probit model

2010-06-29 Thread David Winsemius
On Jun 28, 2010, at 10:58 AM, Martin Spindler wrote: Hello, currently I am estimating an ordered probit model with the function polr (MASS package). Is there a simple way to obtain values for the prediction of the index function ($X*\hat{\beta}$)? (E..g. in the GLM function there is th

[R] Fwd: Fast and simple tool for re-sampling of asynchronous time series ?

2010-06-29 Thread bruno Piguet
[I replied to Gabor only, I think i may be interesting to cc the list, for the record.] -- Forwarded message -- From: bruno Piguet Date: 2010/6/29 Subject: Re: [R] Fast and simple tool for re-sampling of asynchronous time series ? To: Gabor Grothendieck 2010/6/25 Gabor Grothend

Re: [R] Performance enhancement for ave

2010-06-29 Thread Matthew Dowle
> dt = data.table(d,key="grp1,grp2") > system.time(ans1 <- dt[ , list(mean(x),mean(y)) , by=list(grp1,grp2)]) user system elapsed 3.890.003.91# your 7.064 is 12.23 for me though, so this 3.9 should be faster for you However, Rprof() shows that 3.9 is mostly dispatch of mea

Re: [R] Performance enhancement for ave

2010-06-29 Thread Hadley Wickham
On Tue, Jun 29, 2010 at 8:02 AM, Matthew Dowle wrote: > >> dt = data.table(d,key="grp1,grp2") >> system.time(ans1 <- dt[ , list(mean(x),mean(y)) , by=list(grp1,grp2)]) >   user  system elapsed >   3.89    0.00    3.91        # your 7.064 is 12.23 for me though, so this > 3.9 should be faster for y

Re: [R] mixed-effects model with two fixed effects: interaction

2010-06-29 Thread Thomas Stewart
IIona- I think you may be misinterpreting the t-test. In model 1, consider the speciesH coefficient. A test that speciesH = 0, essentially asks: Is speciesH the same as speciesB? The test statistic for this hypothesis is the t-value reported in the table. (t-value= -4.2, p-value=0.0001) In mo

[R] Use of processor by R 32bit on a 64bit machine

2010-06-29 Thread Joris Meys
Dear all, I've recently purchased a new 64bit system with an intel i7 quadcore processor. As I understood (maybe wrongly) that to date the 32bit version of R is more stable than the 64bit, I installed the 32bit version and am happily using it ever since. Now I'm running a whole lot of models, whic

Re: [R] Use of processor by R 32bit on a 64bit machine

2010-06-29 Thread Uwe Ligges
On 29.06.2010 15:30, Joris Meys wrote: Dear all, I've recently purchased a new 64bit system with an intel i7 quadcore processor. As I understood (maybe wrongly) that to date the 32bit version of R is more stable than the 64bit, I installed the 32bit version and am happily using it ever since.

Re: [R] mixed-effects model with two fixed effects: interaction

2010-06-29 Thread Bilonick, Richard A
On Tue, 2010-06-29 at 09:09 +, Ilona Leyer wrote: > Dear all, > In a greenhouse experiment we tested performance of 4 different species > (B,H,P,R) under 3 different water levels in 10 replications. As response > variable e.g. the number of emerging sprouts were measured on three dates. A >

Re: [R] Use of processor by R 32bit on a 64bit machine

2010-06-29 Thread Joris Meys
*slaps forehead* Thanks. So out it goes, that hyperthreading. Who invented hyperthreading on a quad-core anyway? Cheers Joris 2010/6/29 Uwe Ligges : > > > On 29.06.2010 15:30, Joris Meys wrote: >> >> Dear all, >> >> I've recently purchased a new 64bit system with an intel i7 quadcore >> processo

Re: [R] Use of processor by R 32bit on a 64bit machine

2010-06-29 Thread Marc Schwartz
I suspect that it was Intel's marketing department, after a few beers at the local bar... ;-) Regards, Marc On Jun 29, 2010, at 9:09 AM, Joris Meys wrote: > *slaps forehead* > Thanks. So out it goes, that hyperthreading. Who invented > hyperthreading on a quad-core anyway? > > > Cheers > Jo

[R] More than two font in a plot

2010-06-29 Thread Jinsong Zhao
Hi there, I am a Chinese R user. I hope to display Chinese character in a plot, and than save it in PostScript format. I have read the article titled "Non-Standard Fonts in PostScript and PDF Graphics", especially the section about CJK fonts. I also tried the code: > pdf("chinese.pdf", width=3, h

[R] Constructing a model with multilevel response variables

2010-06-29 Thread Sam
Dear List I am a little unsure how to structure my model and was after some advice. I am a little unsure if this question is appropriate for this list, if it is not please just delete and accept my apologise. I have 10 factors that are categorical variables and 5 levels of response variables

[R] Constructing a model with multilevel response variables

2010-06-29 Thread Sam
Dear List, I am a little unsure how to structure my model and was after some advice. I am a little unsure if this question is appropriate for this list, if it is not please just delete and accept my apologise. I have 10 factors that are categorical variables and 5 levels of response variables

[R] Help with dates and characters

2010-06-29 Thread Thomas Jensen
Dear R Experts, I have a vector of dates in character format like this: date "2000-01-01" "2000-01-23" "2001-03-12" ... ... ... "2009-12-31" I would like to delete the last part of the character string (i.e. the "day" part), so the vector looks like this: date "2000-01" "2000-01" "2001-03"

Re: [R] Help with dates and characters

2010-06-29 Thread Marc Schwartz
On Jun 29, 2010, at 8:36 AM, Thomas Jensen wrote: > Dear R Experts, > > I have a vector of dates in character format like this: > > date > "2000-01-01" > "2000-01-23" > "2001-03-12" > ... > ... > ... > "2009-12-31" > > I would like to delete the last part of the character string (i.e. the "day"

Re: [R] Help with dates and characters

2010-06-29 Thread Allan Engelhardt
If the vector elements are (still) strings, you could simply try x<- c("2000-01-01", "2000-01-23", "2001-03-12", "2009-12-31") substring(x, 1, 7) # [1] "2000-01" "2000-01" "2001-03" "2009-12" Hope this helps a little. Allan On 29/06/10 14:36, Thomas Jensen wrote: Dear R Experts, I have a

Re: [R] Need help for SVM code for microarray classification

2010-06-29 Thread Steve Lianoglou
Hi, On Tue, Jun 29, 2010 at 7:16 AM, Aadhithya wrote: > > Following is the error I am getting: > Error in svm.default(train, cl) : >  Need numeric dependent variable for regression. Here's a problem that you may not even know you had yet. By the looks of your code, it seems as if you want to do

[R] Sweave, xtable plus/minus sign

2010-06-29 Thread Ottorino-Luca Pantani
Dear R-users, please consider the following minimal example: \documentclass[a4paper,titlepage,onecolumn,12pt]{article} \usepackage[italian]{babel} \usepackage{amssymb} \usepackage[utf8x]{inputenc} \usepackage[pdftex]{graphicx} \begin{document} <>= df.data1 <- cbind.data.frame(A = rnorm(18),

Re: [R] Link to a pdf document

2010-06-29 Thread cgenolin
Thanks > > > > On 29/06/2010 6:55 AM, cgenolin wrote: >> Thanks, Duncan. >> And where am I suppose to put the file toto.pdf ? >> In "/myPack/doc/" or in "myPack/inst/doc/" >> > > > The latter. When your package is installed, it will be installed to > myPack/doc. > > Duncan Murdoch > > ___

Re: [R] Sweave, xtable plus/minus sign

2010-06-29 Thread Marc Schwartz
On Jun 29, 2010, at 10:08 AM, Ottorino-Luca Pantani wrote: > Dear R-users, > please consider the following minimal example: > > \documentclass[a4paper,titlepage,onecolumn,12pt]{article} > \usepackage[italian]{babel} > \usepackage{amssymb} > \usepackage[utf8x]{inputenc} > \usepackage[pdftex]{graph

Re: [R] Help asked for automated generation of ncdf variables

2010-06-29 Thread David Pierce
> Date: Wed, 16 Jun 2010 17:53:56 +0200 > From: "Adolf STIPS" > > Hi, > > I'm using the "ncdf" library for creating ncdf files. > But I need to create about 100 variables per file (e.g. single rivers), > So I do not like to create each variable separately. > > Unfortunately I found no way to make

Re: [R] Sweave, xtable plus/minus sign

2010-06-29 Thread Ottorino-Luca Pantani
On 29/06/2010 17:36, Marc Schwartz wrote: On Jun 29, 2010, at 10:08 AM, Ottorino-Luca Pantani wrote: paste("$\\pm$", 1.34, sep="") [1] "$\\pm$1.34" I believe you then need to tweak the sanitize.text.function argument in print.xtable() to properly handle the backsl

Re: [R] How to allocate more memories to R?

2010-06-29 Thread Bogaso
When I use this I am getting following warning at the time of opening R from that shortcut : "-max-mem-size=2048MB:too large and taken as 2047M" Why I am getting this? I have 3GB ram installed and using within Vista. Thanks -- View this message in context: http://r.789695.n4.nabble.com/How-to

Re: [R] How to allocate more memories to R?

2010-06-29 Thread stephen sefick
I am not entirely sure, but the actual amount of RAM is less than the GB specified by the specs. Are you directing R to a max memory size... If so it is too large. On Tue, Jun 29, 2010 at 11:32 AM, Bogaso wrote: > > When I use this I am getting following warning at the time of opening R from >

[R] Remove observations deemed influential by influential.measure

2010-06-29 Thread GL
dbs is an existing dataframe. I fit a lm and looked at influential observations. I want now to delete the influential observations from dbs, fit another lm, and see how different the results are. What is the syntax to remove the influential observations from dbs? fit <- lm(NI ~ PG + log(TG), data

Re: [R] gsub issue in R 2.11.1, but not present in 2.9.2

2010-06-29 Thread Bert Gunter
Uwe: Did you forget to add the "fixed = TRUE" parameter to your gsub call in your reply? > gsub("N\\A", "NA", "N\\A") [1] "N\\A" > gsub("N\\A","NA","N\\A",fixed=TRUE) [1] "NA" I only mention it because there is already sufficient confusion that the typo may totally bewilder people. -- Bert B

[R] transposing a data frame from horizontal to vertical (stacking)

2010-06-29 Thread Dimitri Liakhovitski
Hello, everyone! I have a very simple task - I have a data frame (see MyData below) and I need to stack the data (see result below). I wrote the syntax below - it's very basic and it does what I need. But I am sure what I am trying to do is a very typical task and there must be a much shorter/more

Re: [R] transposing a data frame from horizontal to vertical (stacking)

2010-06-29 Thread Hadley Wickham
On Tue, Jun 29, 2010 at 12:22 PM, Dimitri Liakhovitski wrote: > Hello, everyone! > I have a very simple task - I have a data frame (see MyData below) and > I need to stack the data (see result below). > I wrote the syntax below - it's very basic and it does what I need. > But I am sure what I am t

Re: [R] Remove observations deemed influential by influential.measure

2010-06-29 Thread David Winsemius
On Jun 29, 2010, at 1:10 PM, GL wrote: dbs is an existing dataframe. I fit a lm and looked at influential observations. I want now to delete the influential observations from dbs, fit another lm, and see how different the results are. What is the syntax to remove the influential observati

[R] how to create a shape file from a polygone

2010-06-29 Thread Bastien Ferland-Raymond
Dear R-users, I have created a map with plot location using longitude/latitude coordinates with the PlotOnStaticMap() function of the RgoogleMaps package. Everything works fine until I try to put a polygon on the map. The polygon() function doesn’t work and I need to use the special function Plo

[R] Reordering the correlation matrix

2010-06-29 Thread A Ezhil
Hi, I have a correlation matrix of 1000 x 1000 genes. I have grouped (20 groups) genes based on function and each gene has a index. I would like to reorder the correlation matrix based on the group index. Could you please suggest me how to do that? Thanks in advance. Kind regards, Ezhil

Re: [R] transposing a data frame from horizontal to vertical (stacking)

2010-06-29 Thread Henrique Dallazuanna
Try this: reshape(MyData, direction = 'long', varying = list(c('jan', 'feb')), idvar = 2:3) On Tue, Jun 29, 2010 at 2:22 PM, Dimitri Liakhovitski < dimitri.liakhovit...@gmail.com> wrote: > Hello, everyone! > I have a very simple task - I have a data frame (see MyData below) and > I need to stack

Re: [R] Remove observations deemed influential by influential.measure

2010-06-29 Thread GL
dbs_influential_obs <- which(apply(fit.influential.observations$is.inf, 1, any)) dbs_sans_influential_obs <- dbs1[-dbs_influential_obs,] -- View this message in context: http://r.789695.n4.nabble.com/Remove-observations-deemed-influential-by-influential-measure-tp2272474p2272524.html Sent from

[R] formating chron date times for printing

2010-06-29 Thread stephen sefick
the date were created with chron with this argument format=c(dates="Y/m/d", times="H:M:S")) so I have the dates being displayed as (10/06/22 12:00:00) I would like to have them displayed as "2010-06-22 12:00:00" or "%Y-%m-%d %H:%M:%S" and then I can convert these for mergeing with another dat

Re: [R] gsub issue in R 2.11.1, but not present in 2.9.2

2010-06-29 Thread Bert Gunter
Jason: I think it's actually even a bit worse than what Duncan said, which was: --- "You need to double the backslashes to enter them in an R string. So gsub("N\\A", "NA", original, fixed=TRUE) should work if original contains a single backslash, and gsub("NA", "NA", original, fix

Re: [R] formating chron date times for printing

2010-06-29 Thread Phil Spector
Stephen - format(as.POSIXct(x),"%Y-%m-%d %H:%M:%S") [1] "2009-08-07 17:00:00" "2009-08-07 17:15:00" "2009-08-07 17:29:59" [4] "2009-08-07 17:45:00" "2009-08-07 18:00:00" - Phil Spector Statistical Computing Facil

Re: [R] formating chron date times for printing

2010-06-29 Thread stephen sefick
Phil, Thank you very much for your swift reply. I have not used POSIXct much, but I do remember having issues with time zones in POSIXx. Should I be aware of this, or is this not a problem. I have set the data recorders to stay one time and one time zone and never change, so that I don't have to

Re: [R] Exponential Smoothing: Forecast package

2010-06-29 Thread Stephan Kolassa
Hi Phani, something like this looks promising: # library(forecast) library(Mcomp) MAPE.for.Holt <- function (x,series,bignum=10e6) { foo <- try(ets(series$x,model="AAN",damped=FALSE,alpha=x[1],beta=x[2],restrict=FALSE),silent=TRUE) if ( class(f

Re: [R] formating chron date times for printing

2010-06-29 Thread Gabor Grothendieck
On Tue, Jun 29, 2010 at 2:01 PM, stephen sefick wrote: > the date were created with chron with this argument > > format=c(dates="Y/m/d", times="H:M:S")) > > so I have the dates being displayed as > > (10/06/22 12:00:00) > > I would like to have them displayed as > > "2010-06-22 12:00:00" or "%Y-%m

[R] how to distinguish bi-mode distribution from mono-mode distribution

2010-06-29 Thread Changbin Du
HI, Dear community, How to distinguish bi-mode distribution from mono-mode distribution? I have only the histograms of 3500 data set. Thanks! -- Sincerely, Changbin -- [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] formating chron date times for printing

2010-06-29 Thread Gabor Grothendieck
On Tue, Jun 29, 2010 at 2:22 PM, Gabor Grothendieck wrote: > On Tue, Jun 29, 2010 at 2:01 PM, stephen sefick wrote: >> the date were created with chron with this argument >> >> format=c(dates="Y/m/d", times="H:M:S")) >> >> so I have the dates being displayed as >> >> (10/06/22 12:00:00) >> >> I w

Re: [R] formating chron date times for printing

2010-06-29 Thread stephen sefick
Thank you both! If I don't want to deal with a Time Zone potentailly converting some of the dates, which would be your suggestions. Or, are they all the same way to skin a cat. Again thank you for your wonderful help. kindest regards, Stephen Sefick On Tue, Jun 29, 2010 at 1:39 PM, Gabor Grot

[R] Conditionally constructing columns in a data frame

2010-06-29 Thread Stuart Luppescu
Hello, I have to construct 5 new columns in a data frame depending on the value of another of the columns in the data frame. The only way I could figure out to do this was to subset the data frame five times, do the variable construction, and then rbind the subsets back together. Here's part of the

Re: [R] gsub issue in R 2.11.1, but not present in 2.9.2

2010-06-29 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Bert Gunter > Sent: Tuesday, June 29, 2010 11:08 AM > To: 'Jason Rupert'; 'Duncan Murdoch' > Cc: r-help@r-project.org > Subject: Re: [R] gsub issue in R 2.11.1, but not present in

Re: [R] formating chron date times for printing

2010-06-29 Thread Gabor Grothendieck
The time zone independent solution, i.e. paste(as.Date(x), format(x - floor(x))), is the safer although format(as.POSIXlt(x, tz = "GMT")) seems to work too. On Tue, Jun 29, 2010 at 2:44 PM, stephen sefick wrote: > Thank you both!  If I don't want to deal with a Time Zone potentailly > converting

Re: [R] Conditionally constructing columns in a data frame

2010-06-29 Thread Erik Iverson
I'm sure there's an easier way, but it's going to be easiest to get a useful response if we have a reproducible, minimal example, as the posting guide requests. ?tapply is probably involved. Stuart Luppescu wrote: Hello, I have to construct 5 new columns in a data frame depending on the value

Re: [R] formating chron date times for printing

2010-06-29 Thread Gabor Grothendieck
Also the paste solution can be abbreviated to just: paste(as.Date(x), x - floor(x)) On Tue, Jun 29, 2010 at 2:57 PM, Gabor Grothendieck wrote: > The time zone independent solution, i.e.  paste(as.Date(x), format(x - > floor(x))), > is the safer although format(as.POSIXlt(x, tz = "GMT")) seems

Re: [R] generate irregular series of dates

2010-06-29 Thread Greg Snow
A fairly simple way is to generate one series with all the Tuesdays, then another with all the Thursdays, combine and sort. > sort( c( seq.Date( as.Date('2010-6-29'), by='week', length.out=10), + seq.Date( as.Date('2010-7-1'), by='week', length.out=10) ) + ) [1] "2010-06-29" "2010-07-01" "2010-

Re: [R] How to draw multi group plot?

2010-06-29 Thread Greg Snow
It is hard to know exactly what you want without a description of your data or what you want the final plot to look like. But you can do the equivalent of plot followed by multiple calls to points by using a loop, apply functions, the lattice package or the ggplots2 package (I'm guessing the la

[R] merging/intersecting 2 data frames

2010-06-29 Thread Erin Hodgess
Dear R People: I have two data frames, a.df and b.df as seen here: > a.df[1:10,] DATE GENDER PATIENT_ID AGE SYNDROME 1 4/16/2009 F 23686 45 RASH ON BODY 2 4/16/2009 F 13840 35 CANT URINATE 3 4/16/2009 M 12895 30 BLURRED

Re: [R] Conditionally constructing columns in a data frame

2010-06-29 Thread Stuart Luppescu
On Tue, 2010-06-29 at 13:59 -0500, Erik Iverson wrote: > I'm sure there's an easier way, but it's going to be easiest to get a > useful response if we have a reproducible, minimal example, as the > posting guide requests. ?tapply is probably involved. A minimal example of data? How about this:

Re: [R] generate irregular series of dates

2010-06-29 Thread Gabor Grothendieck
On Tue, Jun 29, 2010 at 6:22 AM, Simon Kiss wrote: > Dear colleagues, particularly academic ones, > So I'm creating a Microsoft Word template for myself so that every time I > teach a new course, I don't have to enter in the dates manually for each > class session. > I'd like to use an R script th

Re: [R] Conditionally constructing columns in a data frame

2010-06-29 Thread David Winsemius
On Jun 29, 2010, at 2:54 PM, Stuart Luppescu wrote: Hello, I have to construct 5 new columns in a data frame depending on the value of another of the columns in the data frame. The only way I could figure out to do this was to subset the data frame five times, do the variable construction, a

Re: [R] transposing a data frame from horizontal to vertical (stacking)

2010-06-29 Thread Dimitri Liakhovitski
Thank you very much for a reference to "reshape". I found that melt(MyData) - and then resorting - gives me exactly what I want! Dimitri On Tue, Jun 29, 2010 at 1:46 PM, Henrique Dallazuanna wrote: > Try this: > > reshape(MyData, direction = 'long', varying = list(c('jan', 'feb')), idvar = > 2:3

Re: [R] gsub issue in R 2.11.1, but not present in 2.9.2

2010-06-29 Thread Uwe Ligges
On 29.06.2010 19:19, Bert Gunter wrote: Uwe: Did you forget to add the "fixed = TRUE" parameter to your gsub call in your reply? Yes, thanks. Uwe gsub("N\\A", "NA", "N\\A") [1] "N\\A" gsub("N\\A","NA","N\\A",fixed=TRUE) [1] "NA" I only mention it because there is already sufficie

Re: [R] merging/intersecting 2 data frames

2010-06-29 Thread Weidong Gu
Erin, ?merge Try c.df=merge(a.df,b.df,by.x="PATIENT_ID",by.y="ID") hope it helps Weidong __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html a

Re: [R] Need help for SVM code for microarray classification

2010-06-29 Thread Aadhithya
Hello Steve Thanks for quick responses its really helping me out .Ya I made the necessary changes you had mentioned. I was not sure of that 'type' argument where u had told me to set it to SVM . Do you mean I have to give that argument in this line "cl <- c(c(rep("ALL",10), rep("AML",10)));" a

[R] How to delete the replicate rows by summing up the numeric columns

2010-06-29 Thread Yi
Hi, folks, I am sorry that I did not state the problem correctly yesterday. Please let me address the problem by the following codes: first=c('u','b','e','k','j','c','u','f','c','e') second=c('usa','Brazil','England','Korea','Japan','China','usa','France','China','England') third=1:10 data=data.

Re: [R] Need help for SVM code for microarray classification

2010-06-29 Thread Aadhithya
Hi Steve I had done one more thing I had taken the transpose of both my test and train files as given below: model<- svm(t(train),cl); pred <- predict(model,t(test)); And the result I had got is : Result: pred ALL AML ALL 10 0 AML 0 10 why is there a difference in th

Re: [R] installing multicore package

2010-06-29 Thread Patrick Connolly
On Fri, 25-Jun-2010 at 10:09AM +0530, suman dhara wrote: |> Sir, |> I want to apply mclapply() function for my analysis. So, I have to install |> multicore package. But I can not install the package. |> |> >install.packages("multicore") |> It gives that package multicore is not available. |> |>

Re: [R] merging/intersecting 2 data frames

2010-06-29 Thread jim holtman
use 'merge' > a.df DATE GENDER PATIENT_ID AGE SYNDROME 1 4/16/2009 F 23686 45 RASH ON BODY 2 4/16/2009 F 13840 35 CANT URINATE 3 4/16/2009 M 12895 30 BLURRED VISION 4 4/16/2009 M 18375 33 UNABLE TO VOID

Re: [R] merging/intersecting 2 data frames

2010-06-29 Thread Greg Snow
Use the merge function, look at the by.x and by.y arguments, also look at the all.x and all.y arguments as well as the suffixes argument. You may need to delete some columns after the merge (or replace missing values in one column with those in the same location from the next column, see the if

[R] RPostgreSQL - Unable to locate required modules/DLLs on WinXP/7

2010-06-29 Thread João Gonçalves
Dear list users, The problem occurs when library(RPostgreSQL) is issued on R. This issue has previously appeared on R mailing list without any robust solution. The error message issued by R: Loading required package: RPostgreSQL Loading required package: DBI Error in inDL(x, as.logical(local)

Re: [R] RPostgreSQL - Unable to locate required modules/DLLs on WinXP/7

2010-06-29 Thread Joe Conway
On 06/29/2010 03:35 PM, João Gonçalves wrote: > Error: package 'RPostgreSQL' could not be loaded > exists which makes RPostgreSQL loading to fail. The message appears for > any of the following DLLs (that actually exist on > X:/PostgreSQL_installation_directory/bin): > To "solve" this problem the

Re: [R] RPostgreSQL - Unable to locate required modules/DLLs on WinXP/7

2010-06-29 Thread Dirk Eddelbuettel
On Tue, Jun 29, 2010 at 11:35:44PM +0100, João Gonçalves wrote: > Dear list users, > > The problem occurs when library(RPostgreSQL) is issued on R. This issue > has previously appeared on R mailing list without any robust solution. > The error message issued by R: > > Loading required package:

[R] process of stepwise selection

2010-06-29 Thread elaine kuo
Dear list, I wanna select the significant variables relative to bird distribution, using stepwise method. However, the result is always the best-fit model. Please kindly suggest if it is possible to show the selection process. Thank you Elaine [[alternative HTML version deleted]] _

Re: [R] More than two font in a plot

2010-06-29 Thread Paul Murrell
Hi On 6/30/2010 2:17 AM, Jinsong Zhao wrote: Hi there, I am a Chinese R user. I hope to display Chinese character in a plot, and than save it in PostScript format. I have read the article titled "Non-Standard Fonts in PostScript and PDF Graphics", especially the section about CJK fonts. I also

Re: [R] RPostgreSQL - Unable to locate required modules/DLLs on WinXP/7

2010-06-29 Thread João Gonçalves
Thank you for the fast replies. I've set the PATH env var to include the PostgreSQL bin diectory and it's working fine. On 29-06-2010 23:44, Joe Conway wrote: On 06/29/2010 03:35 PM, João Gonçalves wrote: Error: package 'RPostgreSQL' could not be loaded exists which makes RPost

[R] Multiline and grouping in R

2010-06-29 Thread Pablo Cerdeira
Hi All, this is my first mail here. I'm trying to plot a multiline chart grouping values with no success. I have read a lot in the official Wiki and also searched via Google, but I did not find anything. I'm importing some data from a cvs file. Here is a sample: YEAR,AREA,CASES 1988,CONTRACTS,2

Re: [R] Multiline and grouping in R

2010-06-29 Thread David Winsemius
On Jun 29, 2010, at 8:42 PM, Pablo Cerdeira wrote: Hi All, this is my first mail here. I'm trying to plot a multiline chart grouping values with no success. I have read a lot in the official Wiki and also searched via Google, but I did not find anything. I'm importing some data from a c

Re: [R] Multiline and grouping in R

2010-06-29 Thread Erik Iverson
Pablo Cerdeira wrote: Hi All, this is my first mail here. I'm trying to plot a multiline chart grouping values with no success. I have read a lot in the official Wiki and also searched via Google, but I did not find anything. I know how to do it in Excel, using a Pivot Table. But I'm trying

Re: [R] Multiline and grouping in R

2010-06-29 Thread Bill.Venables
> require(lattice) Loading required package: lattice > xyplot(CASES ~ YEAR | AREA, data = t, type = "b") > xyplot(CASES ~ YEAR, data = t, type = "b", groups = AREA) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Pablo Cerdeira S

Re: [R] Need help for SVM code for microarray classification

2010-06-29 Thread Steve Lianoglou
> Hello Steve >   Thanks for quick responses its really helping me out .Ya I made the > necessary changes you had mentioned. I was not sure of that 'type' argument > where u had told me to set it to SVM . Do you mean I have to give that > argument in this line "cl <- c(c(rep("ALL",10), rep("AML",10

Re: [R] How to delete the replicate rows by summing up the numeric columns

2010-06-29 Thread Dennis Murphy
Hi: If you can deal with alphabetic order, the following seems to work: v <- aggregate(third ~ first, data = data, FUN = sum) v$second <- levels(data$second) v[, c(1, 3, 2)] first second third 1 b Brazil 2 2 c China15 3 e England13 4 f France 8 5 j Jap

[R] using zoo() to coerce time series to a different reference frame

2010-06-29 Thread Jonathan Greenberg
Folks: I have two sets of dates, and one set of data: *** require("chron") require("zoo") reference_dates=seq.dates("01/01/92", "12/31/92", by = "months") data_dates=seq.dates("01/15/91", "12/15/93", by = "months") data=1:length(data_dates) reference_zoo=zoo(order.by=reference_dates) data_zoo=z

Re: [R] Stacking several vectors from the list

2010-06-29 Thread Arsenio Starodoumov
Monday, June 28, 2010, 4:40:11 PM, you wrote: > On Mon, Jun 28, 2010 at 7:30 PM, wrote: >> Hi everybody, >> >> I'm working on the very >> messy data, I have tried to clean it up in SAS and >> SAS/IML but there is not enough info on how to handle certain things >> in SAS so I have turned to R. Th

Re: [R] How to delete the replicate rows by summing up the numeric columns

2010-06-29 Thread David Winsemius
On Jun 29, 2010, at 3:05 PM, Yi wrote: Hi, folks, I am sorry that I did not state the problem correctly yesterday. Please let me address the problem by the following codes: first=c('u','b','e','k','j','c','u','f','c','e') second = c ('usa ','Brazil ','England','Korea','Japan','China','usa','

Re: [R] Need help for SVM code for microarray classification

2010-06-29 Thread Aadhithya
Hello Steve    Thanks for quick responses its really helping me out .Ya I made the necessary changes you had mentioned. I was not sure of that 'type' argument where u had told me to set it to SVM . Do you mean I have to give that argument in this line "cl <- c(c(rep("ALL",10), rep("AML",10)));" a

Re: [R] How to delete the replicate rows by summing up the numeric columns

2010-06-29 Thread Nikhil Kaza
require(reshape) cast(data, first+second~ ., sum) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Jun 29, 2010, at 3:05 PM, Yi wrote: first=c('u','b','e','k','j','c','u','f','c','e') second = c ('usa ','Brazil ','England','Korea',

  1   2   >