[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),

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

2012-06-19 Thread Ben quant
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 ccqu...@gmail.com wrote: 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

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

2012-06-19 Thread Ben quant
#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ben quant ccqu...@gmail.com wrote: Other people at my firm who know a lot about binary files

[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

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

2012-06-15 Thread Ben quant
-2012 21:11, Ben quant escreveu: 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

[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 mailing list

Re: [R] remove leading slash

2012-06-08 Thread Ben quant
Murdoch murdoch.dun...@gmail.comwrote: On 08/06/2012 1:50 PM, Peter Langfelder wrote: On Fri, Jun 8, 2012 at 10:25 AM, David Winsemiusdwinsemius@comcast.**netdwinsem...@comcast.net wrote: On Jun 8, 2012, at 1:11 PM, Ben quant wrote: Hello, How do I change this: cnt_str

Re: [R] remove leading slash

2012-06-08 Thread Ben quant
: 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 Subject: Re: [R] remove leading slash Thanks for all your help. I did it this way: x = sapply(cnt_str

Re: [R] remove leading slash

2012-06-08 Thread Ben quant
things (and this particular conversion doesn't*** * make much sense). ** ** Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com ** ** *From:* Ben quant [mailto:ccqu...@gmail.com] *Sent:* Friday, June 08, 2012 11:40 AM *To:* William Dunlap *Cc:* r-help@r-project.org

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

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

2012-05-15 Thread Ben quant
, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Tue, May 15, 2012 at 12:46 PM, Ben quant ccqu...@gmail.com wrote: 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

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

2012-05-15 Thread Ben quant
(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 ccqu...@gmail.com wrote: Hello, Thanks in advance for any help! How do I pass an unknown number of objects into the ... (dot dot dot

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
- r[order(r[,1]),,drop=FALSE] segments(pmax(r[,1], xr[1]), y, pmin(r[,2], xr[2]), y) } } } -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ben quant Sent: Saturday, May 12, 2012 10:54 AM To: r

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
end: -25.5 start: 35 end: 70 start: 80.3 end: 90 start: 95 end: 100 = On Sat, May 12, 2012 at 1:54 PM, Ben quant ccqu...@gmail.com wrote: Hello, I'm posting this again (with some small edits). I didn't get any replies last time

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
= On Sat, May 12, 2012 at 1:54 PM, Ben quant ccqu...@gmail.com wrote: 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

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ben quant Sent: Monday, May 14, 2012 11:07 AM To: jim holtman Cc: r-help@r-project.org Subject: Re: [R] range segment exclusion using range endpoints Turns out this solution doesn't work if the s

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
, 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, -steve On Mon, May 14, 2012 at 2:54 PM, Ben quant ccqu...@gmail.com wrote

[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

[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

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

2012-05-11 Thread Ben quant
11, 2012 at 8:58 AM, Ben quant ccqu...@gmail.com 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 of s ranges (s[#]_rng) also

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 ccqu...@gmail.com wrote: Hello, I don't understand what went wrong or how to fix this. How do I set qr=TRUE for gam? When I produce

[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()

[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

[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

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 ccqu...@gmail.com 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 stats to an .xlsx

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 ccqu...@gmail.com wrote: Forgot this: the solution doesn't have to come from the xlsx package... thanks ben On Fri

[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

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

[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

[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] gam - Y axis probability scale with confidence/error lines

2012-03-14 Thread Ben quant
with the appropriate quantile of the normal distribution for other confidence levels). You can then do whatever stuff you want to do with them, including plot them. --Patrick On 03/14/2012 10:48 AM, Ben quant wrote: Hello, How do I plot a gam fit object on probability (Y axis) vs raw

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

2012-03-14 Thread Ben quant
Department of Biostatistics Department of Statistics University of Kentucky On 03/14/2012 01:49 PM, Ben quant wrote: That was embarrassingly easy. Thanks again Patrick! Just correcting a little typo to his reply. this is probably what he meant: pred = predict(fit,data.frame(x=xx),**type=response

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 jwiley.ps...@gmail.comwrote: On Sat, Mar 10, 2012 at 12:11 PM, Ben quant ccqu...@gmail.com

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

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

2012-03-10 Thread Ben quant
) 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),each=nrow(indx2)))],nrow=nrow(indx2),ncol=ncol(indx2))) %% On Sat, Mar 10, 2012 at 7:48 AM, Ben quant ccqu

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

Re: [R] index instead of loop?

2012-03-08 Thread Ben quant
) print(Sys.time()-start_t_all) Let me know if you disagree, Ben On Wed, Mar 7, 2012 at 5:57 PM, Rui Barradas rui1...@sapo.pt wrote: Hello again. Ben quant wrote Hello, In case anyone is interested in a faster solution for lots of columns. This solution is slower if you only have

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(vals) =

[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

Re: [R] index instead of loop?

2012-03-06 Thread Ben quant
— 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. # First, start by using dates, not characters fdate - function(x, format=%Y%m%d){ DF - data.frame(x

Re: [R] index instead of loop?

2012-03-06 Thread Ben quant
] - ua[i, tkr]) } colnames(fin1) - c(daily_dates, colnames(ua)) # Check results str(fin1) head(fin1) tail(fin1) On Tue, Mar 6, 2012 at 7:34 AM, Ben quant ccqu...@gmail.com wrote: Just looking at this, but it looks like ix doesn't exist: sapply(1:length(inxlist), function(i) if(length(ix[[i

Re: [R] index instead of loop?

2012-03-06 Thread Ben quant
, colnames(ua)) print(Sys.time()-start_t_all) Thanks for your efforts though, ben On Tue, Mar 6, 2012 at 7:39 AM, Ben quant ccqu...@gmail.com wrote: I think this is what you meant: z.dates = c(2007-03-31,2007-06-30,2007-09-30,2007-12-31,2008-03-31,2008-06-30,2008-09-30,2008-12-31) nms = c

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 =

[R] index instead of loop?

2012-03-05 Thread Ben quant
. On Sat, Mar 3, 2012 at 2:30 PM, Ben quant ccqu...@gmail.com wrote: 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

[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

[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

[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

Re: [R] speed up merge

2012-03-02 Thread Ben quant
Ekbrand h...@sociologi.cjb.net 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 of which rows that fullfil

Re: [R] speed up merge

2012-03-02 Thread Ben quant
NA NA 8 2007-04-07 NA NA 9 2007-04-08 NA NA 10 2007-04-09 NA NA On Fri, Mar 2, 2012 at 5:24 AM, Ben quant ccqu...@gmail.com wrote: Hello, I have a nasty loop that I have to do 11877 times. The only thing that slows it down really

[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

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 marc_schwa...@me.com 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 Days - seq(from = as.Date(2012-03-01), to = as.Date

[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

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 savi...@cs.cas.cz 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 another value then fill

[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 20080814 -- 2008-09-30

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 peter.langfel...@gmail.com wrote: On Thu, Mar 1, 2012 at 8:05 PM, Ben quant ccqu...@gmail.com wrote: Hello, I have another question I have a data frame that looks like

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

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 ke...@math.montana.edu wrote: aggregate(val~lvls+nm,data=x,FUN='median') On Tue, Feb 28, 2012 at 4:43 PM, Ben quant ccqu...@gmail.com wrote: Hello, I can get the median

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

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 dwinsem...@comcast.netwrote: On Feb 22, 2012, at 4:01 PM, Ben quant wrote: Hello, What is the best way to get ranks for a vector of values, limit the range

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 ggrothendi...@gmail.com wrote: On Tue, Feb 21, 2012 at 12:15 AM, Ben quant ccqu...@gmail.com wrote: Thanks again for your so far on proto

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 ccqu...@gmail.com wrote: The code below works as expected but: Using the proto package, is this the best way to 1) make a parameter

Re: [R] proto: make a parameter persist

2012-02-20 Thread Ben quant
, 2012 at 12:44 AM, Ben quant ccqu...@gmail.com 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() function without a parameter assignment, 3

Re: [R] sequencing environments

2012-02-17 Thread Ben quant
...@gmail.com wrote: On Wed, Feb 15, 2012 at 11:58 PM, Ben quant ccqu...@gmail.com 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 new R dev project for my company. I'm thinking about

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

Re: [R] sequencing environments

2012-02-15 Thread Ben quant
, Duncan Murdoch murdoch.dun...@gmail.comwrote: 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 point in a script? In other words, if I don't know what environments exist and I don't

[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

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 dwinsem...@comcast.netwrote: On Dec 28, 2011, at 5:57 PM, Ben quant

[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

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

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 murdoch.dun...@gmail.comwrote: 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, format independent). It has

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

2011-12-28 Thread Ben quant
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, 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

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

2011-12-20 Thread Ben quant
windows box and remote linux nodes. -Whit On Wed, Dec 7, 2011 at 6:02 PM, Ben quant ccqu...@gmail.com wrote: 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

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

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 s.w...@bath.ac.uk wrote: See help(mgcv-FAQ), item 2. best, Simon On 09/12/11 15:05, Ben quant wrote: Hello, I'd like to understand 'what' is predicting the response for library(mgcv

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

2011-12-08 Thread Ben quant
://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. -Whit On Wed, Dec 7, 2011 at 6:02 PM, Ben quant ccqu

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

[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

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

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

2011-12-01 Thread Ben quant
3.349013e-02 1.273468e-03 Thanks for your help, Ben On Thu, Dec 1, 2011 at 11:55 AM, peter dalgaard pda...@gmail.com wrote: On Dec 1, 2011, at 18:54 , Ben quant wrote: Sorry if this is a duplicate: This is a re-post because the pdf's mentioned below did not go through. Still

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

2011-12-01 Thread Ben quant
/static/ben/warn%20num%200%20or%201.pdf Thank you, Ben On Thu, Dec 1, 2011 at 2:24 PM, peter dalgaard pda...@gmail.com 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 understanding. Hum, then maybe

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

2011-12-01 Thread Ben quant
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 ccqu...@gmail.com wrote: Here you go: attach(as.data.frame(l_yx)) range(x[y==1]) [1

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

2011-12-01 Thread Ben quant
/ben/warn%20num%200%20or%201.pdf Thank you for your help, Ben On Thu, Dec 1, 2011 at 3:25 PM, Ben quant ccqu...@gmail.com 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: attach(as.data.frame(l_yx

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

2011-12-01 Thread Ben quant
Residual Deviance: 446800 AIC: 446800 l_exp_coef = exp(l_logit$coefficients)[2] l_exp_coef x 15709.52 Thanks, Ben On Thu, Dec 1, 2011 at 4:32 PM, peter dalgaard pda...@gmail.com wrote: On Dec 1, 2011, at 23:43 , Ben quant wrote: I'm not proposing this as a permanent

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

[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

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

Re: [R] activate console

2011-11-16 Thread Ben quant
gunter.ber...@gene.comwrote: ??focus ## admittedly, not the first keyword that comes to mind ?bringToTop -- Bert On Wed, Nov 16, 2011 at 9:07 AM, Ben quant ccqu...@gmail.com wrote: Hello, After I plot something how do I reactivate the console (and not the plot window) so I don't have

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 ggrothendi...@gmail.comwrote: On Mon, Nov 7, 2011 at 5:34 PM, Ben quant ccqu...@gmail.com wrote: Hello, Using the RpgSQL package

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

[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

Re: [R] multi-line query

2011-11-08 Thread Ben quant
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 Tue, Nov 8, 2011 at 11:43 AM, Ben quant ccqu...@gmail.com wrote: Hello, I'm using package RpgSQL. Is there a better way

[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) =

[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

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

[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

Re: [R] preceding X. and X

2011-10-27 Thread Ben quant
-str_replace(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 dat-as.numeric(dat) dat [1] 0.000 -0.240 0.350 -0.211 hope that helps, Justin On Thu, Oct 27, 2011 at 11:47 AM, Ben quant ccqu...@gmail.com wrote

Re: [R] preceding X. and X

2011-10-27 Thread Ben quant
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 Ben quant Sent: Thursday, October 27, 2011 12:26 PM To: r-help@r

[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

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 e.vettora...@uke.de 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() cheers Am 25.10.2011 15:26, schrieb Ben quant

[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

  1   2   >