Re: [R] textbox in lattice

2010-06-01 Thread Deepayan Sarkar
On Wed, Jun 2, 2010 at 12:37 AM, baptiste auguie wrote: > Please do read the posting guide, in particular regarding reproducible > examples. > > You can use a Grid layout to place the lattice plot and a table in the > same page. For example, > > library(lattice) >  library(coda) >  library(gridEx

Re: [R] mean calculation within dataframe corrupted

2010-06-01 Thread Joshua Wiley
Hello, I was hunting for something else and came across your old message, and I noticed that it had never received an answer (at least on the list). I really tried to figure out what might be going on just by looking at your code, but I could not get enough information from your email and your co

Re: [R] Faster union of polygons?

2010-06-01 Thread baptiste auguie
Hi, I think you could use a concave hull from the alphahull package, http://yihui.name/en/2010/04/alphahull-an-r-package-for-alpha-convex-hull/ It may be difficult to find the right parameters if the polygons differ widely in edge lengths, though. HTH, baptiste On 2 June 2010 03:53, Remko Du

[R] code for power and suffix for x,y labels in plot( ).

2010-06-01 Thread Shant Ch
Hi I was trying to have a graph whose axes are X axis: m, Y axis: var[X ((a,b) in suffix, and (n,d) in the power)]. X ((a,b) in suffix, and (n,d) in the power)-X^(n,d) _ (a,b). Actually I require many plots involving different values of a,b,n,d, so need to keep this complicated notat

Re: [R] how to make monthly time series out of daily

2010-06-01 Thread Jeffrey Ryan
library(xts) to.monthly(x) The code is all Fortran, and is very fast. It should work just fine on most all time-series-like objects/classes, including timeSeries. Documentation in the vignette will help, as will ?to.period A wealth of functions to manipulate/test/transform time-series data is

Re: [R] Help - C Compiler

2010-06-01 Thread Matt Shotwell
Take a look at the R Installation and Administration manual , under the section with header "The standalone Rmath library". Matt Shotwell Graduate Student Division of Biostatistics and Epidemiology Medical University of South Carolina On Tue, 2

Re: [R] how to label the som notes by the majority vote

2010-06-01 Thread Changbin Du
library("kohonen") data(nir) attach(nir) #SOM, the supervised learning, train the map using temperature as the class variable. set.seed(13) nir.xyf<- xyf(data=spectra, Y=classvec2classmat(temperature), xweight = 0.9, grid=somgrid(4, 4, "hexagonal")) temp.xyf <- predict(nir.xyf)$unit.prediction #

Re: [R] Reading file

2010-06-01 Thread David Winsemius
On Jun 1, 2010, at 3:19 PM, Robert Tsutakawa wrote: I am trying to read a source program into a mac pro laptop, which uses Snow Leopard. R is unable to find the file containing my source program. I'm using the function source(" file name"). I need some examples or detailed instructions

[R] Help - C Compiler

2010-06-01 Thread Ali Makhmali
Dear Group Members, First of all thanks for all the great work and effort. I am trying to compile a part of the Project R, 'pnorm.c' in visual studio 6.0 c++ language. First i downloaded the standalone R-2.11.0 and tried to compile it. Some files were missing here such as 'Rconfig.h'. Then i do

Re: [R] How to get a list of subdirectories in the wd?

2010-06-01 Thread Henrique Dallazuanna
Try this: dir()[file.info(dir())$isdir] On Tue, Jun 1, 2010 at 11:06 PM, Nevil Amos wrote: > How do I get a list of subdirectories only, not files, in a directory > > > dir.create("test") > setwd("test") > dir.create("adir") > dir.create("bdir") > file.create("afile") > dir() > > returns [1] "

[R] How to get a list of subdirectories in the wd?

2010-06-01 Thread Nevil Amos
How do I get a list of subdirectories only, not files, in a directory dir.create("test") setwd("test") dir.create("adir") dir.create("bdir") file.create("afile") dir() returns [1] "adir" "afile" "bdir" in need to return [1] "adir" "bdir" cheers Nevil Amos _

[R] Faster union of polygons?

2010-06-01 Thread Remko Duursma
Dear R-helpers, thanks for yesterday's speeding-up tip. Here is my next query: I have lots of polygons (not necessarily convex ones, and they never have holes) given by x,y coordinates. I want to get the polygon that is the union of these polygons. This is my current method, but I am hoping ther

Re: [R] MacOS X binary for lme4 not available on CRAN

2010-06-01 Thread Ben Madin
Armin, On Tue, 1 Jun 2010, Armin Goralczyk wrote: > I have noticed that the MacOS X binary for lme4 is not available on > CRAN at the moment. I am aware that it may be possible to install from > source but I am not very familiar with that procedure and would rather > avoid it. But I need the pack

Re: [R] Fancy Page layout

2010-06-01 Thread Dejian Zhao
I think you can use grid.layout() to create the appropriate layout, allocating proper space for the upper plotting area and the bottom text region, and then use viewport() with the layout parameter to control the output by pushing the viewport at the proper region on the graphical device.

Re: [R] how to label the som notes by the majority vote

2010-06-01 Thread Joris Meys
Dear Changbin, Please provide a self-contained, minimal example, meaning the whole code should run and create the plot as it is now, without having to load your dataset (which we don't have). Otherwise it's impossible to see what's going on and help you. Cheers Joris On Wed, Jun 2, 2010 at 2:21

Re: [R] regexpr help (match.length=0)

2010-06-01 Thread Joris Meys
Dear all, It sounds as if regexp works according to the same rules as Perl, very nicely explained in: http://blob.perl.org/books/beginning-perl/3145_Chap05.pdf Yet, I couldn't help but wonder if there are also differences in behaviour. I couldn't find any yet, but there must be some. Anybody care

Re: [R] loop

2010-06-01 Thread jim holtman
try this: > x <- readLines(textConnection("V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 + TP53 Dis1 Dis2 Dis3 Dis4 Dis5 Dis6 + DCI New1 New2 New3 New4 + FDI Hi2 H3 H4 + GHD I1 I3 I4 I5 I6 I7 I8"))[-1] # drop the first line > output <- do.call(rbind, lapply(x, function(.line){ + # split the data + parms

Re: [R] R on the iPhone/iPad? Not so much....a GPL violation

2010-06-01 Thread Marc Schwartz
Ken, See comments inline. On Jun 1, 2010, at 2:25 PM, Ken Williams wrote: > Hi Marc, > > I want to debate a couple points from your post: > >> 1. Distribution of GPL covered applications is not permissible via the App > >> Store due to the Apple Terms of Service language, which infringes upon

Re: [R] regexpr help (match.length=0)

2010-06-01 Thread Matt Shotwell
On Tue, 2010-06-01 at 16:43 -0400, Erik Iverson wrote: > > McGehee, Robert wrote: > > R-help, > > Sorry if this is more of a regex question than an R question. However, > > help would be appreciated on my use of the regexpr function. > > > > In the first example below, I ask for all characters (a

Re: [R] Problem using apply

2010-06-01 Thread Sarah Goslee
As far as I can tell, your code works perfectly. It's just that the mean of your rows is the same as the mean of your columns because the matrix is symmetric. Compare these two examples (the first one is yours): > m = matrix( c(1,4,7,4,5,8,7,8,9), nrow = 3 ) > m [,1] [,2] [,3] [1,]14

Re: [R] how to make monthly time series out of daily

2010-06-01 Thread Jannis
I am not sure about specific timeseries objects, but using an ordinary vector with the values the aggregate() function works fine: monthly.means <- aggregate(timeseries, mean, by=months) months now only has to be a vector of length(timeseries) with numbers relating each entry in timeseries to

Re: [R] lapply with functions with changing parameters

2010-06-01 Thread Erik Iverson
Bunny, lautloscrew.com wrote: Dear all, I am trying to avoid a for loop here and wonder if the following is possible: I have a data.frame with 6 columns and i want to get a cross-correlogram (by using ccf) . Obivously ccf only accepts two columns at once and then returms a list. In fact, with

Re: [R] lapply with functions with changing parameters

2010-06-01 Thread Henrique Dallazuanna
Try this: lapply(mydf[-6], ccf, y = mydf[6]) On Tue, Jun 1, 2010 at 5:50 PM, Bunny, lautloscrew.com < bu...@lautloscrew.com> wrote: > Dear all, > > I am trying to avoid a for loop here and wonder if the following is > possible: > > I have a data.frame with 6 columns and i want to get a cross-co

Re: [R] Using R with Web services

2010-06-01 Thread Charles C. Berry
On Tue, 1 Jun 2010, marcos carvajalino wrote: Hello list helpers, I'm working at a research institute and I've been asked to develop a way of using R as a scripting and analysis tool which takes information from users via web forms, perform a query to an Oracle Database running on a Linux serve

Re: [R] problem with intToChar

2010-06-01 Thread Changbin Du
Thanks to all! Yes, LETTERS[outcome.predict] works! I appreciated your guys help! On Tue, Jun 1, 2010 at 1:53 PM, Henrique Dallazuanna wrote: > use "[" not "(" > > > On Tue, Jun 1, 2010 at 5:50 PM, Changbin Du wrote: > >> It does not work. >> >> >> > outcome.label<-LETTERS(outcome.predict

Re: [R] problem with intToChar

2010-06-01 Thread Changbin Du
the intToChar function is in the package "R.oo" I AM try to plot the SOM result, use the outcome.labels as labels in the following plot command. outcome.xyf <- predict(final.xyf)$unit.prediction outcome.predict<- as.numeric(classmat2classvec(outcome.xyf)) ?outcome.label<-intToChar(as.integer

Re: [R] Reading file

2010-06-01 Thread Stephan Kolassa
Have you set the correct working directory? ?setwd ?getwd HTH Stephan Robert Tsutakawa schrieb: I am trying to read a source program into a mac pro laptop, which uses Snow Leopard. R is unable to find the file containing my source program. I'm using the function source(" file name"). I n

Re: [R] problem with intToChar

2010-06-01 Thread Erik Iverson
Changbin Du wrote: Hi, Dear R- community, I am use the intToChar function to convert the integers to letters. But the output is mess. Can you guys give some suggestions? Thanks! I suggest you tell us what you were expecting to happen, that is, what do you actually want? It looks like it

Re: [R] problem with intToChar

2010-06-01 Thread Henrique Dallazuanna
use "[" not "(" On Tue, Jun 1, 2010 at 5:50 PM, Changbin Du wrote: > It does not work. > > > > outcome.label<-LETTERS(outcome.predict) > Error: could not find function "LETTERS" > > > > > On Tue, Jun 1, 2010 at 1:48 PM, Henrique Dallazuanna wrote: > >> Try this: >> >> LETTERS[outcome.predict] >>

[R] lapply with functions with changing parameters

2010-06-01 Thread Bunny, lautloscrew.com
Dear all, I am trying to avoid a for loop here and wonder if the following is possible: I have a data.frame with 6 columns and i want to get a cross-correlogram (by using ccf) . Obivously ccf only accepts two columns at once and then returms a list. In fact, with a for loop i´d do the follow

Re: [R] problem with intToChar

2010-06-01 Thread Erik Iverson
Changbin Du wrote: It does not work. outcome.label<-LETTERS(outcome.predict) Error: could not find function "LETTERS" That is not when Henrique typed. LETTERS is a vector, and must be indexed as such, i.e., with "[]". __ R-help@r-project.org

Re: [R] problem with intToChar

2010-06-01 Thread Sarah Goslee
That isn't really enough information to answer your question, since you don't tell us where intToChar comes from or what you are trying to do, but here are a couple of possibilities: > ?intToChar No documentation for 'intToChar' in specified packages and libraries: you could try '??intToChar' > te

Re: [R] problem with intToChar

2010-06-01 Thread Changbin Du
It does not work. > outcome.label<-LETTERS(outcome.predict) Error: could not find function "LETTERS" On Tue, Jun 1, 2010 at 1:48 PM, Henrique Dallazuanna wrote: > Try this: > > LETTERS[outcome.predict] > > On Tue, Jun 1, 2010 at 5:43 PM, Changbin Du wrote: > >> Hi, Dear R- community, >> >> I

Re: [R] Using R with Web services

2010-06-01 Thread Tal Galili
I refer to several resources on the subject here: http://www.r-statistics.com/category/r-and-the-web/ But the first I would suggest you to look at is this: http://www.r-statistics.com/2010/02/web-development-with-r-an-hd-video-tutorial-of-jeroen-ooms-talk/ It won't answer all of yor questions but

Re: [R] Using R with Web services

2010-06-01 Thread Ista Zahn
Hi Marcos, If your server is running Apache I highly recommend looking at RApache (see http://biostat.mc.vanderbilt.edu/rapache/). This will not help with the database connection part though. Best, Ista On Tuesday 01 June 2010 3:05:27 pm marcos carvajalino wrote: > Hello list helpers, > > I'm w

Re: [R] problem with intToChar

2010-06-01 Thread Henrique Dallazuanna
Try this: LETTERS[outcome.predict] On Tue, Jun 1, 2010 at 5:43 PM, Changbin Du wrote: > Hi, Dear R- community, > > I am use the intToChar function to convert the integers to letters. But the > output is mess. Can you guys give some suggestions? Thanks! > > > outcome.predict > [1] 4 4 4 4

[R] problem with intToChar

2010-06-01 Thread Changbin Du
Hi, Dear R- community, I am use the intToChar function to convert the integers to letters. But the output is mess. Can you guys give some suggestions? Thanks! > outcome.predict [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 7 4 4 4 4 4 4 4 4 [26] 4 4 4 4 4 4 4 4 4 4 4

Re: [R] When normality test violate and sample size is large(n=400) can I use t-test

2010-06-01 Thread Robert A LaBudde
At 11:45 AM 6/1/2010, Kourosh Ks wrote: Dears When normality test violate and sample size is large(n=400) can I use t-test? best gards kourosh Generally "yes", unless there is something really pathological about the distribution. You should note that, for n = 400, even the simplest dist

Re: [R] regexpr help (match.length=0)

2010-06-01 Thread Erik Iverson
McGehee, Robert wrote: R-help, Sorry if this is more of a regex question than an R question. However, help would be appreciated on my use of the regexpr function. In the first example below, I ask for all characters (a-z) in 'abc123'; regexpr returns a 3-character match beginning at the first

[R] Reading file

2010-06-01 Thread Robert Tsutakawa
I am trying to read a source program into a mac pro laptop, which uses Snow Leopard. R is unable to find the file containing my source program. I'm using the function source(" file name"). I need some examples or detailed instructions. I have no problem reading the file using PC. Bob

[R] regexpr help (match.length=0)

2010-06-01 Thread McGehee, Robert
R-help, Sorry if this is more of a regex question than an R question. However, help would be appreciated on my use of the regexpr function. In the first example below, I ask for all characters (a-z) in 'abc123'; regexpr returns a 3-character match beginning at the first character. > regexpr("[[:

[R] Using R with Web services

2010-06-01 Thread marcos carvajalino
Hello list helpers, I'm working at a research institute and I've been asked to develop a way of using R as a scripting and analysis tool which takes information from users via web forms, perform a query to an Oracle Database running on a Linux server and finally return formatted reports to the use

[R] When normality test violate and sample size is large(n=400) can I use t-test

2010-06-01 Thread Kourosh Ks
Dears  When normality test  violate and sample size is large(n=400) can I use t-test? best gards kourosh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do rea

Re: [R] Problem using apply

2010-06-01 Thread Joachim de Lezardiere
Thank you Henrique, I still don’t understand why my code doesn’t work ? According to the definition of apply function it should work no ? From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Tuesday, June 01, 2010 7:34 PM To: Joachim de Lezardiere Cc: r-help@r-project.org Subject:

Re: [R] data frame manipulation with zero rows

2010-06-01 Thread arnaud Gaboury
Maybe not the cleanest way, but I create a fake data frame with one row so ddply() is happy!! > if (nrow(futures)==0) futures<-data.frame(...) > -Original Message- > From: Peter Ehlers [mailto:ehl...@ucalgary.ca] > Sent: Tuesday, June 01, 2010 12:07 PM > To: arnaud Gaboury > Cc: 'P

[R] studentized residues from nls()

2010-06-01 Thread array chip
Hi, I am wondering if there is a way to extract studentized residues from a nls() object? I searched archive, someone posted a similar question before (http://tolstoy.newcastle.edu.au/R/e6/help/09/04/10845.html), but didn't get an answer. Thanks for any suggestions, John _

Re: [R] R on the iPhone/iPad? Not so much....a GPL violation

2010-06-01 Thread Ken Williams
Hi Marc, I want to debate a couple points from your post: > 1. Distribution of GPL covered applications is not permissible via the App > Store due to the Apple Terms of Service language, which infringes upon rights > granted under the GPL. > > 'Nuff said. I'm not sure I agree with this, but the

Re: [R] textbox in lattice

2010-06-01 Thread Erik Iverson
Noah Silverman wrote: That's amazing. (It would have taken me many hours to figure this out on my own.) Two quick last questions and then I'm off to plotting: 1) How can I reduce the font size of the table. (It is huge on my plot.) 2) How can I control the ratio of "plot area" to "table area"

Re: [R] textbox in lattice

2010-06-01 Thread baptiste auguie
On 1 June 2010 21:12, Noah Silverman wrote: > That's amazing.  (It would have taken me many hours to figure this out > on my own.) > > Two quick last questions and then I'm off to plotting: > 1) How can I reduce the font size of the table. (It is huge on my plot.) try this, grid.table(head(iris)

Re: [R] textbox in lattice

2010-06-01 Thread Noah Silverman
That's amazing. (It would have taken me many hours to figure this out on my own.) Two quick last questions and then I'm off to plotting: 1) How can I reduce the font size of the table. (It is huge on my plot.) 2) How can I control the ratio of "plot area" to "table area" in the grid? Thanks a mi

Re: [R] textbox in lattice

2010-06-01 Thread baptiste auguie
Please do read the posting guide, in particular regarding reproducible examples. You can use a Grid layout to place the lattice plot and a table in the same page. For example, library(lattice) library(coda) library(gridExtra) x <- matrix(runif(2200),ncol=22) m <- as.mcmc(x) p = xyplot(m

Re: [R] textbox in lattice

2010-06-01 Thread Noah Silverman
Hi, It is a matrix. Exactly the output of summary(foo) Would you call the gridExtra command before the xyplot command or after? Now I have: temp <- as.mcmc(foo) xyplot(temp, layout=c(2,11), main="plot title") THANKS!! On 6/1/10 11:35 AM, baptiste auguie wrote: > Hi, > > It's not clear what

Re: [R] textbox in lattice

2010-06-01 Thread baptiste auguie
Hi, It's not clear what you mean by summary text without a minimal reproducible example. If your text is ordered as a matrix or a data.frame, you might want to try this grid function, gridExtra::grid.table(as.matrix(summary(iris)), theme=theme.white()) If your text has the form of a paragraph, t

Re: [R] Plot multiple columns

2010-06-01 Thread Noah Silverman
Another thought I had was to use Sweave. I could, in theory, use Sweave to create a plot only 7 inches high, and then a summary table 4 inches high below it, all on the same page of a Latex document. Could be messy, but might work. On 6/1/10 11:18 AM, Dennis Murphy wrote: > > > On Tue, Jun 1,

Re: [R] Plot multiple columns

2010-06-01 Thread Noah Silverman
You are correct, I initially missed the "as.mcmc" step. Without it, R doesn't want to squeeze so many plots onto a page. Thanks! On 6/1/10 10:48 AM, Dennis Murphy wrote: > Hi: > > Ben's example worked for me as follows: > > x <- matrix(runif(22000),ncol=22) > library(lattice) > library(coda) >

Re: [R] Plot multiple columns

2010-06-01 Thread Dennis Murphy
Hi: Ben's example worked for me as follows: x <- matrix(runif(22000),ncol=22) library(lattice) library(coda) m <- as.mcmc(x) xyplot(m, layout = c(2, 11)) layout = uses columns first, then rows...I always forget that :) It also has an optional third argument for pages, which might come in handy

Re: [R] Problem using apply

2010-06-01 Thread Peter Langfelder
Well, your example matrix is symmetric, so row and column operations naturally return the same values. You may want to note though that if you apply your function to a matrix along rows, the results will be stored in the __columns__ of the resulting matrix. Thus, if you want to simply divide the r

[R] textbox in lattice

2010-06-01 Thread Noah Silverman
Hi, I want to add a box at the bottom of a lattice window (device/page?). Lattice has drawn a nice group of panels with all the plots I need. How do I add my own summary text at the bottom (several lines worth?) __ R-help@r-project.org mailing list ht

Re: [R] Problem using apply

2010-06-01 Thread Henrique Dallazuanna
The mean by col and by row are the same: colMeans(m) == rowMeans(m) So: m / rowMeans(m) # You don't need apply here m / colMeans(m) On Tue, Jun 1, 2010 at 2:26 PM, Joachim de Lezardiere < joachim.lez...@gmail.com> wrote: > Hello , > > > > I can not get apply function to do what I want when doi

[R] Problem using apply

2010-06-01 Thread Joachim de Lezardiere
Hello , I can not get apply function to do what I want when doing stuff on rows. Let's say I want to divide the rows of matrix by their mean, the below show you get the same result weather you use 1 or 2, i.e. same result for columns than for means..:( Thanks a lot for the help,

Re: [R] R-help "spam" detection; please help the moderators

2010-06-01 Thread Ted Harding
Hi Joris, The "matched a filter rule" is the principal reason for holding messages for moderation. Please don't become anxious about the situation -- one of the reasons we have become concerned about the situation is that people whose messages get held up do tend to become worried about it. This is

Re: [R] Question about the license of an R package

2010-06-01 Thread Mauricio Zambrano
2010/6/1 Duncan Murdoch : > Mauricio Zambrano wrote: >> >> Dear R-users, >> >> I'm developing a package that heavily depends on another package >> released under the GPL-2 license. >> > > Are you including code from that package in yours, or just making use of it? >  The former requires that you fo

Re: [R] Fancy Page layout

2010-06-01 Thread Noah Silverman
Thanks Jim, That helps. Ben Bolker had a nice suggestion on how to get the lattice package to easily plot all 22 variables in one window. Ultimately, I'd like to generate a PDF that will print on a standard (8.5 x 11) page. A few things I'm still stuck are: 1) How to use the lattice command

Re: [R] BreastCancer Dataset for Classification in kknn

2010-06-01 Thread Joris Meys
Hi Nitin, It can be solved by splitting your data a bit different. You need more training data than you have evaluation data, eg : i1 = 1:400 i2=401:d Then it works on my computer. No clue as to where the error originates from though. Cheers Joris On Tue, Jun 1, 2010 at 4:27 PM, Nitin wrote:

Re: [R] library installation problem, invalid regular expression in help indices

2010-06-01 Thread Uwe Ligges
I guess something strange is loaded or changed in your personal startup scripts (i.e. through your Renviron or Rprofile settings. Uwe Ligges On 27.05.2010 15:34, Rainer Machne wrote: Hi, I have a strange package installation problem after update to R 2.11.0 on Fedora Core 12. A colleague

Re: [R] Set resolution of embedded plots in pdf() or CairoPDF()

2010-06-01 Thread Uwe Ligges
Both pdf() and CairoPDF() produce vector graphics, hence there is no things such as resolution required here. Uwe Ligges On 27.05.2010 11:09, Will Eagle wrote: Dear all, how can I set the resolution of embedded plots in PDF using pdf() or CairoPDF() to a value of e.g. 600 dpi to meet journal

Re: [R] Plot multiple columns

2010-06-01 Thread Noah Silverman
Hi, I used the term "run", as each iteration of the Gibbs sampler produces 22 variables (coefficients for Beta in a regression model) The example wont work On 6/1/10 5:54 AM, Ben Bolker wrote: > Noah Silverman smartmediacorp.com> writes: > > >> I'm running a long MCMC chain that is generat

Re: [R] Ignoring initial rows in a text file import

2010-06-01 Thread Uwe Ligges
On 01.06.2010 02:19, David Winsemius wrote: On May 31, 2010, at 8:14 PM, jim holtman wrote: try this: input <- readLines("yourfile.txt") # determine start start <- grep("\tBegin Main\t", input)[1] # first line if many Puzzled. I thought backslashes in grepping patterns needed to be double

Re: [R] discriminant analysis

2010-06-01 Thread Uwe Ligges
Which kind of discriminant analysis? If you mean LDA, use lda() in package MASS and read the correpsonding book "Modern Applied Statistics with S" by Venables and Ripley published by Springer. Uwe Ligges On 01.06.2010 09:24, suman dhara wrote: Sir, Can you suggest some function for discrim

Re: [R] Help barplots

2010-06-01 Thread khush ........
Dear All, Thank you very much for your kind help and support I got it. Jeet On Tue, Jun 1, 2010 at 5:32 PM, Jim Lemon wrote: > On 06/01/2010 09:01 PM, khush wrote: > >> Dear All, >> >> I am newbie to R, and I wanted to plot a barplots with R and in such a way >> that It will also sho

Re: [R] Help on aggregate method

2010-06-01 Thread Stella Pachidi
Dear Erik, Thank you very much. Indeed ave did the same job amazingly fast! I did not know the function before. Many thanks to all R experts who answer to this mailing list, it's amazing how much help you offer to the newbies :) Kind regards, Stella On Tue, Jun 1, 2010 at 6:11 PM, Erik Iverson

Re: [R] any doc to understand arima state space model?

2010-06-01 Thread Joris Meys
Type in Google Arima R Read the first hit, the third, the fifth, and any other that says "tutorial" Cheers Joris On Tue, Jun 1, 2010 at 4:14 PM, shakira M wrote: > I am trying to understand R arima function. Any pointers would be > appreciated. > > Thank you, > Shakira. > >[[alternati

Re: [R] Help on aggregate method

2010-06-01 Thread Erik Iverson
Stella Pachidi wrote: Dear Erik and R experts, Thank you for the fast response! I include an example with the ChickWeight dataset: ap.dat <- ChickWeight matchMeanEx <- function(ind,dataTable,aggrTable) { index <- which((aggrTable[,1]==dataTable[["Diet"]][ind]) & (aggrTable[,2]==dataTabl

Re: [R] as.date

2010-06-01 Thread arnaud Gaboury
TY for the tip. The lower case is in fact the culprit. > -Original Message- > From: Erik Iverson [mailto:er...@ccbr.umn.edu] > Sent: Tuesday, June 01, 2010 6:05 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] as.date > > > > Where does the problem comes from?? M

Re: [R] Issue with assigning text to matrix

2010-06-01 Thread Joris Meys
Hi Jessica, this tells me that your text is saved as a factor. Try : names <- read.csv(file="Names.csv",stringsAsFactors=F) Cheers Joris On Tue, Jun 1, 2010 at 11:04 AM, Jessica Queree wrote: > My issue relates to adding text to a matrix and finding that the text is > converted to a number. >

Re: [R] as.date

2010-06-01 Thread Joris Meys
Change this line to : >pose$CREATED.DATE=as.Date(pose$CREATED.DATE,"%d/%m/%Y") # mind the capital Y >pose DESCRIPTION CREATED.DATE QUANITY CLOSING.PRICE 1 COTTON NO.2 Jul/10 2010-05-13 1 81.2000 2 COTTON NO.2 Jul/10 2010-05-13 1 81.2000 3 PALLADIUM Jun/10 2010-05-

Re: [R] as.date

2010-06-01 Thread Joshua Wiley
Hello, The lowercase 'y' is year without century. This should work for you: as.Date(x=df$CREATED.DATE, format="%d/%m/%Y") HTH, Josh On Tue, Jun 1, 2010 at 8:57 AM, arnaud Gaboury wrote: > Dear group, > > Here is my df (obtained with a read.csv2()): > > > df <- > structure(list(DESCRIPTION =

Re: [R] as.date

2010-06-01 Thread Erik Iverson
Where does the problem comes from?? Maybe from my sytem date ?? Simply from not reading the options carefully enough, from ?strptime, ‘%y’ Year without century (00-99). If you use this on input, which century you get is system-specific. So don't! Most often values 0

Re: [R] using the design matrix to correctly configure contrasts

2010-06-01 Thread RICHARD M. HEIBERGER
Please look at the maiz example, the last example in ?MMC in the HH package. Follow the example all the way to the end. It illustrates a problem and then the resolution of the problem. install.packages("HH") ## if you don't have it yet. library(HH) ?MMC Rich [[alternative HTML version

[R] as.date

2010-06-01 Thread arnaud Gaboury
Dear group, Here is my df (obtained with a read.csv2()): df <- structure(list(DESCRIPTION = c("COTTON NO.2 Jul/10", "COTTON NO.2 Jul/10", "PALLADIUM Jun/10", "PALLADIUM Jun/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 Jul/10"), CREATED.DATE = c("13/05/2010", "13/05/2010", "14/05/2010", "14/05/2010

Re: [R] R-help "spam" detection; please help the moderators

2010-06-01 Thread Joris Meys
Hi all, I also couldn't help but notice that some of my messages are bounced for following reason: The message headers matched a filter rule I included the header of one of the messages below, but neither of these messages is sent trough Nabble, nor does any mail address has digits in it. I a

Re: [R] Question about the license of an R package

2010-06-01 Thread Duncan Murdoch
Mauricio Zambrano wrote: Dear R-users, I'm developing a package that heavily depends on another package released under the GPL-2 license. Are you including code from that package in yours, or just making use of it? The former requires that you follow all the GPL rules about your own. If

Re: [R] storing output data from a loop that has varying row numbers

2010-06-01 Thread Ivan Calandra
Hi Ross, I think Joris answered your question, but to keep with your own code: To set up a list, you can use: DIST_LOOP <- list() Or, if you know the length: DIST_LOOP <- vector(mode="list", length=11) You would then fill up with (in your for loop): DIST_LOOP[[i]] <- SEL_HR ##Actually, what you

Re: [R] Help on aggregate method

2010-06-01 Thread Stella Pachidi
Dear Erik and R experts, Thank you for the fast response! I include an example with the ChickWeight dataset: ap.dat <- ChickWeight matchMeanEx <- function(ind,dataTable,aggrTable) { index <- which((aggrTable[,1]==dataTable[["Diet"]][ind]) & (aggrTable[,2]==dataTable[["Chick"]][ind])) as.n

Re: [R] How to make R automatic?

2010-06-01 Thread Nikhil Kaza
?difftime ?file.info file.info(filename)$mtime Sys.sleep(20) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Jun 1, 2010, at 10:07 AM, zhangted001 wrote: Hello, I have a question about how R can run automatically. Here is th

Re: [R] storing output data from a loop that has varying row numbers

2010-06-01 Thread Joris Meys
OK, then I was right. It's exactly what my code does. Enjoy. Cheers On Tue, Jun 1, 2010 at 4:25 PM, RCulloch wrote: > > Hi Joris, > > Thanks for your help! > > The data as requested: > > structure(list(FROM = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

Re: [R] How to make R automatic?

2010-06-01 Thread Peter Ehlers
On 2010-06-01 8:07, zhangted001 wrote: Hello, I have a question about how R can run automatically. Here is the story: A file called "data.csv" will be generated every couple of minutes in a folder (overwrite itself). What I want R to do is: 1) scan the folder to find the file. 2) if the file

Re: [R] How to make R automatic?

2010-06-01 Thread Charles C. Berry
?Sys.sleep On Tue, 1 Jun 2010, zhangted001 wrote: Hello, I have a question about how R can run automatically. Here is the story: A file called "data.csv" will be generated every couple of minutes in a folder (overwrite itself). What I want R to do is: 1) scan the folder to find the file.

Re: [R] Help on aggregate method

2010-06-01 Thread Joris Meys
Take a look at ?split (and unsplit) eg: Dur <- rnorm(100) Attr1=rep(c("A","B"),each=50) Attr2=rep(c("A","B"),times=50) ap.dat <-data.frame(Attr1,Attr2,Dur) split.fact <- paste(ap.dat$Attr1,ap.dat$Attr2) ap.list <-split(ap.dat,split.fact) ap.mean <-lapply(ap.list,function(x){ x$meanDur=re

[R] using the design matrix to correctly configure contrasts

2010-06-01 Thread Karl Brand
Esteemed R-forum subscribers, I'm having a tough time configuring contrasts for my 3-way ANOVA. In short: I don't know how to configure (all) my contrasts correctly in order to specify (all) my comparisons of interest. I succeeded getting my contrasts of interest set up for a simpler 2-way A

[R] How to make R automatic?

2010-06-01 Thread zhangted001
Hello, I have a question about how R can run automatically. Here is the story: A file called "data.csv" will be generated every couple of minutes in a folder (overwrite itself). What I want R to do is: 1) scan the folder to find the file. 2) if the file is a newly generated file, process the fi

Re: [R] storing output data from a loop that has varying row numbers

2010-06-01 Thread RCulloch
Hi Ivan, Thanks again for your help! I'll just go through your questions... I'm still really confused about your question. -Sorry!!! Let me ask you some specific questions (maybe someone more experienced would understand at once, but I'm no expert; I hope I can still help you! In any case, I w

Re: [R] storing output data from a loop that has varying row numbers

2010-06-01 Thread RCulloch
Hi Joris, Thanks for your help! The data as requested: structure(list(FROM = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), TO = c(1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2

Re: [R] Issue with assigning text to matrix

2010-06-01 Thread Peter Ehlers
Jessica, Two further comments: 1. When you read your data, your character vectors are stored as factors; is that what you want? 2. You may be better off using a list. -Peter Ehlers On 2010-06-01 7:47, Sarah Goslee wrote: On Tue, Jun 1, 2010 at 5:04 AM, Jessica Queree wrote: My issue re

[R] BreastCancer Dataset for Classification in kknn

2010-06-01 Thread Nitin
Dear All, I'm getting a error while trying to apply the BreastCancer dataset (package=mlbench) to kknn (package=kknn) that I don't understand as I'm new to R. The codes are as follow: rm = (list = ls()) library(mlbench) data(BreastCancer) library(kknn) BCancer = na.omit(BreastCancer) d = di

[R] Question about the license of an R package

2010-06-01 Thread Mauricio Zambrano
Dear R-users, I'm developing a package that heavily depends on another package released under the GPL-2 license. In addition, some few functions depends on other packages released under the following licences (as described in the corresponding pages of http://cran.r-project.org/web/packages/): G

Re: [R] data frame manipulation with zero rows

2010-06-01 Thread arnaud Gaboury
It is indeed ddply() from package plyr. > -Original Message- > From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] > Sent: Tuesday, June 01, 2010 12:24 PM > To: Peter Ehlers > Cc: arnaud Gaboury; r-help@r-project.org > Subject: Re: [R] data frame manipulation with zero rows > > On

Re: [R] Help on aggregate method

2010-06-01 Thread Erik Iverson
It's easiest for us to help if you give us a reproducible example. We don't have your datasets (ap.dat), so we can't run your code below. It's easy to create sample data with the random number generators in R, or use ?dput to give us a sample of your actual data.frame. I would guess your prob

Re: [R] storing output data from a loop that has varying row numbers

2010-06-01 Thread Joris Meys
Sorry, forgot to add the sel. This is the first line, then just run the rest. sel <- as.factor(paste(seal_dist[,10],"-",seal_dist[,5],sep="")) cheers Joris On Tue, Jun 1, 2010 at 4:56 PM, Joris Meys wrote: > Is this what you're looking for? > > seal_list <- split(seal_dist,sel) > > out <- lapp

Re: [R] storing output data from a loop that has varying row numbers

2010-06-01 Thread Joris Meys
Is this what you're looking for? seal_list <- split(seal_dist,sel) out <- lapply(seal_list,function(x){ indx <- subset(x, x$DIST == 0) x$TO_ID <- indx$ID[match(x$TO, indx$TO)] return(x) }) output <- unsplit(out,sel) Cheers Joris On Tue, Jun 1, 2010 at 3:32 PM, RCulloch wrote

  1   2   >