Re: [R] evaluate a string variable

2010-06-29 Thread Bill.Venables
You need to parse it before you evaluate it. eval(parse(text = avar)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jeremiah H. Savage Sent: Wednesday, 30 June 2010 3:45 PM To: r-help@r-project.org Subject: [R] evaluate a string

[R] evaluate a string variable

2010-06-29 Thread Jeremiah H. Savage
Hello, I was wondering how to evaluate a string variable in R. eg. > avar <- "getwd()" > eval(avar) gives: [1] "getwd()" but I would like to see: [1] "/home/myhomedir" Thanks, Jeremiah __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

Re: [R] Logistic regression with multiple imputation

2010-06-29 Thread Simon Blomberg
mitools is useful too, and I can vouch for mice. mice is easy to use, and easy to write new imputation methods too. So it is also very flexible. Simon. On 30/06/10 15:31, Jeremy Miles wrote: Hi Daniel First, newer versions of SPSS have dramatically improved their ability to do stuff with miss

Re: [R] Logistic regression with multiple imputation

2010-06-29 Thread Jeremy Miles
Hi Daniel First, newer versions of SPSS have dramatically improved their ability to do stuff with missing data - I believe it's an additional module, and in SPSS-world, each additional module = $$$. Analyzing missing data is a 3 step process. First, you impute, creating multiple datasets, then y

[R] Logistic regression with multiple imputation

2010-06-29 Thread Daniel Chen
Hi, I am a long time SPSS user but new to R, so please bear with me if my questions seem to be too basic for you guys. I am trying to figure out how to analyze survey data using logistic regression with multiple imputation. I have a survey data of about 200,000 cases and I am trying to predict t

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

2010-06-29 Thread Gabor Grothendieck
On Tue, Jun 29, 2010 at 5:58 PM, Jonathan Greenberg wrote: > 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") > da

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

2010-06-29 Thread Achim Zeileis
On Tue, 29 Jun 2010, Jonathan Greenberg wrote: 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) refe

Re: [R] seq.dates in reverse?

2010-06-29 Thread Marc Schwartz
On Jun 29, 2010, at 7:17 PM, Jonathan Greenberg wrote: > Pardon the barrage of time series related questions, but another issue > I'm trying to solve is how to determine a sequence of dates a la > seq.dates() except going BACKWARDS in time, e.g. if seq.dates() > allowed for the "to" variables to b

[R] Interpretation of gam intercept parameter

2010-06-29 Thread Lidia Dobria
Dear All: I apologize for asking such an elementary question, but I could not find an adequate response on line. I am hoping to receive some help with the interpretation of the Intercept coefficient in the gam model below. I1 through I3 are dummy coded "Item difficulty" parameters in a data s

Re: [R] Multiline and grouping in R

2010-06-29 Thread Pablo Cerdeira
Owo! Many thanks to you all. A lot of answers in just a few minutes!! I'd like to thank you Dennis, Joshua, David, Erik and Bill. I'll try these solutions and read something about xyplot. Best regards to you. On Tue, Jun 29, 2010 at 10:54 PM, Dennis Murphy wrote: > Hi: > > This is to add a co

Re: [R] How to delete rows based on replicate values in one column with some extra calcuation

2010-06-29 Thread Nikhil Kaza
You can do this in reshape package as mentioned earlier. However, if you need a solution with aggregate here it is a <- with(data, aggregate(cbind(v1,v2), by=list(x,y,z),sum)) names (a) <- c("x","y","z","v1","v2") Nikhil Kaza Asst. Professor, City and Regional Planning University of North Caro

Re: [R] Multiline and grouping in R

2010-06-29 Thread Dennis Murphy
Hi: This is to add a couple of bells and whistles to the excellent replies of David and Bill. You may not want the 0.5 increments in the x-axis ticks, and if you want all groups in a single plot, then you may want a legend. Below are some basic ways to specify these (to head off the obvious follow

[R] seq.dates in reverse?

2010-06-29 Thread Jonathan Greenberg
Pardon the barrage of time series related questions, but another issue I'm trying to solve is how to determine a sequence of dates a la seq.dates() except going BACKWARDS in time, e.g. if seq.dates() allowed for the "to" variables to be set alone, rather than the from=. Ultimately, I'd like to hav

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

2010-06-29 Thread Yi
Thank you very much for response. Finally I took David's way. Others' work well for this specific case. But I find problem is there are more than one column of character variables. z=c('ab','ah','bc','ah','dv') x=substr(z,start=1,stop=1) y=substr(z,start=2,stop=2) v1=5:9 v2=7:11 data=data.frame(x,

Re: [R] How to delete rows based on replicate values in one column with some extra calcuation

2010-06-29 Thread Yi
Great help. It works when the first and the second columns are ordered the same way. But aggregate does not work for the following case: z=c('ab','ah','bc','ah','dv') x=substr(z,start=1,stop=1) y=substr(z,start=2,stop=2) v1=5:9 v2=7:11 data=data.frame(x,y,z,v1,v2) > data x y z v1 v2 1 a b ab 5

Re: [R] Multiline and grouping in R

2010-06-29 Thread Joshua Wiley
Hello, There are many ways to do what you want in R. I am showing one way using one of my favorite graphics packages, ggplot2. If you do not have it installed yet, uncomment the first line. #install.packages("ggplot2") library(ggplot2) #load the package #Read in data samp.dat <- structure(list

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',

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 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] 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

[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] 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

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] 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] 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 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

[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] 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

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

[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] 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:

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

[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] 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

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] 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] 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] 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] 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] 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] 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] 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] 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 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:

[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] 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

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] 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] 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
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] 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

[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] 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

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

[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: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

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 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] 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] 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

[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] 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

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

[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

[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

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

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

[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] 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] 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] 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 >

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] 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] 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 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] 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 > > ___

[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] 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

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] 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"

[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"

[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] 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

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

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] 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 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.

[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] 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

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] 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

[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] 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

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] 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 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] 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] 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

  1   2   >