[R] lattice scales format dates

2014-08-06 Thread Folkes, Michael
Hello all, Based on the help in ?xyplot, and this suggestion from another request: http://stackoverflow.com/questions/20623041/r-formatted-auto-scaling-dat e-axis-using-lattice I was under the impression that this code should give me the desired x axis label date format of: 1911-Jan. dat

Re: [R] lattice scales format dates

2014-08-06 Thread Folkes, Michael
Thanks David. Much appreciated. -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: August-06-14 2:31 PM To: Folkes, Michael Cc: r-help@r-project.org Subject: Re: [R] lattice scales format dates On Aug 6, 2014, at 1:11 PM, Folkes, Michael wrote: Hello all

[R] using match to obtain non-sorted index values from non-sorted vector

2014-07-09 Thread Folkes, Michael
Hello all, I've been struggling with the best way to find index values from a large vector with elements that will match elements of a subset vector [the table argument in match()]. BUT the index values can't come out sorted (as we'd get in which(X %in% Y) ). My 'population' vector can't be

Re: [R] using match to obtain non-sorted index values from non-sortedvector

2014-07-09 Thread Folkes, Michael
So nice! Apply wins again. Thanks David. Michael -Original Message- From: David L Carlson [mailto:dcarl...@tamu.edu] Sent: July-09-14 1:11 PM To: Folkes, Michael; r-help@r-project.org Subject: RE: using match to obtain non-sorted index values from non-sortedvector There may be a faster

Re: [R] using match to obtain non-sorted index values from non-sortedvector

2014-07-09 Thread Folkes, Michael
Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: July-09-14 2:01 PM To: Folkes, Michael Cc: David L Carlson; r-help@r-project.org Subject: Re: [R] using match to obtain non-sorted index values from non-sortedvector On Jul 9, 2014, at 1:13 PM, Folkes, Michael wrote: So

[R] mgcv::gam.check qq plot residuals are not standardized?

2014-04-25 Thread Folkes, Michael
Hello all, I looking for confirmation of what I'm seeing. The qq plot in gam.check and qq.gam is not standardizing the residuals. The current help doesn't suggest they're standardized. Somehow I found, online, a help for gam.check from version [Package mgcv version 1.3-23 Index]: If the fit

Re: [R] Hmisc binconf function value interpretation during narrow confidence intervals

2013-09-10 Thread Folkes, Michael
PM To: Folkes, Michael Cc: R help Subject: Re: [R] Hmisc binconf function value interpretation during narrow confidence intervals Hello, Are you sure of the alpha value? Regards, Pascal 2013/9/10 Folkes, Michael michael.fol...@dfo-mpo.gc.ca Hello all, I've been using binconf

[R] bootstrap from binary confidence intervals (Hmisc binconf)

2013-08-21 Thread Folkes, Michael
Hello all, I've generated a series of CI's of proportions from numerous samples using Hmisc binconf(). Now I wish to bootstrap from those values for some additional products. (ie sample to get a proportion, multiply that proportion with another number). We know it's not normally distributed.

[R] function on columns of two arrays

2013-08-20 Thread Folkes, Michael
I've spent a bit too long searching the help history and attempting to apply some logic to the following: I have two 3D arrays each with same dim. I wish to run lm on the respective columns of each array, preferably without loops. We often hear chatter that sometimes apply() won't be faster just

Re: [R] function on columns of two arrays

2013-08-20 Thread Folkes, Michael
Well that was frightfully simple. It's true that if data structure allows it seems best to flatten the data, yes? Thanks to A.K. Michael -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: August 20, 2013 4:43 AM To: Folkes, Michael Cc: R help Subject: Re: [R] function

Re: [R] function on columns of two arrays

2013-08-20 Thread Folkes, Michael
I know have multiple ways to skin the metaphorical cat. Thanks to Jason and A.K. Michael -Original Message- From: Law, Jason [mailto:jason@portlandoregon.gov] Sent: August 20, 2013 9:54 AM To: Folkes, Michael Cc: R help Subject: RE: function on columns of two arrays library(abind

Re: [R] function on columns of two arrays

2013-08-20 Thread Folkes, Michael
Here's a tiny summary of the speed results using different methods to run lm on common columns from two arrays. Sadly looping is fastest. I don't know if any are sensitive to array dimensions (more columns, fewer layers etc). I invite correction, or suggestions for improvement to avoid looping.

Re: [R] function on columns of two arrays

2013-08-20 Thread Folkes, Michael
That's much more fair I failed to note that extra line of work. Good to know looping can be avoided. Thanks! -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: August 20, 2013 11:11 AM To: Folkes, Michael Cc: R help Subject: Re: function on columns of two arrays Hi

[R] funtion equivalent of jitter to move figures on device

2013-03-12 Thread Folkes, Michael
hello all, I'm overlaying numerous scatter plots onto a map (done in PBSmodelling). In this case I'm placing each plot by setting par(fig) to the centroid of map polygons. The location/mapping part is not so important. There are cases of small overlaps for some plots (ie figures) so I'm keen to

Re: [R] funtion equivalent of jitter to move figures on device

2013-03-12 Thread Folkes, Michael
Thanks very much Peter, That may be a good start. Though I am aiming for automation and would prefer to avoid the locator function. I'll take a look... Michael -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: March 12, 2013 12:27 PM To: Folkes, Michael Cc: r-help

Re: [R] funtion equivalent of jitter to move figures on device

2013-03-12 Thread Folkes, Michael
I'm very grateful! Thanks Roy. -Original Message- From: Roy Mendelssohn - NOAA Federal [mailto:roy.mendelss...@noaa.gov] Sent: March 12, 2013 12:49 PM To: Folkes, Michael Cc: r-help@r-project.org Subject: Re: [R] funtion equivalent of jitter to move figures on device Hi Michael: I

Re: [R] funtion equivalent of jitter to move figures on device

2013-03-12 Thread Folkes, Michael
of that line I've defined. Multiple overlapping polygons will be ugly. I'll report back if I have any success. thank you all Michael From: Greg Snow [mailto:538...@gmail.com] Sent: March 12, 2013 2:46 PM To: Folkes, Michael Cc: r-help Subject: Re: [R] funtion

Re: [R] Amount of memory occupied by data type

2012-03-14 Thread Folkes, Michael
-Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: March 13, 2012 5:25 PM To: Folkes, Michael Cc: r-help@r-project.org Subject: Re: [R] Amount of memory occupied by data type On Mar 13, 2012, at 7:02 PM, Folkes, Michael wrote: Hello all, I was under the (false

[R] Amount of memory occupied by data type

2012-03-13 Thread Folkes, Michael
Hello all, I was under the (false?) assumption that an object that is class logical, would take up less memory than an object with class integer. Below am I correctly showing this is not the case? This was an attempt to reduce memory usage. I'm dealing with two large arrays (could be integers).

[R] acf() plot of matrix cuts y-axis labels

2012-03-02 Thread Folkes, Michael
Hello all, I found a funny problem with y-axis labels when plotting acf(matrix) - the labels are too close to one of the margins and cut in half. Here's the problem: test-matrix(rnorm(200),ncol=4) acf(test) This doesn't fix the problem: test-matrix(rnorm(200),ncol=4)

Re: [R] acf() plot of matrix cuts y-axis labels

2012-03-02 Thread Folkes, Michael
Thanks for the advice. I guess I should have read the acf help page more thoroughly to appreciate the role of plot.acf(). Typical. Thanks Duncan. -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: March 2, 2012 9:53 AM To: Folkes, Michael Cc: r-help@r

[R] Apply approx() to an array and eventually a list of arrays

2011-10-20 Thread Folkes, Michael
Hello all, I'm struggling to grasp how I might use lapply() instead of looping to run approx() on a list consisting of multiple arrays - each of equal dimension. But simpler than that, I haven't been able to successfully apply approx() to an array, unless I loop through the third dimension and

[R] as.POSIXct and time zones

2011-09-26 Thread Folkes, Michael
Hello all, I'm struggling with POSIXt objects. I've read the refman, the Rnews from 2001 and hopefully all the pertinent help pages. I'm running windows xp. It appears my time zone variable isn't set, which hopefully is fine for this exercise. Sys.getenv(TZ) TZ help(as.POSIXct) states:

[R] maptools::sunriset() daylight savings to stardard time change

2011-09-24 Thread Folkes, Michael
Hello all, After beating my head against the wall for a few hours, I give up. I have two problems. 1. If I use seq() to generate a POSIXct series that crosses a daylight savings to stardard time change I get two values for the first day of change. The time change is Nov 6,2011. The value for

Re: [R] Convert week value to date

2011-08-22 Thread Folkes, Michael
Here is my solution to produce a date value if your data set only has week values associated with data (ie no date). It gives the first monday of the week. Michael Folkes s - seq(as.Date(2010-01-01), as.Date(2010-12-31), by = day) #produce all days of the year

Re: [R] Convert week value to date

2011-08-18 Thread Folkes, Michael
and then I'd know the start of week 1 in each year, and multiply from there. Thanks Michael -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: August 17, 2011 2:38 PM To: Folkes, Michael Cc: r-help@r-project.org Subject: Re: [R] Convert week value to date On Aug 17

[R] Convert week value to date

2011-08-17 Thread Folkes, Michael
Hello all, I'm hoping to convert a decimal value for week of the year back to a date object. Eg: strptime(paste(2010,1:52,sep= ),format=%Y %W) I expected (hoped?) this would give me the date for Monday of each week. Instead, it's giving me 52 values of today's date. Where am I erring? Thanks

[R] RODBC excel - need to preserve (or extract) numeric column names

2011-04-04 Thread Folkes, Michael
I'm using RODBC to read an excel file (not mine!). But I'm struggling to find a way to preserve the column names that have a numeric value. sqlFetch() drops the value and calls them f1, f2, f3,... (ie field number). this is a different approach from read.csv, which will append V prior to the

[R] Package XML: Parse Garmin *.tcx file problems

2011-03-30 Thread Folkes, Michael
I'm struggling with package XML to parse a Garmin file (named *.tcx). I wonder if it's form is incomplete, but appreciably reluctant to paste even a shortened version. The output below shows I can get nodes, but an attempt at value of a single node comes up empty (even though there is data there.

[R] repeat matrix column within each array third dimension

2011-03-08 Thread Folkes, Michael
Hello all, I'm working with a matrix that will have varying dimensions. It will populate an array such that the number of matrix columns will determine the number of 3rd dimension levels of the array. Rows will be the same for both. For this example lets say the array will have 2 columns,

Re: [R] Floating points and floor() ?

2011-03-04 Thread Folkes, Michael
This was most helpful Rex. It makes clear how I can compensate for the matter. Too bad it's not March 15, I could declare beware the 0.Ides of March! Michael -Original Message- From: rex.dw...@syngenta.com [mailto:rex.dw...@syngenta.com] Sent: Thu 03/03/2011 8:24 PM To: Folkes, Michael

[R] Floating points and floor() ?

2011-03-03 Thread Folkes, Michael
Perhaps somebody could clarify for me if the following is a floating point matter or otherwise, and how am I to correct for it? floor(100*.1) [1] 10 100*(1.0-.9) [1] 10 floor(100*(1-0.9)) [1] 9 Thanks! Michael ___ Michael Folkes Salmon

[R] binomial dist: obtaining probability of success on each trial

2011-01-26 Thread Folkes, Michael
I'm trying to fathom how to answer two example problems (3.3.2 3.3.3) in: Krishnamoorthy. 2006. handbook of statistical distributions with applications The first requires calculating single trial probability of success for a binomial distribution when we know: trial size=20, successes k=4,

[R] order matrix by column position

2010-12-09 Thread Folkes, Michael
Hello all, I'm trying to grasp a way to order a matrix by giving order() only a vector of the columns it can look to for sorting. The approach has to be generic such that I can feed order() a vector of variable length (ie varying # of columns to sort by). x-rep(1,9) y-c(1, 1, 2, 2, 2, 1, 2, 2,

Re: [R] order matrix by column position

2010-12-09 Thread Folkes, Michael
Pacific Biological Station 3190 Hammond Bay Rd. Nanaimo, B.C., Canada V9T-6N7 Ph (250) 756-7264 Fax (250) 756-7053 michael.fol...@dfo-mpo.gc.ca -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Thu 09/12/2010 2:34 PM To: Folkes, Michael Cc: r-help@r

[R] lattice: passing multiple lty values to the key/legend

2009-10-08 Thread Folkes, Michael
hi all, It's not clear to me how (or if) I can pass multiple values for lty to a key in xyplot? I've tried: lines=list(lty=1:3), to no avail. Do I need to use something other than auto.key? (Deepayan, if you're out there, I have your book and must admit the answer isn't jumping out at me.)

[R] problem understanding factor levels for use lattice panel order

2009-10-08 Thread Folkes, Michael
Hello all, In order to get the desired order of panels within lattice I realized I needed to define my factor levels. I now see how to properly do it (attached code), but: 1. I don't understand why I have to use factor() on a variable that is already a factor, and why levels() alone doesn't work

[R] contour plot, failing to interpolate through all data

2008-11-04 Thread Folkes, Michael
I'm having trouble making contour lines for this attached, sparse dataset (low data:NA ratio!). Is it the high number of NA's, or funny layout of the densities, or something else that's causing this? This is a subsample of the dataset, and I get the same problem when using the full data. The

[R] Console size/location on start-up in SDI mode

2008-10-27 Thread Folkes, Michael
Does anybody have a recommended code/method for setting start-up location and window size of the console when working in SDI mode? I use tinn-r, which is already splitting my desktop in half for tinn-r and the console. I'd like to see the console in the bottom, right corner to allow for a

Re: [R] Lattice: par.ylab.text alpha ?

2007-11-01 Thread Folkes, Michael
wohoo! A bug. I know I wasn't the first to find it, but I had a hunch this time that it was going to be a bug and not just my poor understanding. I wasn't really thinking as just ylab= works fine too. I think I was hoping to squeeze it (the ylab) closer to the axis w/o axis labels. Now

[R] Lattice: par.ylab.text alpha ?

2007-10-31 Thread Folkes, Michael
Hi all, I've got R for windows 2.3.1 I'm trying to modify my lattice histograms. The following does reset the y-label to blue, but I cannot turn off the label (alpha=0), nor shift label position (I'm assuming that is what lineheight is for). Is 'lineheight' the equivalent of 'line' in mtext? Am

[R] parse in text function of plots, confusing behaviour

2007-09-24 Thread Folkes, Michael
HI all, I'm failing to understand why the following is happening. In this plot I rely on two text functions both using parse. The second one works properly by writing a gamma symbol 5 times, the first one only works properly four times. The only difference is that I add a string to the paste

Re: [R] parse in text function of plots, confusing behaviour

2007-09-24 Thread Folkes, Michael
To: Folkes, Michael Cc: [EMAIL PROTECTED] Subject: Re: [R] parse in text function of plots, confusing behaviour On 24/09/2007 5:55 PM, Folkes, Michael wrote: HI all, I'm failing to understand why the following is happening. In this plot I rely on two text functions both using parse. The second one