Re: [R] seek(), skip by bits (not by bytes) in binary file

2012-06-19 Thread Ben quant
OO#.. Playing > Research Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > ------- > Sent from my phone. Please excuse my brevity. > >

Re: [R] seek(), skip by bits (not by bytes) in binary file

2012-06-19 Thread Ben quant
unctions. This can all be done once you understand the structure of > the data. So some examples would be useful if you want someone to > propose a solution. > > On Tue, Jun 19, 2012 at 11:54 AM, Ben quant wrote: > > Hello, > > > > Has a function been built that will

[R] seek(), skip by bits (not by bytes) in binary file

2012-06-19 Thread Ben quant
Hello, Has a function been built that will skip to a certain bit in a binary file? As of 2009 the answer was 'no': http://r.789695.n4.nabble.com/read-binary-file-seek-td900847.html https://stat.ethz.ch/pipermail/r-help/2009-May/199819.html If you feel I don't need to (like in the links above), p

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Ben quant
t;A","B","C","D") > rep_vec <- rep(sapply(split(vec, cumsum(rep(c(1, 0, 0), 5))), paste, > collapse=""), 4) > mat <- matrix(rep_vec, nrow=5, byrow=TRUE, dimnames=list(NULL,nms)) > mat > > > Hope this helps, > > Rui Barrada

[R] strings concatenation and organization (fast)

2012-06-15 Thread Ben quant
Hello, What is the fastest way to do this? I has to be done quite a few times. Basically I have sets of 3 numbers (as characters) and sets of 3 dashes and I have to store them in named columns. The order of the sets and the column name they fall under is important. The actual numbers and the patte

Re: [R] remove leading slash

2012-06-08 Thread Ben quant
are doing > > is a very hard way to do things (and this particular conversion doesn't*** > * > > make much sense). > > ** ** > > Bill Dunlap**** > > Spotfire, TIBCO Software > > wdunlap tibco.com > > ** ** > > *From:* Ben quan

Re: [R] remove leading slash

2012-06-08 Thread Ben quant
bco.com > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf > > Of Ben quant > > Sent: Friday, June 08, 2012 11:00 AM > > To: Duncan Murdoch > > Cc: r-help@r-project.org > > S

Re: [R] remove leading slash

2012-06-08 Thread Ben quant
t gets me where I want to go. Thanks, Ben On Fri, Jun 8, 2012 at 11:56 AM, Duncan Murdoch wrote: > On 08/06/2012 1:50 PM, Peter Langfelder wrote: > >> On Fri, Jun 8, 2012 at 10:25 AM, David >> Winsemius> >> wrote: >> > >> > On Jun 8, 2012, at 1:11

[R] remove leading slash

2012-06-08 Thread Ben quant
Hello, How do I change this: > cnt_str [1] "\002" "\001" "\102" ...to this: > cnt_str [1] "2" "1" "102" Having trouble because of this: > nchar(cnt_str[1]) [1] 1 Thanks! Ben [[alternative HTML version deleted]] __ R-help@r-project.org maili

Re: [R] pass objects into "..." (dot dot dot)

2012-05-15 Thread Ben quant
; > z = Intervals(c(1,10)) > y = Intervals(c(5,10)) > x = Intervals(c(4,6)) > > do.call("interval_intersection", list(x,y,z)) > > Michael > > On Tue, May 15, 2012 at 12:46 PM, Ben quant wrote: > > Hello, > > > > Thanks in advance for any help

Re: [R] pass objects into "..." (dot dot dot)

2012-05-15 Thread Ben quant
me. ben On Tue, May 15, 2012 at 10:53 AM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > Hi, > > On Tue, May 15, 2012 at 12:46 PM, Ben quant wrote: > > Hello, > > > > Thanks in advance for any help! > > > > How do I pass an unknown number

[R] pass objects into "..." (dot dot dot)

2012-05-15 Thread Ben quant
Hello, Thanks in advance for any help! How do I pass an unknown number of objects into the "..." (dot dot dot) parameter? Put another way, is there some standard way to pass multiple objects into "..." to "fool" the function into thinking the objects are passed in separately/explicitly with commo

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
l.com> wrote: > Hi all, > > Nice code samples presented all around. > > Just wanted to point out that I think the stuff found in the > `intervals` package might also be helpful: > > http://cran.at.r-project.org/web/packages/intervals/index.html > > HTH, > -

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
functions and data structures for this > than > to adapt the cumsum/order idiom to different situations. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
11 > [2,] -25.5012 > [3,]0.7713 > [4,] 10.00 -12 > [5,] 25.0013 > [6,] 30.00 -12 > [7,] 35.00 -11 > [8,] 70.00 12 > [9,] 80.30 -11 > [10,] 90.0012 > [11,] 95.00 -11 >

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
,2] [,3] > [1,] -100.0011 > [2,] -25.5012 > [3,]0.7713 > [4,] 10.00 -12 > [5,] 25.0013 > [6,] 30.00 -12 > [7,] 35.00 -11 > [8,] 70.0012 > [9,] 80.30 -11 > [10,] 90.00 1

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
angesList <- list(x=x, ...) >labels <- vapply(as.list(substitute(list(x, ...)))[-1], > function(x)deparse(x)[1], "") >oldmar <- par(mar = replace(par("mar"), 2, max(nchar(labels)/2, 10))) >on.exit(par(oldmar)) >xlim <- do.call("range

[R] range segment exclusion using range endpoints

2012-05-12 Thread Ben quant
Hello, I'm posting this again (with some small edits). I didn't get any replies last time...hoping for some this time. :) Currently I'm only coming up with brute force solutions to this issue (loops). I'm wondering if anyone has a better way to do this. Thank you for your help in advance! The pr

