Re: [R] Efficient sampling from a discrete distribution in R

2007-09-04 Thread Robin Hankin
> R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanogra

Re: [R] Incomplete Gamma function

2007-09-03 Thread Robin Hankin
-------- > E-Mail: (Ted Harding) <[EMAIL PROTECTED]> > Fax-to-email: +44 (0)870 094 0861 > Date: 01-Sep-07 Time: 15:49:57 > -- XFMail -- > > _

Re: [R] Incomplete Gamma function

2007-08-31 Thread Robin Hankin
On 31 Aug 2007, at 14:06, Prof Brian Ripley wrote: > On Fri, 31 Aug 2007, Robin Hankin wrote: > >> Hi Kris >> >> >> lgamma() gives the log of the gamma function. > > Yes, but he used Igamma. According to ?pgamma, > > 'pgamma' is c

Re: [R] Incomplete Gamma function

2007-08-31 Thread Robin Hankin
hz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southam

Re: [R] Behaviour of very large numbers

2007-08-31 Thread Robin Hankin
)-exp(438120)i -exp (437610)-exp(437610)i [10] -exp(437100)-exp(437100)i > -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch mailin

[R] integration over a simplex

2007-07-10 Thread Robin Hankin
that all(p>0) and sum(p)=1 mean that the support of the Dirichlet distribution is an n-simplex. ] -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-h

Re: [R] (no subject)

2007-07-06 Thread Robin Hankin
___ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-co

[R] vectorize a function

2007-06-22 Thread Robin Hankin
a <- c(1,2,1,1,3) f(a,M) gives the total penalty. QUESTION: how to rewrite f() so that it has no loop? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 ___

Re: [R] How to create .rda file to be used in package building

2007-06-21 Thread Robin Hankin
elp@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Cent

Re: [R] data.frame

2007-06-18 Thread Robin Hankin
h mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southamp

[R] triangle contour plots

2007-06-18 Thread Robin Hankin
e only scatterplots, AFAICS -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/

Re: [R] besselK

2007-06-14 Thread Robin Hankin
lman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 02

Re: [R] Filling array: No recycling

2007-05-03 Thread Robin Hankin
h.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Centr

Re: [R] Inflate/Expand/Resize an array

2007-04-27 Thread Robin Hankin
[replying to myself] it might be better to use sweep(f,(1:6)[-2],m,"+") instead. On 27 Apr 2007, at 11:56, Robin Hankin wrote: > Hi > > > f.dims <- c(10,25,1,1,1,14) > m.dims <- c(10, 1,1,1,1,14) > f <- array(1:prod(f.dims),f.dims) >

Re: [R] Inflate/Expand/Resize an array

2007-04-27 Thread Robin Hankin
n me out here... > > Cheers, > > Mark > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html &g

Re: [R] A problem about all possible sequences

2007-04-17 Thread Robin Hankin
. > > Thanks in advance, > > Paul > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provid

Re: [R] Find zeros of analytic functions

2007-04-16 Thread Robin Hankin
lex functions. The "elliptic" package includes function newton.rapheson() for this, in addition to other utilities for analyzing complex functions. HTH -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK t

[R] quick legend() question

2007-03-22 Thread Robin Hankin
t;,"black"),lwd=c(0,0,3)) } doesn't quite work as desired: the third symbol in the legend is not the right line width. Replacing TRUE with FALSE doesn't work as desired either; the first two symbols end up with a line I don't want. The same happens with lwd=c(NA,NA,3).

Re: [R] character to numeric conversion

2007-03-19 Thread Robin Hankin
On 19 Mar 2007, at 11:20, Robin Hankin wrote: > Hello everybody > > thanks for the tips. > > I *think* this should be the same thread > > > The manpage for system() says that lines of over 8095 > characters will be split. This is causing me problems. > How do

Re: [R] character to numeric conversion

2007-03-19 Thread Robin Hankin
ern=T) has "jj" split into three bits, which is upsetting my call. In my application the split occurs in the middle of a multi-digit number, which messes up my conversion to numeric? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way

Re: [R] order of values in vector

