[R] Plotting dendrogram upside-down/mirrored

2011-01-18 Thread Nathan S. Watson-Haigh
on the bottom and leaves at the top (in horizontal orientation) or root on the right and leaves to the left (in vertical orientation)? Cheers, Nathan -- -- Dr. Nathan S. Watson-Haigh Tel: +61 (0)7 4753 8548 OCE Postdoctoral

[R] Intersect, Union of date/time ranges

2010-03-17 Thread Nathan S. Watson-Haigh
. return the start/end date/time ranges which are in 1 or both sets Is there anything that is currently able to do this? If not, I'll start to code something. Kind regards, Nathan -- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow

[R] Superimpose ksmooth() onto barplot

2010-02-09 Thread Nathan S. Watson-Haigh
ol=as.numeric(as.factor(rownames(d)))[2]) legend("topright", c(rownames(d), "Total"), fill=c(as.numeric(as.factor(rownames(d))), "blue")) Cheers, Nathan -- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIR

Re: [R] Help with apply()

2010-02-08 Thread Nathan S. Watson-Haigh
On 8/02/2010 4:33 PM, Jim Lemon wrote: On 02/08/2010 12:26 PM, Nathan S. Watson-Haigh wrote: I have a 2 column data.frame: > d[1:5,] a b 1 80015 C 2 80016 B 3 80023 C 4 80062 B 5 80069 B I want to apply a function across each row: > for(i in 1:nrow(d)) { + myFun(con, d[i,]$

Re: [R] Help with apply()

2010-02-08 Thread Nathan S. Watson-Haigh
On 8/02/2010 2:08 PM, David Winsemius wrote: On Feb 7, 2010, at 8:26 PM, Nathan S. Watson-Haigh wrote: I have a 2 column data.frame: d[1:5,] a b 180015 C 280016 B 380023 C 480062 B 580069 B I want to apply a function across each

[R] Help with apply()

2010-02-07 Thread Nathan S. Watson-Haigh
how to tell apply() to pass data from columns a and b for a given row as arguments to the function myFun(). Thanks in advance for any pointers, Nathan -- ---- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Unive

[R] RMySQL - Bulk loading data and creating FK links

2010-01-27 Thread Nathan S. Watson-Haigh
ert! Any pointers welcome, Nathan -- ------------ Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries University Drive Townsville, QLD 4810 Australia Tel: +61 (0)7 4753 8548 Fax: +61 (0)7 4753 8600 Web: http://www.csiro

Re: [R] Bulk Match/Replace

2010-01-26 Thread Nathan S. Watson-Haigh
I knew it should be simple . but only if you know how!! Thanks, works a treat!! Nathan Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries University Drive Townsville, QLD 4810 Australia Tel: +61 (0)7 4753

[R] Bulk Match/Replace

2010-01-26 Thread Nathan S. Watson-Haigh
d value from lookup table df? I'd expect the following output: > v [1] "1" "2" "2" "4" "2" "4" "2" "2" "4" "2" "1" "2" "2" "1&qu

[R] RMySQL Append data.frame to table

2010-01-24 Thread Nathan S. Watson-Haigh
oad data into table Can anyone shed light on this error, or how I might bulk load this data using RMySQL? Cheers, Nathan -- ------------ Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries University Drive Townsville, QL

[R] decompress tar.gz and zip files

2010-01-12 Thread Nathan S. Watson-Haigh
Can anyone point me in the right direction for decompressing text files that are compressed as tar.gz or zip files? Cheers, Nathan -- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries University Drive

Re: [R] Converting indices of a matrix subset

2009-07-09 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Steven, This looks great. Thanks! Nathan Steve Lianoglou wrote: > Hi Nathan, > > On Jul 8, 2009, at 10:20 PM, Nathan S. Watson-Haigh wrote: > >> I have two matrices: >> >>> m1 <- matrix(1,4,4) >>&g

[R] Converting indices of a matrix subset

2009-07-08 Thread Nathan S. Watson-Haigh
0010 [4,]0001 Any thoughts? Cheers, Nathan - -- - ---- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia, QLD 4067 Australia Tel: +61 (0)7 3214 2922 Fax: +6

[R] Coerce rectangular matrix to symmetrical square matrix

2009-06-17 Thread Nathan S. Watson-Haigh
9 10 11 12 Would be coerced to: A B C D E F A 1 2 3 4 5 9 B 2 0 0 0 6 10 C 3 0 0 0 7 11 D 4 0 0 0 8 12 E 5 6 7 8 0 0 F 9 10 11 12 0 0 Any thoughts on how to achieve this? Cheers, Nathan - -- - Dr. Nat

Re: [R] Identifying clusters of size n

2009-06-14 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dylan Beaudette wrote: > On Sun, Jun 14, 2009 at 4:39 PM, Nathan S. > Watson-Haigh wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Is there a library which is capable of identifying distinct clusters of

[R] Identifying clusters of size n

2009-06-14 Thread Nathan S. Watson-Haigh
--- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia, QLD 4067 Australia Tel: +61 (0)7 3214 2922 Fax: +61 (0)7 3214 2900 Web: http://www.csiro.au/people/Nathan.Watson-

[R] Package Licences

2009-05-28 Thread Nathan S. Watson-Haigh
Are there any particular licences under which R packages must be released or is it the discretion of the author? The same question if the package is to be destined for CRAN? Kind regards, Nathan -- Dr. Nathan S. Watson-Haigh OCE Post

Re: [R] Splitting Area under curve into equal portions

2009-03-25 Thread Nathan S. Watson-Haigh
) )) > aggregate(work, list(number.groups.list), sum) > plot(work, col=number.groups.list) > > Regards a lot, > > miltinho > brazil > > On Wed, Mar 25, 2009 at 9:48 PM, Nathan S. Watson-Haigh > wrote: > > I have some data generated as follows: > >