Re: [R] domain/number line/range reduction problem

2012-05-11 Thread Ben quant
ks! Ben On Fri, May 11, 2012 at 8:58 AM, Ben quant wrote: > Hello, > > Currently I'm only coming up with brute force solutions to this issue. > Wondering if anyone knows of a better way to do this. > > The problem: I have endpoints of one x range (x_rng) and an unknown number

[R] domain/number line/range reduction problem

2012-05-11 Thread Ben quant
Hello, Currently I'm only coming up with brute force solutions to this issue. Wondering if anyone knows of a better way to do this. The problem: I have endpoints of one x range (x_rng) and an unknown number of s ranges (s[#]_rng) also defined by endpoints. What I want are the parts of the x range

Re: [R] GAM, how to set qr=TRUE

2012-05-04 Thread Ben quant
Solution: have package mgcv loaded when you predict...not just for the fit. :) Silly mistake... Thanks Simon! Ben On Thu, May 3, 2012 at 3:56 PM, Ben quant wrote: > Hello, > > I don't understand what went wrong or how to fix this. How do I set > qr=TRUE for gam? > > Whe

[R] GAM, how to set qr=TRUE

2012-05-03 Thread Ben quant
Hello, I don't understand what went wrong or how to fix this. How do I set qr=TRUE for gam? When I produce a fit using gam like this: fit = gam(y~s(x),data=as.data.frame(l_yx),family=family,control = list(keepData=T)) ...then try to use predict: (see #1 below in the traceback() ) > traceback()

Re: [R] check if excel file is

2012-04-27 Thread Ben quant
To get around the issue below, I just wrapped it with try(), but would like to know how to know the question below. Thanks! ben On Fri, Apr 27, 2012 at 10:13 AM, Ben quant wrote: > Forgot this: the solution doesn't have to come from the xlsx package... > > thanks > > ben

Re: [R] check if excel file is

2012-04-27 Thread Ben quant
Forgot this: the solution doesn't have to come from the xlsx package... thanks ben On Fri, Apr 27, 2012 at 10:08 AM, Ben quant wrote: > Hello again, > > I'd like to determine if an Excel file is open or writable. Can anyone > help me with that? > > I write some

[R] check if excel file is

2012-04-27 Thread Ben quant
Hello again, I'd like to determine if an Excel file is open or writable. Can anyone help me with that? I write some stats to an .xlsx Excel file using the xlsx package. I can't write to the file unless its closed. How do I determine if the .xlsx file is open or closed so I can write to it? I've

[R] get plot axis rounding method

2012-04-27 Thread Ben quant
Hello, Does anyone know how to get the rounding method used for the axis tick numbers/values in plot()? I'm using mtext() to plot the values used to plot vertical and horizontal lines (using abline()) and I'd like these vertical and horizontal line values to be rounded like the axis tick values a

[R] lines crosses

2012-04-20 Thread Ben quant
Hello, If the exact value does not exist in the vector, can I still get at the intersections? Is there a simple way to do this and avoid looping? Seems like there would be a simple R function to do this... Example: vec <- c(5,4,3,2,3,4,5) vec [1] 5 4 3 2 3 4 5 intersect(vec,2.5) numeric(0) I wan