2007-03-19 Thread Robin Hankin
10 I'm most grateful for a tip! cheers, Tord > -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz

[R] character to numeric conversion

2007-03-19 Thread Robin Hankin
11800, 5.978569259122249264778017262, 4.499809670330265066808481929, 2.602689685444383764768503589, 0.E-38]" (the output is a single line). In a big run, the string may contain 10^5 or possibly 10^6 numbers. What's the recommended way to convert this to a numeric vector? -- Robin Hankin Uncertainty A

Re: [R] enumerating non-overlapping pairs of elements from a vector

2007-03-05 Thread Robin Hankin
aborate looping and checking scheme. No doubt > this is a lapse in my understanding of combinatorics. Any help would > be greatly appreciated > > cheers, > a. > > __________ > R-help@stat.math.ethz.ch mailing list > https://stat.et

Re: [R] merge two colums

2007-02-27 Thread Robin Hankin
; > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducibl

Re: [R] 3F2 hypergeometric function

2007-02-22 Thread Robin Hankin
elp@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography

Re: [R] Generating MVN Data

2007-02-13 Thread Robin Hankin
.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Centr

Re: [R] blockwise matrix multiplication

2007-02-09 Thread Robin Hankin
Wow. It generalizes nicely to arbitrary dimensional arrays too. thanks a lot! rksh On 9 Feb 2007, at 14:19, Gabor Grothendieck wrote: > Try this: > > A * M[as.matrix(expand.grid(x,x))[,2:1]] > > > On 2/9/07, Robin Hankin <[EMAIL PROTECTED]> wrote: >> Hi &

[R] blockwise matrix multiplication

2007-02-09 Thread Robin Hankin
,4,4) how do I partition A according to the equivalence classes of the elements of x and "block multiply" by M? I want for(i in 1:4){for(j in 1:4){ A[which(x==i),which(x==j)] <- A[which(x==i),which(x==j)]*M[i,j] }} Is there a better way than this ghastly for() loop? -- Robi

Re: [R] circle fill problem

2007-02-08 Thread Robin Hankin
; quite a few hits on these and similar problems. > So at least the 3-d case the problem has been solved (I imagine the > problem is easier in 2-d ...) > hth, Ingmar > > On 8 Feb 2007, at 09:52, Robin Hankin wrote: > >> Mini >> >> This is a hard problem in

Re: [R] circle fill problem

2007-02-08 Thread Robin Hankin
uide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch mailing lis

Re: [R] Need help writing a faster code

2007-02-01 Thread Robin Hankin
gt; Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/ > Varadhan.html > > > > -- > -- > > > > > > [[alternative HTML version deleted]] > >

Re: [R] Index mapping on arrays

2007-02-01 Thread Robin Hankin
ng you and many thanks in advance > for any help. > > Best wishes, Demi Anderson. > -- > "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > P

Re: [R] jump in sequence

2007-01-30 Thread Robin Hankin
> __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, repr

Re: [R] Permutation problem

2007-01-30 Thread Robin Hankin
___ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncert

Re: [R] curious about dimension of 'apply' output when MARGIN=1

2007-01-18 Thread Robin Hankin
Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UKFax: +44 1865 272595 > > ______ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r

[R] "[[" gotcha

2007-01-16 Thread Robin Hankin
ore elements supplied than there are to replace > The error is given because after B[[1]] <- a, the variable B is just a scalar and not a matrix (why is this?) What's the bulletproof method for assigning matrices to a list (whose length is not known at runtime)? -- Robin H

[R] [R-pkgs] Dummy's guide to S4 methods: package Brobdingnag

2007-01-12 Thread Robin Hankin
b and glub) and one virtual class (swift). The package includes a vignette that is a step-by-step guide to using S4 methods in the context of an R package. Enjoy Robin -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK

[R] image() and nonsquare matrices

2007-01-12 Thread Robin Hankin
axis(side=1,pos=0) # No good because the x axis label is floating far from the x axis. Try 3: image(1:20,1:5,a,asp=1,axes=F,xlab="",ylab="") axis(side=1,pos=0) # No good because the x axis label is absent. How to use image() with a non-square matrix and make axes and

