search for: southampton

Displaying 20 results from an estimated 316 matches for "southampton".

2005 Nov 17
3
changing figure size in Sweave
...o=FALSE, print=FALSE, fig=TRUE>>= options(SweaveHooks=list(fig=function() ps.options(width=1))) library(graphics) pairs(iris) @ but this didn't change the size of the figure. How to make the figures a different size? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2006 Sep 13
3
functions and strings
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, Southampton SO14 3ZH, UK tel 023-8059-7743
2006 Feb 22
3
elements that appear only once
...s only one ash and only one elm in my wood. My Best Effort: > names(table(a)[table(a)==1]) [1] "ash" "elm" > This doesn't seem particularly elegant to me; there must be a better way! anyone? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2008 Mar 26
5
S4 slot with NA default
...ototype=list(x=NaN)) [1] "foo" > But this is not the correct sense: to me "NaN" means "not a number" and I want the sense to be "not available". Any advice? -- Robin Hankin Uncertainty Analyst and Neutral Theorist, National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2007 Mar 19
3
character to numeric conversion
...8481929, 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 Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2005 Jan 07
1
Visualizing complex analytic functions using domain coloring
...one coded up domain colouring for visualizing complex analytic functions (such as elliptic functions)? [ the idea is to depict a complex function f(z) using a filled.contour() variant in which the hue is given by Arg(f(z)), and the saturation by Mod(f(z)). ] -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2006 Jul 27
4
inserting rows into a matrix
...(c(1,0,0,2,4,0,3),c(2,0,0,3,5,0,4),c(3,0,0,4,2,0,1)) [,1] [,2] [,3] [1,] 1 2 3 [2,] 0 0 0 [3,] 0 0 0 [4,] 2 3 4 [5,] 4 5 2 [6,] 0 0 0 [7,] 3 4 1 > anyone? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2006 Feb 28
2
lines() and recycled colours
...t;green")) > then all ten lines are red, with no warning given. Is there a reason why colour recycling would be a bad idea in this case? Also, it would be nice if arguments such as lwd were recycled if needed too. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2005 Jan 05
4
output from table() in matrix form
...there a better way? It seems inelegant to coerce a character vector back to integers, but OTOH it's wasteful to have 20 bins when I only need 3. My real application would have maybe a dozen distinct (prime) integers in the range 2 up to about 1e4. -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2006 Oct 13
5
combinatorics
...tinguishable 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? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2007 Jan 16
5
"[[" gotcha
...he 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 Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2006 Jul 25
2
pari/gp interface
...Or any ideas for a more portable method than the one above? [ PARI/GP is a widely used computer algebra system designed for fast computations in number theory. It is freely available at http://pari.math.u-bordeaux.fr/ ] -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2006 Nov 17
2
do.call("+", ...)
...two arguments Also, > do.call(sum,sapply(1:4,f,simplify=FALSE)) [1] 2828 doesn't do what I want (I would like a 2x3 matrix 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
2005 Jun 13
3
extracting components of a list
...] ==4 which in this case would be the first and third of jj, viz list (jj[[1]],jj[[3]]). How to do this efficiently? My only idea was to loop through jj, and set unwanted components to NULL, but FAQ 7.1 warns against this. -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2007 Dec 19
3
array addition
...t; x [,1] [,2] [,3] [,4] [,5] [1,] 2 7 12 7 9 [2,] 4 9 14 8 10 [3,] 3 6 9 0 0 > Note the zeros at lower-right. Is there a ready-made solution to this? -- Robin Hankin Uncertainty Analyst and Neutral Theorist, National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2005 Jul 12
3
elegant matrix creation
...ries get multiplied by successive elements of x, starting with x[i], after the first "1" As one goes along a row, one takes a product of the tail end of x, until the zeroes kick in. Am I missing some clever solution? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2006 Dec 14
4
two connected graphs
...tain A (10 points) and the upper graph to contain B (six points). The x-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
2006 May 23
1
package installation problem
...#39;/Library/Frameworks/R.framework/Versions/2.3/Resources/ library/mvtnorm' ** Restoring previous '/Library/Frameworks/R.framework/Versions/2.3/ Resources/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
2006 Apr 27
2
summary(lm(x~y)) difference between R-2.2.1 and R-2.3.0
...863613052272, 0.691317410416682, 0.468099457217023, 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 tel 023-8059-7743
2005 Jun 20
6
sweep() and recycling
...() had given a warning, I would have found my mistake much faster. Could we make sweep() issue a warning under these circumstances or, failing that, add a warning to sweep.Rd saying that no warning is given in cases like this? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743