[R] quarter end dates between two date strings

2012-04-18 Thread Ben quant
Hello, I have two date strings, say "1972-06-30" and "2012-01-31", and I'd like to get every quarter period end date between those dates? Does anyone know how to do this? Speed is important... Here is a small sample: Two dates: "2007-01-31" "2012-01-31" And I'd like to get this: [1] "2007-03-

[R] resetting console

2012-03-21 Thread Ben quant
Hello, I'm still hoping my issue is preventable and not worthy of a bug/crash report, hence my post is in 'help'. Anyway, I'd like to know how to reset the console so it is clear of all residual effects caused by previous scripts. Details: I run a script once and it runs successfully (but very sl

Re: [R] gam - Y axis probability scale with confidence/error lines

2012-03-14 Thread Ben quant
lines(x,l,lty=2) > lines(x,u,lty=2) > > > -- > Patrick Breheny > Assistant Professor > Department of Biostatistics > Department of Statistics > University of Kentucky > > > > > On 03/14/2012 01:49 PM, Ben quant wrote: > >> That was embarrassin

Re: [R] gam - Y axis probability scale with confidence/error lines

2012-03-14 Thread Ben quant
dence intervals will then be > > pred$fit + 1.96*se.fit > pred$fit - 1.96*se.fit > > for 95% confidence intervals (replace 1.96 with the appropriate quantile > of the normal distribution for other confidence levels). > > You can then do whatever "stuff" you want to do

[R] gam - Y axis probability scale with confidence/error lines

2012-03-14 Thread Ben quant
Hello, How do I plot a gam fit object on probability (Y axis) vs raw values (X axis) axis and include the confidence plot lines? Details... I'm using the gam function like this: l_yx[,2] = log(l_yx[,2] + .0004) fit <- gam(y~s(x),data=as.data.frame(l_yx),family=binomial) And I want to plot it so

Re: [R] index values of one matrix to another of a different size

2012-03-12 Thread Ben quant
Joshua, Just confirming quickly that your method using cmpfun and your f function below was fastest using my real data. Again, thank you for your help! Ben On Sat, Mar 10, 2012 at 1:21 PM, Joshua Wiley wrote: > On Sat, Mar 10, 2012 at 12:11 PM, Ben quant wrote: > > Very interesting

Re: [R] index values of one matrix to another of a different size

2012-03-10 Thread Ben quant
ld <- > matrix(vals2[cbind(c(indx2),rep(1:ncol(indx2),each=nrow(indx2)))],nrow=nrow(indx2),ncol=ncol(indx2)) > test1 <- f2(vals2, indx2) > all.equal(gold, test1) > > system.time(for (i in 1:20) f2(vals2, indx2)) > system.time(for (i in 1:20) > > matrix(vals2[cbind(c(indx2),rep(1:ncol(indx2),

Re: [R] index values of one matrix to another of a different size

2012-03-10 Thread Ben quant
Thanks for the info. Unfortunately its a little bit slower after one apples to apples test using my big data. Mine: 0.28 seconds. Yours. 0.73 seconds. Not a big deal, but significant when I have to do this 300 to 500 times. regards, ben On Fri, Mar 9, 2012 at 1:23 PM, Rui Barradas wrote: > Hel

Re: [R] index instead of loop?

2012-03-09 Thread Ben quant
Here is my latest. I kind of changed the problem (for speed). In real life I have over 300 uadata type matrices, each having over 20 rows and over 11,000 columns. However the rddata file is valid for all of the uadata matrices that I have (300). What I am doing now: I'm creating a matrix of row ind

Re: [R] index values of one matrix to another of a different size

2012-03-08 Thread Ben quant
> Hello, > > Is this the fastest way to use indices from one matrix to reference rows > in another smaller matrix? I am dealing with very big data (lots of columns > and I have to do this lots of times). > > ##sample data ## > vals = matrix(LETTERS[1:9], nrow=3,ncol=3) > colnames(va

Re: [R] index instead of loop?

2012-03-08 Thread Ben quant
wd)){ d = as.Date(wd[i]) diff = abs(nms - d) rd_row_idx = max(which(diff == min(diff))) rd_col_idx = which(as.Date(rd[rd_row_idx,], format="%Y-%m-%d") < d) rd_col_idx_lag = which(as.Date(rd[rd_row_idx - 1,], format="%Y-%m-%d") < d) rd_col_idx_lag2 = which(as.

[R] extract same columns and rows in two matrices

2012-03-07 Thread Ben quant
Hello, I have two matrices. They both have different row names and column names, but they have some common row names and column names. The row names and column names that are the same are what I am interested in. I also want the columns in the two matrices aligned the same. In the end, I need to d

Re: [R] index instead of loop?

2012-03-06 Thread Ben quant
Hello, In case anyone is interested in a faster solution for lots of columns. This solution is slower if you only have a few columns. If anyone has anything faster, I would be interested in seeing it. ### some mockup data z.dates = c("2007-03-31","2007-06-30","2007-09-30","2007-12-31","2008-03-3

Re: [R] index instead of loop?

2012-03-06 Thread Ben quant
=format) class(DF[, i]) <- "Date" } DF } rd1 <- fdate(rd1) # This is yours, use it. dt1 <- seq(from =as.Date(z.dates[1]), to = as.Date(z.dates[length(z.dates)]), by ="day") # Set up the result, no time expensive 'cbind' inside a loop fin1 <- data.fram

Re: [R] index instead of loop?

2012-03-06 Thread Ben quant
t;- fdate(rd1) # This is yours, use it. dt1 <- seq(from =as.Date(z.dates[1]), to = as.Date("2009-03-25"), by = "day") # Set up the result, no time expensive 'cbind' inside a loop fin1 <- data.frame(matrix(NA, nrow=length(dt1), ncol=ncol(ua) + 1)) fin1[, 1] <- d

Re: [R] index instead of loop?

2012-03-06 Thread Ben quant
gt; Mar 05, 2012; 8:53pm — by Ben quant Ben quant > > Hello, > > > > Does anyone know of a way I can speed this up? > > > > Maybe, let's see. > > > > > # change anything below. > > > > # Yes. > # Firs

[R] index instead of loop?

2012-03-05 Thread Ben quant
cn in 1:ncol(ua)){ uac = ua[,cn] tkr = colnames(ua)[cn] rdc = rd[,cn] ua_rd = cbind(uac,rdc) colnames(ua_rd) = c(tkr,'rt_date') xx1 = merge(dt,ua_rd,by.x=1,by.y= 'rt_date',all.x=T) xx = as.character(xx1[,2]) values <- c(NA, xx[!is.na(xx)]) ind = cumsum(!is.na(xx))

[R] Matrix Package, sparseMatrix, more NaN's than zeros

2012-03-04 Thread Ben quant
Hello, I have a lot of data and it has a lot of NaN values. I want to compress the data so I don't have memory issues later. Using the Matrix package, sparseMatrix function, and some fiddling around, I have successfully reduced the 'size' of my data (as measured by object.size()). However, NaN va

[R] removing data look-ahead, something faster.

2012-03-03 Thread Ben quant
Hello, Thank you for your help/advice! The issue here is speed/efficiency. I can do what I want, but its really slow. The goal is to have the ability to do calculations on my data and have it adjusted for look-ahead. I see two ways to do this: (I'm open to more ideas. My terminology: Unadjusted

Re: [R] speed up merge

2012-03-02 Thread Ben quant
match(dt, ua$rt_date) > > > > # create new result matrix > > xx1 <- cbind(dt, ua[indx,]) > > rownames(xx1) <- NULL # delete funny names > > xx1 >dtANamert_date > 1 2007-03-31 NA > 2 2007-04-01 14066.58 2007-04-01 >

Re: [R] speed up merge

2012-03-02 Thread Ben quant
t 4:37 AM, Hans Ekbrand wrote: > On Fri, Mar 02, 2012 at 03:24:20AM -0700, Ben quant wrote: > > Hello, > > > > I have a nasty loop that I have to do 11877 times. > > Are you completely sure about that? I often find my self avoiding > loops-by-row by constructing vectors

[R] speed up merge

2012-03-02 Thread Ben quant
Hello, I have a nasty loop that I have to do 11877 times. The only thing that slows it down really is this merge: xx1 = merge(dt,ua_rd,by.x=1,by.y= 'rt_date',all.x=T) Any ideas on how to speed it up? The output can't change materially (it works), but I'd like it to go faster. I'm looking at gett

Re: [R] data frame of strings formatted

2012-03-01 Thread Ben quant
Thanks a ton! That is great. ben On Thu, Mar 1, 2012 at 9:29 PM, Peter Langfelder wrote: > On Thu, Mar 1, 2012 at 8:05 PM, Ben quant wrote: > > Hello, > > > > I have another question > > > > I have a data frame that looks like this: > >

[R] data frame of strings formatted

2012-03-01 Thread Ben quant
Hello, I have another question I have a data frame that looks like this: a b 2007-03-31 "20070514" "20070410" 2007-06-30 "20070814" "20070709" 2007-09-30 "20071115" "20071009" 2007-12-31 "20080213" "20080109" 2008-03-31 "20080514" "20080407" 2008-06-30 "20080

Re: [R] fill data forward in data frame.

2012-03-01 Thread Ben quant
That is great! Thank you very much. Ben On Thu, Mar 1, 2012 at 2:57 PM, Petr Savicky wrote: > On Thu, Mar 01, 2012 at 02:31:01PM -0700, Ben quant wrote: > > Hello, > > > > My direct desire is a good (fast) way to fill values forward until there > is > > anot

[R] fill data forward in data frame.

2012-03-01 Thread Ben quant
Hello, My direct desire is a good (fast) way to fill values forward until there is another value then fill that value foward in the data xx (at the bottom of this email). For example, from row 1 to row 45 should be NA (no change), but from row 46 row 136 the value should be 12649, and from row 13

Re: [R] fridays date to date

2012-03-01 Thread Ben quant
Great thanks! ben On Thu, Mar 1, 2012 at 1:30 PM, Marc Schwartz wrote: > On Mar 1, 2012, at 2:02 PM, Ben quant wrote: > > > Hello, > > > > How do I get the dates of all Fridays between two dates? > > > > thanks, > > > > Ben > > >

[R] fridays date to date

2012-03-01 Thread Ben quant
Hello, How do I get the dates of all Fridays between two dates? thanks, Ben [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-p

Re: [R] group calculations with other columns for the ride

2012-02-28 Thread Ben quant
Excellent! I wonder why I haven't seen aggregate before. Thanks! ben On Tue, Feb 28, 2012 at 4:51 PM, ilai wrote: > aggregate(val~lvls+nm,data=x,FUN='median') > > > > On Tue, Feb 28, 2012 at 4:43 PM, Ben quant wrote: > > Hello, > > > > I

[R] group calculations with other columns for the ride

2012-02-28 Thread Ben quant
Hello, I can get the median for each factor, but I'd like another column to go with each factor. The nm column is a long name for the lvls column. So unique work except for the order can get messed up. Example: x = data.frame(val=1:10,lvls=c('cat2',rep("cat1",4),rep("cat2",4),'cat1'),nm=c('longna

Re: [R] rank with uniform count for each rank

2012-02-22 Thread Ben quant
Thank you everyone! We already use the Hmisc package so I'll likely use cut2. Ben On Wed, Feb 22, 2012 at 2:22 PM, David Winsemius wrote: > > On Feb 22, 2012, at 4:01 PM, Ben quant wrote: > > Hello, >> >> What is the best way to get ranks for a vector of value

[R] rank with uniform count for each rank

2012-02-22 Thread Ben quant
Hello, What is the best way to get ranks for a vector of values, limit the range of rank values and create equal count in each group? I call this uniform ranking...uniform count/number in each group. Here is an example using three groups: Say I have values: x = c(3, 2, -3, 1, 0, 5, 10, 30, -1, 4

Re: [R] proto: make a parameter persist

2012-02-21 Thread Ben quant
Thank you very much! I'll follow-up with more questions as I dabble...if I have any. Thank you ben On Tue, Feb 21, 2012 at 7:01 AM, Gabor Grothendieck wrote: > On Tue, Feb 21, 2012 at 12:15 AM, Ben quant wrote: > > Thanks again for your so far on proto. I have another question

Re: [R] proto: make a parameter persist

2012-02-20 Thread Ben quant
> wrote: > On Sat, Feb 18, 2012 at 12:44 AM, Ben quant wrote: > > The code below works as expected but: > > Using the proto package, is this the best way to 1) make a parameter > > persist if the parameter is passed > > in with a value, 2) allow for calling the bias()

Re: [R] proto: make a parameter persist

2012-02-20 Thread Ben quant
I like it better. Thanks! Ben On Fri, Feb 17, 2012 at 11:38 PM, Gabor Grothendieck < ggrothendi...@gmail.com> wrote: > On Sat, Feb 18, 2012 at 12:44 AM, Ben quant wrote: > > The code below works as expected but: > > Using the proto package, is this the best way t

[R] proto: make a parameter persist

2012-02-17 Thread Ben quant
The code below works as expected but: Using the proto package, is this the best way to 1) make a parameter persist if the parameter is passed in with a value, 2) allow for calling the bias() function without a parameter assignment, 3) have the x2 value initialize as 5? Thanks for your feedback. Giv

Re: [R] sequencing environments

2012-02-17 Thread Ben quant
rothendi...@gmail.com> wrote: > On Wed, Feb 15, 2012 at 11:58 PM, Ben quant wrote: > > Thank you Duncan. Interesting. I find it strange that you can't get a > list > > of the environments. But I'll deal with it... > > > > Anyway, I'm about to start a ne

Re: [R] sequencing environments

2012-02-15 Thread Ben quant
so much for your help. Ben On Tue, Feb 14, 2012 at 5:04 AM, Duncan Murdoch wrote: > On 12-02-14 12:34 AM, Ben quant wrote: > >> Hello, >> >> I can get at environments if I know their names, but what if want to look >> at what environments currently exist at some poin

[R] sequencing environments

2012-02-13 Thread Ben quant
Hello, I can get at environments if I know their names, but what if want to look at what environments currently exist at some point in a script? In other words, if I don't know what environments exist and I don't know their sequence/hierarchy, how do I display a visual representation of the enviro

Re: [R] folders of path - platform independent (repost)

2011-12-29 Thread Ben quant
Oops. I guess I stopped reading about the fsep param when I saw PATH and R_LIB because I'm not interested in those. I didn't get to the part I was interested in. Thanks! Ben On Wed, Dec 28, 2011 at 5:33 PM, David Winsemius wrote: > > On Dec 28, 2011, at 5:57 PM, Ben quant wrote

Re: [R] folders of path - platform independent (repost)

2011-12-28 Thread Ben quant
rm regardless of the platform: folders = strsplit(normalizePath(filename, winslash="/"), "/")[[1]] This will undo the above regardless of the platform: paste(folders,collapse=file.path('"","")) Thanks again for your help Duncan! Ben > On Wed, Dec 28, 201

Re: [R] folders of path - platform independent (repost)

2011-12-28 Thread Ben quant
Excellent! Thanks, ben On Wed, Dec 28, 2011 at 2:37 PM, Duncan Murdoch wrote: > On 11-12-28 4:30 PM, Ben quant wrote: > >> Hello, (sorry re-posting due to typo) >> >> I'm attempting to get the folders of a path in a robust way (platform >> independent, fo

[R] folders of path - platform independent (repost)

2011-12-28 Thread Ben quant
Hello, (sorry re-posting due to typo) I'm attempting to get the folders of a path in a robust way (platform independent, format independent). It has to run on Windows and Linux and tolerate different formats. For these: (The paths don't actually exist in Linux but you get the idea.) Windows: fil

[R] folders of path - platform independent

2011-12-28 Thread Ben quant
Hello, I'm attempting to get the folders of a path in a robust way (platform independent, format independent). It has to run on Windows and Linux and tolerate different formats. For these: (The paths don't actually exist in Linux but you get the idea.) Windows: file_full_path = "C://Program File

Re: [R] R on the cloud - Windows to Linux

2011-12-20 Thread Ben quant
package 'rzmq' had non-zero exit status > Thank you for your help! Ben On Wed, Dec 7, 2011 at 7:00 PM, Whit Armstrong wrote: > subscribe to R-hpc. > > and check out these: > https://github.com/armstrtw/rzmq > https://github.com/armstrtw/AWS.tools > https://

Re: [R] gam, what is the function(s)

2011-12-09 Thread Ben quant
Thank you Simon. I already ordered your book. Regards, Ben On Fri, Dec 9, 2011 at 10:49 AM, Simon Wood wrote: > See help("mgcv-FAQ"), item 2. > > best, > Simon > > > On 09/12/11 15:05, Ben quant wrote: > >> Hello, >> >> I'd like to unde

[R] gam, what is the function(s)

2011-12-09 Thread Ben quant
Hello, I'd like to understand 'what' is predicting the response for library(mgcv) gam? For example: library(mgcv) fit <- gam(y~s(x),data=as.data.frame(l_yx),family=binomial) xx <- seq(min(l_yx[,2]),max(l_yx[,2]),len=101) plot(xx,predict(fit,data.frame(x=xx),type="response"),type="l") I want to

Re: [R] R on the cloud - Windows to Linux

2011-12-08 Thread Ben quant
Due to my lack of experience with R and the cloud I am leery about attempting any patch dev for Windows compatibility. I think it would be cool to contribute at some point, but I think I am still too new. Anyway, I'm looking into using my company's linux server via Putty and use that as my local m

Re: [R] R on the cloud - Windows to Linux

2011-12-08 Thread Ben quant
mstrtw/rzmq > https://github.com/armstrtw/AWS.tools > https://github.com/armstrtw/deathstar > > and this: > http://code.google.com/p/segue/ > > If you're willing to work, you can probably get deathstar to work > using a local windows box and remote linux nodes. > > -Whi

[R] R on the cloud - Windows to Linux

2011-12-07 Thread Ben quant
Hello, I'm working with the gam function and due to the amount of data I am working with it is taking a long time to run. I looked at the tips to get it to run faster, but none have acceptable side effects. That is the real problem. I have accepted that gam will run a long time. I will be running

Re: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread Ben quant
x)) Coefficients: (Intercept)x -2.3129.662 Degrees of Freedom: 690302 Total (i.e. Null); 690301 Residual Null Deviance: 448800 Residual Deviance: 446800 AIC: 446800 > l_exp_coef = exp(l_logit$coefficients)[2] > l_exp_coef x 15709.52 Thanks, B