Re: [R] Software for kriging

2007-01-04 Thread Robin Hankin
_ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hanki

Re: [R] write() gotcha

2006-12-18 Thread Robin Hankin
On 18 Dec 2006, at 08:50, Prof Brian Ripley wrote: > On Mon, 18 Dec 2006, Robin Hankin wrote: > >> Hi >> >> I used write() the other day to save some results. > > Why not save()? It is the only way to preserve the results exactly. > >> It seems that write(

[R] write() gotcha

2006-12-18 Thread Robin Hankin
$os [1] "darwin8.7.0" $system [1] "powerpc, darwin8.7.0" $status [1] "" $major [1] "2" $minor [1] "4.0" $year [1] "2006" $month [1] "10" $day [1] "03" $`svn rev` [1] "39566" $language [1] "R" $versi

[R] two connected graphs

2006-12-14 Thread Robin Hankin
-axes of the two graphs must line up. I then want to draw straight lines that connect points of B to a particular point (or points) of A. How do I do this? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743

Re: [R] Welcome to the "R-help" mailing list

2006-12-14 Thread Robin Hankin
d the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __

Re: [R] backticks

2006-12-04 Thread Robin Hankin
Peter Aha! so R backticks work just like bash backticks (duh!) unless they are on the LHS of an assignment. [We bash people now use $(...) instead] Could we add something to this effect to Quotes.Rd? rksh On 4 Dec 2006, at 14:33, Peter Dalgaard wrote: > Robin Hankin wrote: >&

[R] backticks

2006-12-04 Thread Robin Hankin
e no guarantees that formulae using non-syntactic names such as `like this` will be accepted. What exactly do backticks do that single or double quotes don't? Where do I look for documentation on this? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European W

Re: [R] analog to the matlab buffer function?

2006-12-01 Thread Robin Hankin
gt; Medicine > E mailto:[EMAIL PROTECTED] UC San Diego > http://biostat.ucsd.edu/~cberry/ La Jolla, San Diego > 92093-0717 > > ______ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] t.test()

2006-11-24 Thread Robin Hankin
On 23 Nov 2006, at 13:46, Peter Dalgaard wrote: > Robin Hankin <[EMAIL PROTECTED]> writes: > >> Hi >> >> I have a vector x of length n. I am interested in x[1] >> being different from the other observations (ie x[-1]). >> [snip] >> >> W

Re: [R] t.test()

2006-11-23 Thread Robin Hankin
ot say. ~William W. Watt > > A statistical analysis, properly conducted, is a delicate > dissection of > uncertainties, a surgery of suppositions. ~M.J.Moroney > > -Oorspronkelijk bericht- > Van: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Namens Robin Hankin &

[R] t.test()

2006-11-23 Thread Robin Hankin
to t.test() to test my null? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] do.call("+", ...)

2006-11-17 Thread Robin Hankin
;- nargs()) == 1) ..1 else { > l <- list(...) > do.call("++",l[-n]) + l[[n]] > } > Aha, the dreaded "..1" argument. Where do I look for documentation on this? [It is mentioned twice in The R Language Definition, but I'm no wiser] -- Robin Hankin Unc

Re: [R] do.call("+", ...)

2006-11-17 Thread Robin Hankin
"class") > [1] "mymatrix" > > Duncan Murdoch > > ______ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > gu

Re: [R] filling an array, vectorized

2006-11-17 Thread Robin Hankin
dim(a)) n <- length(dim(a)) d <- dim(a)[i] permute <- c(i, (1:n)[-i]) a <- aperm(a, permute) a[] <- p permute[permute] <- 1:n return(force.integer(aperm(process(a, d), permute))) } -- Robin Hankin Uncertainty Analyst National Oceanograp

Re: [R] do.call("+", ...)

2006-11-17 Thread Robin Hankin
x((1:6)^i, 2, 3)} > do.call("++", sapply(1:4, f, simplify=FALSE)) > > ## > >> "++" <- function(x, ...) if (nargs() == 1) x else x + Recall(...) >> f <- function(i){matrix((1:6)^i, 2, 3)} >> do.call("++", sapply(1:4, f, simplify=