[R] Splitting Area under curve into equal portions

2009-03-25 Thread Nathan S. Watson-Haigh
------------- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia, QLD 4067 Australia Tel: +61 (0)7 3214 2922 Fax: +61 (0)7 3214 2900 Web: htt

[R] Rmpi - send/receive multiple objects to slaves

2009-03-24 Thread Nathan S. Watson-Haigh
copy all zero values from this node's result to the master result object m_pcit[message$result] <- 0 } else if (tag == 3) { # A slave has closed down. closed_slaves <- closed_slaves + 1 } } mpi.close.Rslaves() - -- -

[R] Create package with Fortran 90 and C code

2009-02-16 Thread Nathan S. Watson-Haigh
an anyone suggest what I might do to solve this? Cheers, Nathan - -- - ------------ Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia, QLD 4067 Australia Tel: +61 (0)7 3214 2922 F

Re: [R] Looping over a matrix passed to .C

2009-02-11 Thread Nathan S. Watson-Haigh
; You can use each of the columns as x,y,z values and compute everything at > once. > > On Tue, Feb 10, 2009 at 9:49 PM, Nathan S. Watson-Haigh > wrote: > I've written a function in R which takes a symmetrical matrix as input and > processes all triplicate combinations of

[R] Looping over a matrix passed to .C

2009-02-10 Thread Nathan S. Watson-Haigh
th n*m. Could someone help/guide me in implementing this? Cheers, Nathan - -- - ---- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia, QLD 4067 Australia Tel: +61 (0)7 3214 2922 Fax: +6

[R] pairs() help - colour histograms on diagonal

2009-02-02 Thread Nathan S. Watson-Haigh
breaks[-1], y, ...) } pairs(d, upper.panel=panel.smooth, diag.panel=panel.hist) So I'd like the top-left histogram on the diagonal to be coloured black, then the next one on the diagonal to be coloured blue etc. Is this possible? Cheers, Nathan - -- - -----------

Re: [R] Precision in R

2009-01-14 Thread Nathan S. Watson-Haigh
;-sum(WB.i*WB.j) >} > } >} > > > === > Attention: The information contained in this message and...{{dropped:15}} > > __ >

[R] R package tests

2009-01-14 Thread Nathan S. Watson-Haigh
Are these approaches used for testing packages in CRAN? Cheers, Nathan - -- - ---- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia, QLD 4067 Australia Tel: +61 (0)7 3214 292

Re: [R] fitting curve to data

2009-01-11 Thread Nathan S. Watson-Haigh
,1700,1800,1900,2000,2100,2200,2300,2400,2500) > plot(x,y) > lines(x, predict(lm(y~I(x^2 > > >>>> "Nathan S. Watson-Haigh" 01/12/09 > 2:19 AM >>> > I have the following data: > >> y > [1] 0.000 0.004 0.008 0.016 0.024 0.032 0.044 0.064

[R] fitting curve to data

2009-01-11 Thread Nathan S. Watson-Haigh
Cheers, Nathan - -- - -------- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia, QLD 4067 Australia Tel: +61 (0)7 3214 2922 Fax: +61 (0)7 3214 2900 Web: http://www.csiro.au/people/Nathan.W

Re: [R] Understanding dsyrk_ in C code

2009-01-06 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Charles C. Berry wrote: > On Wed, 7 Jan 2009, Nathan S. Watson-Haigh wrote: > > I'm trying to understand some C code in an R package I'm using. I'm address > this question here as > it's matrix algebra...and I&#

[R] Understanding dsyrk_ in C code

2009-01-06 Thread Nathan S. Watson-Haigh
n being performed is: alpha*A*A' + beta*C However, since alpha is 1 and beta is 0, this reduces to: => 1*A*A' + 0*C => A*A' Which is simply the cross productam I correct? Cheers, Nath - -- - Dr. Nathan S. Wa

Re: [R] Memory Efficiency of Symmetric Matrix

2009-01-06 Thread Nathan S. Watson-Haigh
angle only) I'm just trying to test it out with my usual 24k x 24k size matrices. >> >> >> Fra: r-help-boun...@r-project.org på vegne af Nathan S. Watson-Haigh >> Sendt: on 07-01-2009 01:28 >> Til: r-h...@r-project.org >>

[R] Memory Efficiency of Symmetric Matrix

2009-01-06 Thread Nathan S. Watson-Haigh
I should be able to almost half the memory usage for large matrices. Any thoughts/comments? Cheers, Nathan - -- - ---- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia,

Re: [R] [ExternalEmail] Pearson Correlation Speed

2008-12-15 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Charles C. Berry wrote: > On Mon, 15 Dec 2008, Nathan S. Watson-Haigh wrote: > >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Nathan S. Watson-Haigh wrote: >>> I'm trying to calculate Pearson cor

Re: [R] [ExternalEmail] Pearson Correlation Speed

2008-12-14 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nathan S. Watson-Haigh wrote: > I'm trying to calculate Pearson correlation coefficients for a large > matrix of size 18563 x 18563. The following function takes about XX > minutes to complete, and I'd like to do this calculation a

[R] Pearson Correlation Speed

2008-12-14 Thread Nathan S. Watson-Haigh
to do some other work with the C++ code in order to allow me to use it from within my R scripts - any pointers on that? Thanks for any input - I hope I just need a hand over the initial hurdles and then I can get onto that up-hill learning curve!! Nathan - -- - -----