[R] discrete event simulation - "factory" with rework

2008-07-25 Thread seanpor
Good morning, I wonder could somebody help me bridge the gap? I want to try and simulate a "factory" type environment with an object moving between stages of production with errors and re-work. The intent of this is to demonstrate the effect of error rates and re-work at various stages in the '

Re: [R] Pros and Cons of R

2008-05-23 Thread seanpor
Neil Shephard wrote: > > Another pro to consider is the cost, you can obtain R for free, > SAS/S-Plus/Stata all have licenses of some sort that require purchasing. > > Neil > Which has the side effect of *not* restricting how many machines are available for use or where; e.g. I was running bi

Re: [R] Documentation General Comments

2008-04-23 Thread seanpor
Good morning, Firstly I'd like to say that I'm a huge fan of R and I think it's great system. Part of the problem in searching for information is knowing what buzzwords / keywords to use. I was recently caught out like this as I didn't see my problem as a cumulative sum (keyword=cumsum) only as

Re: [R] select rows from data based on a vector of char strings

2008-04-24 Thread seanpor
or using the %in% operator... ?"%in%" data[data$label %in% flist,] regards, Sean Applejus wrote: > > Hi, > > You are right the == doesn't work, but there's a workaround using regular > expressions: > > flist<-"fun|food" > grep(flist, data$label) > > will give you the vector [2 4] which ar

Re: [R] How to plot wind direction and strength field

2008-04-29 Thread seanpor
Jenny, Have a look at the R Newsletter Volume 3/2, October 2003 Regards, Sean Jenny Barnes wrote: > > Dear R-help community, > > I have searched through the archives and not been able ot find any advice > on how to plot a wind field with one arrow per grid square with the arrow > pointing

Re: [R] Re placing values job

2007-11-29 Thread seanpor
fyi On my machine match runs *much* faster... > t0 <- Sys.time(); for (i in 1:reps) { match(Y,X) }; print(Sys.time() - t0) Time difference of 0.1570001 secs > t0 <- Sys.time(); for (i in 1:reps) { sapply(Y,function(Y){which(Y==X)}) > }; print(Sys.time() - t0) Time difference of 6.093 secs > 6.09/

Re: [R] Rating R Helpers

2007-12-05 Thread seanpor
Good morning, I read (and occasionally post to) R-Help through nabble.com (http://www.nabble.com/R-f13819.html) and there is a rating system there by post rather than by author. Message boards (e.g. www.boards.ie amongst many others) note on each message how many posts that a person has made sin

Re: [R] spliting strings ...

2007-12-13 Thread seanpor
Good afternoon Monica, Relying on regular expressions, substituting nothing "" for everything starting with a space until the end of the "line" (i.e. with a dollar sign) str1 <- sub(" .*$", "", str) Regards, Sean Monica Pisica wrote: > > > Hi everyone, > > I have a vector of strings, eac

[R] running balance down a dataframe referring back to previous row

2008-03-19 Thread seanpor
Good morning, I've searched high and low and I've tried many different ways of doing this, but I can't seem to get it to work. I'm looking for a way of vectorising a "running balance"; i.e. the value in the first row of the dataframe is zero, and following rows add to this running balance. This

Re: [R] exponential of a matrix

2008-11-11 Thread seanpor
Good morning, Try expm() in the Matrix package by Douglas Bates and Martin Maechler http://www.stats.bris.ac.uk/R/web/packages/Matrix/index.html Note that there is a revised version of that paper, refer: Cleve Moler and Charles Van Loan (2003) Nineteen dubious ways to compute the exponential of

Re: [R] How to create a string containing '\/' to be used with SED?

2008-11-26 Thread seanpor
Good morning, You do not need to quote a forward slash / in R, but you do need to quote a backslash when you're inputting it... so to get a string which actually contains "blah\/blah"... you need to use "blah\\/blah" http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-does-backslash-behave-strangel

Re: [R] memory limit

2008-11-26 Thread seanpor
Good afternoon, The short answer is "yes", the long answer is "it depends". It all depends on what you want to do with the data, I'm working with dataframes of a couple of million lines, on this plain desktop machine and for my purposes it works fine. I read in text files, manipulate them, conv

Re: [R] How to create a string containing '\/' to be used with SED?

2008-11-26 Thread seanpor
What is the problem error message? I can say > fred <- "blah1\\/blah2\\/blah3" and then the string looks like... > cat("#", fred, '#\n', sep='') #blah1\/blah2\/blah3# If you just ask R to print it then it looks like... > fred [1] "blah1\\/blah2\\/blah3" > when you're "playing" with strings a

Re: [R] specifications windows pc

2008-11-28 Thread seanpor
Good morning Ruud, What sort of tasks are you going to be doing in R? Some tasks will be faster on a single core extreme type processor, and other tasks can benefit from a multi-core processor (which run at slower clock speeds than extreme single-core). If you're working with large matrices, th