[R] do.call("+", ...)

2006-11-17 Thread Robin Hankin
whose elements are the sum of corresponding elements in my list) How to do this nicely? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.ma

Re: [R] filling an array, vectorized

2006-11-16 Thread Robin Hankin
) > b <- array(0,c(2,2,2,2)) > identical(do.index(b, f), do.index2(b, f)) > > > On 11/16/06, Robin Hankin <[EMAIL PROTECTED]> wrote: >> Tamas >> >> first of all, Thank You for a really well-posed, interesting problem. >> Answer follows. >> >

Re: [R] filling an array, vectorized

2006-11-16 Thread Robin Hankin
different lengths, I don't > know how many loops I would need beforehand. Is there a way to do > this? > > Thanks, > > Tamas > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PL

Re: [R] Multivariate regression

2006-10-30 Thread Robin Hankin
5 >>> >>> Email: [EMAIL PROTECTED] >>> >>> Webpage: >>> http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html >>> >>> >>> >>> >>> >>

Re: [R] combinatorics

2006-10-13 Thread Robin Hankin
ACBBA" > "BACBA" "ABCBA" > "BBACA" "BABCA" > [12] "ABBCA" "CBAAB" "BCAAB" "CABAB" "ACBAB" "BACAB" "ABCAB" > "CAABB" "ACABB" > "AACBB"

[R] combinatorics

2006-10-13 Thread Robin Hankin
Hi How do I generate all ways of ordering sets of indistinguishable items? suppose I have two A's, two B's and a C. Then I want AABBC AABCB AACBC ABABC . . .snip... BBAAC . . .snip... CBBAA [there are 5!/(2!*2!) = 30 arrangements. Note AABBC != BBAAC] How do I do this? -- Ro

Re: [R] Block comments in R?

2006-10-05 Thread Robin Hankin
't work for me: if(FALSE){" if(1<2) print("1<2") else print("1>2") "} returns an error. How would I comment out that block of (incorrect) code? > or "use a good editor that supports commenting and uncommenting > blocks&quo

Re: [R] A statement over multiple lines (i.e. the ... feature in Matlab)

2006-10-05 Thread Robin Hankin
On 5 Oct 2006, at 09:34, Bjørn-Helge Mevik wrote: > Robin Hankin wrote: > >> For the line breaking, R deals with incomplete lines by not >> executing the statement until you finish it. > > Beware, however, that syntactically valid lines do get executed > immediat

Re: [R] A statement over multiple lines (i.e. the ... feature in Matlab)

2006-10-05 Thread Robin Hankin
> would make reading my code much much easier. > > Cheers, > Wee-Jin > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posti

Re: [R] Some questions about plotting with R

2006-10-04 Thread Robin Hankin
s > device there as well. > > As for 3D stuff, you might take a look at persp() (in base R) and the > scatterplot3D package. If you want to see what R's Graphics can do, > then > the book R Graphics by Paul Murrell [1] will tell you all you need to > know, and the excell

Re: [R] How to generating diagnal blocks ?

2006-09-21 Thread Robin Hankin
40 > fax: 091 485726/485612 > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented

Re: [R] functions and strings

2006-09-13 Thread Robin Hankin
) > sin(tti) + cos(sin(tti^2)) > ## Or, closer to your example, using the name of the argument and body > ## of the function: > f <- function(r) > 2*r/sin(r) - b > >> rewrite.expression(body(f), 'foo', names(formals(f))

Re: [R] functions and strings

2006-09-13 Thread Robin Hankin
that does not occur in f(), > because of the > following example: > > f <- function(x){abcdefghijklmnopqrstuvwxyz(x^2)} > > > > > On 13 Sep 2006, at 09:08, Dimitris Rizopoulos wrote: > >> yes you're right, maybe this is better >> >>> f <

Re: [R] functions and strings

2006-09-13 Thread Robin Hankin
opoulos wrote: > yes you're right, maybe this is better > >> f <- function(x){sin(x)+exp(x)} >> strng <- gsub("(x)", "(xyz)", deparse(body(f))[2], fixed = TRUE) >> sub('^[[:space:]]+', '', strng) > [1] "sin(xyz) + exp