Re: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread Ben quant
tia.crescat.net/static/ben/warn%20num%200%20or%201.pdf Thank you for your help, Ben On Thu, Dec 1, 2011 at 3:25 PM, Ben quant wrote: > Oops! Please ignore my last post. I mistakenly gave you different data I > was testing with. This is the correct data: > > Here you go: > > > at

Re: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread Ben quant
e are the screen shots of my data that I tried to send earlier (two screen shots, two pages): http://scientia.crescat.net/static/ben/warn%20num%200%20or%201.pdf Thank you, Ben On Thu, Dec 1, 2011 at 3:07 PM, Ben quant wrote: > Here you go: > > > attach(as.data.frame(l_yx)) &g

Re: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread Ben quant
es): http://scientia.crescat.net/static/ben/warn%20num%200%20or%201.pdf Thank you, Ben On Thu, Dec 1, 2011 at 2:24 PM, peter dalgaard wrote: > > On Dec 1, 2011, at 21:32 , Ben quant wrote: > > > Thank you for the feedback, but my data looks fine to me. Please tell me > if I'm not under

Re: [R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread Ben quant
.226343e-03 2.732819e-02 2.385092e-04 [496] 4.905250e-02 1.159876e-02 4.068228e-03 3.349013e-02 1.273468e-03 Thanks for your help, Ben On Thu, Dec 1, 2011 at 11:55 AM, peter dalgaard wrote: > > On Dec 1, 2011, at 18:54 , Ben quant wrote: > > > Sorry if this is a duplicate: This is a re-

[R] logistic regression - glm.fit: fitted probabilities numerically 0 or 1 occurred

2011-12-01 Thread Ben quant
Sorry if this is a duplicate: This is a re-post because the pdf's mentioned below did not go through. Hello, I'm new'ish to R, and very new to glm. I've read a lot about my issue: Warning message: glm.fit: fitted probabilities numerically 0 or 1 occurred ...including: http://tolstoy.newcastle.e

[R] variable types - logistic regression

2011-11-25 Thread Ben quant
Hello, Is there an example out there that shows how to treat each of the predictor variable types when doing logistic regression in R? Something like this: glm(y~x1+x2+x3+x4, data=mydata, family=binomial(link="logit"), na.action=na.pass) I'm drawing mostly from: http://www.ats.ucla.edu/stat/r/da

[R] zeros to NA's - faster

2011-11-23 Thread Ben quant
Hello, Is there a faster way to do this? Basically, I'd like to NA all values in all_data if there are no 1's in the same column of the other matrix, iu. Put another way, I want to replace values in the all_data columns if values in the same column in iu are all 0. This is pretty slow for me, but

Re: [R] activate console

2011-11-16 Thread Ben quant
nter wrote: > ??focus ## admittedly, not the first keyword that comes to mind > ?bringToTop > > -- Bert > > On Wed, Nov 16, 2011 at 9:07 AM, Ben quant wrote: > > Hello, > > > > After I plot something how do I reactivate the console (and not the plot > >

[R] activate console

2011-11-16 Thread Ben quant
Hello, After I plot something how do I reactivate the console (and not the plot window) so I don't have to click on the console each time to go to the next command? Example that does not work: fun = function(x){ plot(x); dev.set(dev.prev())} fun(1:4) ...and another that does not work: fun = fun

Re: [R] multi-line query

2011-11-08 Thread Ben quant
df(' >select t.* >, r.start >, r.end >from total t, commRange r >where t.comm = r.comm and >t.loc between r.start and r.end and >t.loc != t.new >') > > On T

[R] dbWriteTable with field data type

2011-11-08 Thread Ben quant
Hello, When I do: dbWriteTable(con, "r.BOD", cbind(row_names = rownames(BOD), BOD)) ...can I specify the data types such as varchar(12), float, double precision, etc. for each of the fields/columns? If not, what is the best way to create a table with specified field data types (with the RpgSQL

[R] multi-line query

2011-11-08 Thread Ben quant
Hello, I'm using package RpgSQL. Is there a better way to create a multi-line query/character string? I'm looking for less to type and readability. This is not very readable for large queries: s <- 'create table r.BOD("id" int primary key,"name" varchar(12))' I write a lot of code, so I'm looki

Re: [R] RpgSQL row names

2011-11-08 Thread Ben quant
This is great, thanks! I have another unrelated question. I'll create a new email for that one. ben On Mon, Nov 7, 2011 at 4:16 PM, Gabor Grothendieck wrote: > On Mon, Nov 7, 2011 at 5:34 PM, Ben quant wrote: > > Hello, > > > > Using the RpgSQL package, there mu

[R] RpgSQL row names

2011-11-07 Thread Ben quant
Hello, Using the RpgSQL package, there must be a way to get the row names into the table automatically. In the example below, I'm trying to get rid of the cbind line, yet have the row names of the data frame populate a column. > bentest = matrix(1:4,2,2) > dimnames(bentest) = list(c('ra','rb'),c(

[R] RpgSQL vs RPostgreSQL

2011-11-03 Thread Ben quant
Hello, Could someone who has experience with or knowledge regarding both RPostgreSQL and RpgSQL packages provide some feedback? Thanks! I am most interested in hearing from people who have knowledge regarding both packages, not just one. The only real difference I can see is that RpgSQL has a Jav

Re: [R] preceding X. and X

2011-10-27 Thread Ben quant
6085527 -0.1102456 -0.2470147 V5 ...etc... Ben On Thu, Oct 27, 2011 at 1:37 PM, Nordlund, Dan (DSHS/RDA) < nord...@dshs.wa.gov> wrote: > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > > project.org] On Behalf Of Be

Re: [R] preceding X. and X

2011-10-27 Thread Ben quant
ace(dat,'X.0.','-0.') > > dat > [1] "X0.0" "-0.24" "X0.35" "-0.211" > > dat<-str_replace(dat,'X','') > > dat > [1] "0.0""-0.24" "0.35" "-0.211&qu

[R] preceding X. and X

2011-10-27 Thread Ben quant
Hello, Why do I get preceding "X." (that is a and X followed by a period) for negative numbers and an "X" for positive numbers when I read a csv file? Am I stuck with this? If so, how do I convert it to normal numbers? dat=read.csv(file_path) > dat [1] X0.0 X.0.240432350374 X0.

[R] R.oo package, inherit two classes

2011-10-27 Thread Ben quant
Hello, How do I inherit two classes using the R.oo package. Below is kind of a silly example, but I am trying to create class PerDog from classes Dog and Person. Error at bottom. I've tried a few other ways of using extend(), but nothing seems to get me what I want. Example: setConstructorS3("Pe

Re: [R] textplot in layout

2011-10-25 Thread Ben quant
Perfect, thanks! ben On Tue, Oct 25, 2011 at 8:12 AM, Eik Vettorazzi wrote: > Hi Ben, > maybe mtext is of more help here? > > par(mar=c(7,3,3,3)) > plot(year,rate,main='main',sub='sub') > mtext('test',cex=1,side=1,line=5) > box() > > che

[R] textplot in layout

2011-10-25 Thread Ben quant
Hello, Someone (Erik) recently posted about putting text on a plot. That thread didn't help. I'd like to put text directly below the 'sub' text (with no gap). The code below is the best I can do. Note the large undesirable gap between 'sub' and 'test'. I'd like the word 'test' to be just below the

[R] R.oo package: do setMethodS3 work upon construction

2011-10-24 Thread Ben quant
Hello (Heinrich), I did not know I could do this. It doesn't seem to be documented anywhere. Thought this would be helpful to the fraction of the community using package R.oo. Note the call of a setMethodS3 method, xOne, in the setConstructorS3. This is extremely useful if xOne (in this case) is a

  1   2   >