[R] problem with making multiple plots (geom_pointrange) in a loop (ggplot2)

2010-05-15 Thread michael westphal
Hello: I am using R 2.10.1 I am trying to make multiple scatter plots with ggplot2, using a for loop to select only certain entries in a dataframe. Here is my code: for(i in 1:length(ganges_subbasin[,1] )){ subbasin_select <- as.character(ganges_subbasin[i, 2]) #print(subbasin_sele

[R] two level fraction factorial design: How to input 'defining relation'?

2010-05-15 Thread Mikrofoon
I am trying to find the important factors from a two level fraction factorial design (2^{8-4}) I have studied the companion of vikneswaran but would really like a basic example of how to do this: (adapted to 8 factors): mydata<-read.table("myfile.txt", header=T) summary(aov(resp ~ A*B*C*D*E*F

Re: [R] web mining

2010-05-15 Thread Dennis Murphy
To find the available CRAN packages, go to http://cran.r-project.org/web/packages/index.html AFAIK, there are a couple of text mining packages (tm, tau), a web scraping package (scrapeR) and several others from the Omegahat project (e.g., RCurl, SSOAP, XML). There are undoubtedly others which I ha

Re: [R] Java API to pass commands to R console from Java Program

2010-05-15 Thread Cedrick W. Johnson
You could take a look at RServe on r-forge, perhaps that's what you're looking for? -c On 5/14/2010 4:03 PM, NewRUser wrote: Hi all, I am a new user of R and we have to integrate R into Java. I have downloaded and installed R and rJava/JRI and set up the environment. I was able to run the r

Re: [R] Barchart reorder

2010-05-15 Thread Kang Min
It works! Thanks! On May 15, 10:46 pm, Gabor Grothendieck wrote: > Reorder it based on the negative of abundance to reverse it: > reorder(table$species, - table$abundance) > > > > On Sat, May 15, 2010 at 6:40 AM, Kang Min wrote: > > Hi fellow R users, > > > I have a dataset that looks something

[R] web mining

2010-05-15 Thread Sebastian Kruk
hi r-help list users I wonder if there is a web mining package? Thanks, Sebastián. __ 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 and provi

Re: [R] A primitive OO in R -- where next?

2010-05-15 Thread Muenchen, Robert A (Bob)
Hi All, This was a very interesting question & I enjoyed reading everyone's responses. I've played around with it and summarized some of the variations below. Cheers, Bob # A fun example of how a list can store both a function # and data for that function. # Create a list that contains both a

Re: [R] SAS for R-users

2010-05-15 Thread Muenchen, Robert A (Bob)
> Thomas Levine wrote: >Bob Muenchen says that 'Ralph O’Brien says that >in a few years there will be so many students >graduating knowing mainly R that [he]’ll need to >write, “SAS for R Users.” That’ll be the day!' Heh! I quite agree. I've had a few people write me saying they had used my book

Re: [R] barplot: invalid 'xlim' value

2010-05-15 Thread David Winsemius
On May 15, 2010, at 2:12 PM, emorway wrote: Josh, Thanks for looking into this further. Picking up on your hint I tried to coerce the xlim values as well: barplot(coldat,horiz=TRUE,axes=FALSE,xlim=c(as.numeric(strptime(well. 80.2$date[1],"%m/%d/%Y %H:%M")),as.numeric(strptime(well.80.2$

Re: [R] debugging substitute function in R 2.11

2010-05-15 Thread Peter Ehlers
substitute() does not have an argument 'list'; it does have 'env'. Replace this line: list = list (member = as.name (member), with env = list (member = as.name (member), -Peter Ehlers On 2010-05-14 3:09, Gil Tomás wrote: Dear list, A while ago I found in the web a

Re: [R] barplot: invalid 'xlim' value

2010-05-15 Thread Joshua Wiley
Eric, I was thinking about it more and if you have all the data in your example read in, look at this: plot(ttime.80.2,well.80.2$Reading,type="l",col="blue",lwd=2) par("usr") barplot(coldat,horiz=TRUE,axes=FALSE,col=8,space=0) par("usr") barplot(coldat,horiz=TRUE,axes=FALSE,y

Re: [R] Dataframe to word, using R2wd

2010-05-15 Thread Tal Galili
Hi Felipe, I don't think it is possible at this time (if anyone knows otherwise - please correct me). I am informing Christian (the R2wd developer) about your feature suggestion, he might be interested in it. Cheers, Tal Contact Details:-

[R] Dataframe to word, using R2wd

2010-05-15 Thread Felipe Carrillo
Hi: Just adding on to this question...Is it a way to add footnotes to tables with R2wd? I started using this nice package about a month ago and is one of the things that I can't figure out yet..   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Servic

[R] Dataframe to word, using R2wd

2010-05-15 Thread Felipe Carrillo
  Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: Tal Galili > To: Jeremy Miles > Cc: r-help@r-project.org > Sent: Sat, May 15, 2010 1:03:12 AM > Subject: Re: [R] Dataframe to word, usin

Re: [R] Dataframe to word, using R2wd

2010-05-15 Thread Felipe Carrillo
Hi: Just adding on to this question...Is it a way to add footnotes to tables with R2wd? I started using this nice package about a month ago and is one of the things that I can't figure out yet..   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Servic

Re: [R] barplot: invalid 'xlim' value

2010-05-15 Thread emorway
Josh, Thanks for looking into this further. Picking up on your hint I tried to coerce the xlim values as well: barplot(coldat,horiz=TRUE,axes=FALSE,xlim=c(as.numeric(strptime(well.80.2$date[1],"%m/%d/%Y %H:%M")),as.numeric(strptime(well.80.2$date[length(well.80.2$date)],"%m/%d/%Y %H:%M"))),yli

Re: [R] Discretize factors?

2010-05-15 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Noah Silverman > Sent: Saturday, May 15, 2010 11:03 AM > To: r-help@r-project.org > Subject: [R] Discretize factors? > > Hi, > > I'm looking for an easy way to discretize facto

Re: [R] Discretize factors?

2010-05-15 Thread Thomas Stewart
Maybe this? group <- factor(c("A", "B","B","C","C","C")) model.matrix(~0+group) -tgs On Sat, May 15, 2010 at 2:02 PM, Noah Silverman wrote: > Hi, > > I'm looking for an easy way to discretize factors in R > > I've noticed that the lm function does this automatically with a nice > result. > > If

Re: [R] barplot: invalid 'xlim' value

2010-05-15 Thread Joshua Wiley
Okay, after I got your data in, your issue seems to be with barplots call to plot.window. In particular, plot.window requires xlim and ylim to be numeric vectors (see ?plot.window). In your data > str(xlim) POSIXlt[1:2], format: "2000-06-12 02:00:00" "2000-07-17 01:00:00" Perhaps someone more fa

Re: [R] Normalizing plot tick values

2010-05-15 Thread rajesh j
Wonderful. Thanks On Sat, May 15, 2010 at 10:47 PM, Henrique Dallazuanna wrote: > Try this: > > x <- 1:100 > plot(x, xaxt = 'n') > axis(1, axTicks(1), pretty(x) / 10) > > On Sat, May 15, 2010 at 2:10 PM, rajesh j wrote: > >> Hi, >> >> I have a plot whole tick values along the axis have a certain

[R] Discretize factors?

2010-05-15 Thread Noah Silverman
Hi, I'm looking for an easy way to discretize factors in R I've noticed that the lm function does this automatically with a nice result. If I have group <- c("A", "B","B","C","C","C") and run: lm(result ~ x1 + group) The lm function has split the group into separate binary variables {0,1} be

Re: [R] barplot: invalid 'xlim' value

2010-05-15 Thread emorway
Josh, I wonder if you try pulling the data from the post directly it will work better for you: http://r.789695.n4.nabble.com/barplot-invalid-xlim-value-td2217919.html#a2217919 As for your response to the other code I was asking about...that code works perfectly well as it is written, so there i

Re: [R] barplot: invalid 'xlim' value

2010-05-15 Thread Joshua Wiley
Hello, It could be my email client (gmail), but I had an error when trying to paste your data in. Anyway to answer part of your question > # Draw the histograms >for (i in 1:length(ages)){ >par(new = TRUE) >xmin <- -ages[i] + xlim[1] I think your problem

Re: [R] Normalizing plot tick values

2010-05-15 Thread Henrique Dallazuanna
Try this: x <- 1:100 plot(x, xaxt = 'n') axis(1, axTicks(1), pretty(x) / 10) On Sat, May 15, 2010 at 2:10 PM, rajesh j wrote: > Hi, > > I have a plot whole tick values along the axis have a certain range 0 - x . > I need to normalize this range without changing my data files. for e.g., > if my

Re: [R] Attempt to customise the "plotpc()" function

2010-05-15 Thread Nikos Alexandris
On Saturday 15 of May 2010 19:09:30 Nikos Alexandris wrote: > Among the (R-)tools, I've seen on the net, for (bivariate) Principal > Component scatter plots (+histograms), "plotpc" [1] is the one I like > most. [...] [1] _

[R] Normalizing plot tick values

2010-05-15 Thread rajesh j
Hi, I have a plot whole tick values along the axis have a certain range 0 - x . I need to normalize this range without changing my data files. for e.g., if my plot has tick values at 10,20,30,40,50... i have to make this 2,4,6, etc. but without changing the plot data... I am hoping I can add somet

[R] Attempt to customise the "plotpc()" function

2010-05-15 Thread Nikos Alexandris
Dear R-list, Among the (R-)tools, I've seen on the net, for (bivariate) Principal Component scatter plots (+histograms), "plotpc" [1] is the one I like most. By default it performs PCA on a bivariate dataset based on R's "princomp()" (which is the eigenvector-based algebraic solution to PCA). I

[R] barplot: invalid 'xlim' value

2010-05-15 Thread emorway
Forum, I am attempting to plot weekly horizontal histograms, something very similar to: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=109 The part of the code used to create this graphic that interest me: # Draw the histograms for (i in 1:length(ages)){ p

Re: [R] Barchart reorder

2010-05-15 Thread Gabor Grothendieck
Reorder it based on the negative of abundance to reverse it: reorder(table$species, - table$abundance) On Sat, May 15, 2010 at 6:40 AM, Kang Min wrote: > Hi fellow R users, > > I have a dataset that looks something like this. > > species class   abundance > K       1       592 > K       2       2

Re: [R] abline limit constrain x-range how?

2010-05-15 Thread David Winsemius
On May 15, 2010, at 10:03 AM, Giovanni Azua wrote: Hello, I managed to "linearize" my LDA decision boundaries now I would like to call abline three times but be able to specify the exact x range. I was reading the doc but it doesn't seem to support this use-case? are there alternatives.

[R] abline limit constrain x-range how?

2010-05-15 Thread Giovanni Azua
Hello, I managed to "linearize" my LDA decision boundaries now I would like to call abline three times but be able to specify the exact x range. I was reading the doc but it doesn't seem to support this use-case? are there alternatives. The reason why I use abline is because I first call plot t

Re: [R] help color coding map in R

2010-05-15 Thread Felix Andrews
The 'groups' argument should be a factor, which explicitly defines the ordering of its levels. Otherwise it is converted to a factor using the default ordering which is alphabetical. You can make a factor ordered by occurence as, eg., factor(z, levels = unique(z)). Or use reorder(). Note that data

Re: [R] conditional calculations per row (loop versus apply)

2010-05-15 Thread jim holtman
try this: Reading <- ifesle (Type.code%in%Table.A, function 1, ifelse (Type.code%in%tTable.B, function 2, ifelse (Type.code%in%Table.C, function 3,NA))) On Sat, May 15, 2010 at 5:21 AM, Nick Bond wrote: > Hi all, > I'm hoping someone might help with a query about condition

[R] plot for linear discriminant

2010-05-15 Thread Giovanni Azua
Hello, I have a labelled dataset with three classes. I have computed manually the LDA hyperplane that separate the classes from each other i.e. \hat{\delta}_j(x)=x^Tb_j + c_j where b_j \in \mathbb{R}^p and c_j \in \mathbb{R} my concrete b_j looks like e.g. b_j <- rbind(1,2) c_j <- 3 How can I

Re: [R] plot formula 'x' is missing?

2010-05-15 Thread Gabor Grothendieck
There are several problems: - as mentioned by Duncan, the code calls plot but specifies plot.formula argument names -- it must specify the x argument of plot. (You also have an x defined in your data frame but that is a different x -- replacing your x with X everywhere still gives a message about

Re: [R] plot formula 'x' is missing?

2010-05-15 Thread Duncan Murdoch
On 15/05/2010 1:22 AM, Giovanni Azua wrote: Hi Jorge and Dennis, Thank you for the hint! However, I'm still very intrigued as to why it does not work using plot ... what is special about this specific formula that plot doesn't like it? There's nothing special about the formula. plot()

[R] Barchart reorder

2010-05-15 Thread Kang Min
Hi fellow R users, I have a dataset that looks something like this. species class abundance K 1 592 K 2 288 G 1 254 G 2 239 C 2 173 D 2 123 E 3 89 F 2 87 B 2 86 H 2 82 I

Re: [R] Simple question on binning data

2010-05-15 Thread Bernardo Rangel Tura
On Thu, 2010-05-13 at 17:31 -0400, Carl Witthoft wrote: > It's very simple to write a "binit()" function. If all you want to do > is e.g., bin 107 values into sums of 10 at a time, then write a loop > that sums x[10*i:11*i-1] (not tested and not syntactically correct). > > The one I wrote for

Re: [R] multhist,labels and percentages

2010-05-15 Thread Jim Lemon
On 05/15/2010 12:19 AM, Federico Calboli wrote: Hi All, I am in the annoying position of having to present some data to someone who seems to be somewhat less than numerate. I need to label the y-axes of a multhist with the y-axis labeled not as counts but as percentage of a population. Plotti

[R] conditional calculations per row (loop versus apply)

2010-05-15 Thread Nick Bond
Hi all, I'm hoping someone might help with a query about conditionally applying formulas to a dataframe. In essence I have 3 lookup tables (Table A, B & C) and a dataframe with a variable Type.Code, which identifies the Lookup Table to which each record belongs. The lookup tables reference diff

Re: [R] Dataframe to word, using R2wd

2010-05-15 Thread Tal Galili
Hi Jeremy, 1) This is not the command to use on data.frames, it is: wdTable 2) There is a slightly newer version of R2wd, that (for now) can only be downloaded here: http://www.r-statistics.com/2010/05/exporting-r-output-to-ms-word-with-r2wd-an-example-session/ (That posts also offers a step by st

Re: [R] operations between two aggregated data frames?

2010-05-15 Thread Jonathan
Thanks Gabor, The method works perfectly for my needs! Phil, Thanks for the tip about set.seed() and for the code. I really like the simplicity of using mapply, and your example is very close to accomplishing what I was looking for, but it breaks down under one type of situation. In part

[R] Help with using plotmeans - how do I have two or more sets of data on one plot?

2010-05-15 Thread FishLover
Hello I'm having trouble being able to plot more than one set of data using the plotmeans function. Plotmeans is where you can plot means and standard errors easily. Here is part of my code plotmeans(Mmeans ~ Month, data=BW.hydat.05HG001, n.label=FALSE)#one set of data par(new=TRUE) plotmeans

[R] How to read in an SVM model from file?

2010-05-15 Thread Yingjie Lin
Hi colleagues, I am using the R-e1071 package. I know that write.svm() can be used to write the svm model to file. But is there any function in e1071 that can read in the svm model from these files? Thanks a lot! Yingjie __ R-help@r-project.org maili

[R] Java API to pass commands to R console from Java Program

2010-05-15 Thread NewRUser
Hi all, I am a new user of R and we have to integrate R into Java. I have downloaded and installed R and rJava/JRI and set up the environment. I was able to run the rTest java programs successfully. I have to automate the process involving R. I have the following question regarding it. Instead

Re: [R] Revolution R and the R Community?

2010-05-15 Thread Louis Bajuk-Yorgan
> I hope that other R based companies, like: > > - S-PLUS > > Would have acted more in a similar way. > (And if they do, I didn't know about it and would like to have been more > informed) Tal One clarification--S-PLUS is not based on R. However, it does sh