Re: [R] functions and strings

2006-09-13 Thread Robin Hankin
quot;sin(xyz) + exp(xyz)" On 13 Sep 2006, at 08:45, Dimitris Rizopoulos wrote: > strng <- gsub("x", "xyz", deparse(body(f))[2]) > sub('^[[:space:]]+', '', strng) -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton Eur

[R] functions and strings

2006-09-13 Thread Robin Hankin
Hi If string <- "xyz" f <- function(x){1 + sin(cos(x)) + exp(x^2)} How do I manipulate "string" and f() to give the string "1 + sin(cos(xyz)) + exp(xyz^2)" ? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Sout

Re: [R] exactly representable numbers

2006-09-11 Thread Robin Hankin
mid) u <- mid > else l <- mid > mid <- (l + u)/2 >} >u > } > thanks for this. Wouldn't it be a good idea to have some function that returns "the smallest exactly representable number strictly greater than x"? Or does this exist already? Robin

Re: [R] exactly representable numbers

2006-09-11 Thread Robin Hankin
resentable numbers right across the IEEE range] rksh On 11 Sep 2006, at 10:50, Sundar Dorai-Raj wrote: > > > Robin Hankin said the following on 9/11/2006 3:52 AM: >> Hi >> Given a real number x, I want to know how accurately R can >> represent numbers near x. &g

[R] exactly representable numbers

2006-09-11 Thread Robin Hankin
between these two. I have a little function that does some of this: f <- function(x,FAC=1.1){ delta <- x while(x+delta > x){ delta <- delta/FAC } return(delta*FAC) } But this can't be optimal. Is there a better way? -- Robin Hankin Uncertainty Analyst National Oc

Re: [R] What is the matrix version of min()

2006-09-06 Thread Robin Hankin
man/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK

Re: [R] Create a vector from another vector

2006-08-30 Thread Robin Hankin
d appreciate your time. > > Harold > > >>> >>> __ >>> R-help@stat.math.ethz.ch mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guide >>> http

Re: [R] Create a vector from another vector

2006-08-30 Thread Robin Hankin
t; R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst Nation

Re: [R] Create a vector from another vector

2006-08-30 Thread Robin Hankin
[alternative HTML version deleted]] > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented

Re: [R] Help with Functions

2006-08-29 Thread Robin Hankin
s://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography C

Re: [R] listing a sequence of vectors in a matrix

2006-08-22 Thread Robin Hankin
> R-help@stat.math.ethz.ch mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting- >> guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > ___

Re: [R] listing a sequence of vectors in a matrix

2006-08-22 Thread Robin Hankin
Hi > f <- function(a,n){(1:a)[1:n]} > t(sapply(c(2,3,4,4,4,5,6),f,n=5)) [,1] [,2] [,3] [,4] [,5] [1,]12 NA NA NA [2,]123 NA NA [3,]1234 NA [4,]1234 NA [5,]1234 NA [6,]12345 [7,]1

[R] big numbers

2006-08-22 Thread Robin Hankin
x27;t deal with log(a) and log(b), follows. f <- function(a,n=100){ out <- rep(0,n) out[1] <- a for(i in 2:n){ out[i] <- sum(exp(out[1:i])) + rexp(1) } return(log(out)) } then f(1,10) has infinities in it, even though the values should be moderate size. Wh

Re: [R] mirror vector?

2006-07-28 Thread Robin Hankin
__ >> R-help@stat.math.ethz.ch mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting- >> guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > ___

Re: [R] mirror vector?

2006-07-28 Thread Robin Hankin
istinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK

Re: [R] Help with matrix manipulation

2006-07-28 Thread Robin Hankin
out how to manipulate the entire matrix. > > Thanks much > > Kartik > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, m

Re: [R] inserting rows into a matrix

2006-07-27 Thread Robin Hankin
000 > [3,]000 > [4,]234 > [5,] 452 > [6,]000 > [7,]341 > > -Christos > > -Original Message- > From: Robin Hankin [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 27, 2006 10:16 AM > To:

Re: [R] inserting rows into a matrix

2006-07-27 Thread Robin Hankin
) == 0 ), ] <- rep(0,ncol(a3)) > a3 > > Essentially use the product to pick out the rows with at least one > 0 and > replace these rows with 0s. > > HTH. > -Christos > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf O

[R] inserting rows into a matrix

2006-07-27 Thread Robin Hankin
000 [7,]341 > anyone? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/

Re: [R] how to resample (or resize) matrix?

2006-07-27 Thread Robin Hankin
s the problem you are trying to solve? > > [[alternative HTML version deleted]] > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/pos

[R] Stirling numbers

2006-07-19 Thread Robin Hankin
Hi anyone coded up Stirling numbers in R? [I need unsigned Stirling numbers of the first kind] cheers Robin -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743

Re: [R] par(mfrow,mai) and multiple plot problem

2006-07-10 Thread Robin Hankin
Jul 2006, at 10:27, Joris De Wolf wrote: > Check > ?layout > > It gives you more flexibility than > par(mfrow=c(a,b)) > > For instance, you can define your margins between the graphs as > cells in the layout without filling them by a plot. > > Joris > > >

[R] par(mfrow,mai) and multiple plot problem

2006-07-10 Thread Robin Hankin
le="~/f.ps",width=5,height=7) par(mfrow=c(4,3)) f(main="t=1",ylab="fish") f(main="t=2") f(main="t=3") f(ylab="dog") f() f() f(ylab="slug") f() f() f(ylab="pig") f() f() dev.off()

[R] combining tables

2006-06-19 Thread Robin Hankin
e(c (cats=7,squid=7,pigs=2,dogs=6,slugs=3,crabs=0))) cats squid pigs dogs slugs crabs 7 7 2 6 3 0 > Note that we have 7 cats altogether, and the crabs correctly show as zero counts. How to do this nicely in R? -- Robin Hankin Uncertainty Analyst Nationa

[R] [R-pkgs] new package on CRAN

2006-05-30 Thread Robin Hankin
quare of a partition. I would be very interested to hear any comments or suggestions that the List may have. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 ___

Re: [R] package installation problem

2006-05-23 Thread Robin Hankin
/gcc4.0/bin/ Now the second problem is that the file for -lgfortran can't be found. To solve this, add FLIBS=-L/usr/local/gcc4.0/lib to the Makevars file. best wishes rksh On 23 May 2006, at 08:25, Robin Hankin wrote: > (this after asking the package author) > > Hi > >

[R] package installation problem

2006-05-23 Thread Robin Hankin
rces/library/mvtnorm' Robin-Hankins-Computer:~/scratch% anyone? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch mailing list http

Re: [R] Matrix in 3D

2006-05-22 Thread Robin Hankin
s://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide! http://www.R-project.org/posting- >> guide.html > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE

Re: [R] sparklines

2006-05-17 Thread Robin Hankin
ad the posting guide! http://www.R-project.org/posting- > guide.html -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-help@stat.math.ethz.ch mailing list https:

Re: [R] sparklines

2006-05-17 Thread Robin Hankin
_ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting- > guide.html -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton Eu

[R] Legendre symbols

2006-05-02 Thread Robin Hankin
(mod p) * −1 if not [courtesy Wikipedia] ] I might also need Jacobi's generalization of this. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R

Re: [R] summary(lm(x~y)) difference between R-2.2.1 and R-2.3.0

2006-04-27 Thread Robin Hankin
Check and see > if your > data needs the attributes to remain in order to function properly. > > > > On 4/27/06, Robin Hankin <[EMAIL PROTECTED]> wrote: >> >> Hi >> -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European W

[R] summary(lm(x~y)) difference between R-2.2.1 and R-2.3.0

2006-04-27 Thread Robin Hankin
, 0.573507201772172, 0.335523922927148, -0.736834541760754, -0.903503651131917, -0.877903767920926, 0.0943505569140546, 0.370818730053123, 0.366310076543096, 0.6119 [snip] -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK

  1   2   3   4   >