Displaying 20 results from an estimated 23 matches for "fitzjohn".
2005 Nov 23
3
Infinite recursion in S3 methods crashes R on windows (related to PR#8203?)
...ish_New Zealand.1252;LC_CTYPE=English_New
Zealand.1252;LC_MONETARY=English_New
Zealand.1252;LC_NUMERIC=C;LC_TIME=English_New Zealand.1252
Search Path:
.GlobalEnv, package:methods, package:stats, package:graphics,
package:grDevices, package:utils, package:datasets, Autoloads,
package:base
--
Rich FitzJohn
rich.fitzjohn <at> gmail.com | http://homepages.paradise.net.nz/richa183
You are in a maze of twisty little functions, all alike
2005 Apr 11
0
S4 group methods don't dispatch for "Summary"?
...me, and I cannot get Math, Math2 or Summary to work.
I presume I'm probably missing something, but am at a loss. I would
appreciate any pointers as to what I am doing wrong. I have run into
this problem on both Linux/R 2.0.1, and Windows/R 2.0.0 (will upgrade
soon!).
Thanks,
Rich
--
Rich FitzJohn
rich.fitzjohn <at> gmail.com | http://homepages.paradise.net.nz/richa183
You are in a maze of twisty little functions, all alike
--
Rich FitzJohn
rich.fitzjohn <at> gmail.com | http://homepages.paradise.net.nz/richa183
You are in a...
2005 Apr 13
0
terminate R program when trying to access out-of-bounds a rray element?
...nt, just check for it: Are any
values that are going to be used for indexing larger than the length of the
object? E.g.,
if (any(idx > length(x))) stop("index out of bound")
result <- x[i]
If this is still too much work for you, Perhaps R is not for you...
Andy
> From: Rich FitzJohn
>
> Hi,
>
> You could try redefining "[", so that if any element subsetted
> returned an NA, it would throw an error, e.g.:
> (Warning: Largely untested! - this will almost certainly cause
> problems in other classes that use [ to subset. Possibly defining
> th...
2019 Feb 11
1
make.unique rbind examples
...ot appear to be relevant to
that function, namely
rbind(data.frame(x = 1), data.frame(x = 2), data.frame(x = 3))
rbind(rbind(data.frame(x = 1), data.frame(x = 2)), data.frame(x = 3))
both producing
x
1 1
2 2
3 3
(identically) on R 3.4.3 and 3.5.1. Following a brief discussion on
Twitter, Rich FitzJohn [1] identified that under R 1.8.0 (circa 2003,
around the time these examples were added) the rownames for the output
of these lines was c("1", "11", "12"). This suggests that perhaps the
example was added to demonstrate behaviour which is no longer
supported.
A more...
2005 Apr 05
1
summing columns using partial labels
I have a dataset of the form
Year tosk.fai tosk.isd tosk.gr ....... tosk.total hysa.fai
hysa.isd ...
and so on. I want to sum all the columns using the first four letters in
the columns label(e.g. 'tosk', 'hysa' etc.). How can you do that? Also,
the sums should be without the '.total'column (e.g. 'tosk.total') as
this serves as a check that
2005 May 04
1
Questions about the intersection area under two kernel densities
Hi there,
I am working on a project which needs the value of the interaction area under two distributions( eatimated by kernel density estimators).
For example:
x<-rnorm(100,0,1)
y<-rnorm(100,0.2,1)
density(x) # This produces the summary of dependent variable and independent variable.
How can I get the individual values of variables and reform a curve to calculate the area under
2005 Apr 06
1
read.table with header and text data
Hi R!
I am reading in a text file which has one column of alpha data and 5 columns
of numeric data.
There is a header row.
I would like the alpha data column to just be character rather than factor.
Is there a way to do this, please? I'm thinking that it might be I() but
can't figure out exactly how.
Thanks,
Laura
mailto: lauraholt_983 at hotmail.com
R 2.0.1 Windows
2005 Apr 13
1
how to separate a string
hello,
i wonder how is string represent in R. if i have a string s= "hello", how can i refer to first character in the string s?
also if i have s1 = "hello.1", s2 = "ok.1", how can i separate the s1 into "hello" "1" and s2 into "ok" and "1"? I have tried to use the substring function, but i don't where i can get the index
2005 Apr 13
1
i param in "for" loop does not takes zeros?
Hi all
Is there any reason why the parameter i in a "for" loop ignores a value of
zero? For example
sim=c()
p=.2
for(i in 0:5)
{sim[i]=dbinom(i,5,p)
}
sim
[1] 0.40960 0.20480 0.05120 0.00640 0.00032
In this example the quantile i= 0 was ignored since
dbinom(0,5,p)
[1] 0.32768
The same behaviour occurs if I use a while loop to perform the same
calculation:
sim=c()
p=.2
i=0
2005 Apr 20
2
Suggestions for manipulating formula objects
I'm trying to manipulate/change a formula prior to passing it to another
function. A simplified example:
User passes formula to my function: y~x
My function does: lm(transform(y)~x)
Here, transform() is added to the model's response.
What is the best way to accomplish this?
2005 Apr 21
2
local average
Hello,
probably this isn't hard, but I can't get R to do this. Thanks for your
help!
Assume I have a matrix of two covariates:
n <- 1000
Y <- runif(n)
X <- runif(n,min=0,max=100)
data <- cbind(Y,X)
Now, I would like to compute the local average of Y for each X interval 0-1,
1-2, 2-3, ... 99-100. In other words, I would like to obtain 100 (local)
Ybars, one for each
2005 Apr 06
2
HP-UX and IRIX recent builds? Any other rare platforms?
I am revising the section in R-admin on platforms. When I asked about
locales earlier this year I got no reply about HP-UX and IRIX, so I will
presume that no one has built R on those OSes recently. If you have,
please send me the OS number and the flags you used.
Platforms where I have seen recent reports:
Linux
MacOS X
Solaris 8, 9, 10 (any Solaris 7 users please let me know)
AIX 5.1
2012 Apr 13
1
R: Colouring phylogenetic tip labels and/or edges
...r them in repeating sets of 3e.g. sp1=blue, sp.2=red, sp.3=yellow, sp.4=blue, sp5=red, sp6=yellow etc. I am also wondering how to colour the branches or edges as the states transition from one to another over time (i.e. as in the "Analyzing diversification with diversitree" manual by Rich FitzJohn on page 23).
Code I've been working with is below:
library(diversitree) #loads library
tree<-read.tree("tree")#loads tree
tree<-chronopl(tree, lambda=1,CV=TRUE) #converts to ultrametric
states<-read.delim("states", header=TRUE)#load states
head(states)
#match sta...
2005 Apr 07
2
vectorized approach to cumulative sampling
Hi All,
I need to sample a vector ("old"), with replacement, up to the point
where my vector of samples ("new") sums to a predefined value
("target"), shortening the last sample if necessary so that the total
sum ("newsum") of the samples matches the predefined value.
While I can easily do this with a "while" loop (see below for example
2005 Apr 04
3
plotting mathematical notation and values substitution
Dear R-users,
I'm trying to add a title on a plot with both mathematical notation and
values substitution. I read the documentation and search the mailing list
but I was not able to solve my problem. Actually, there is a message by
Uwe Ligges on June 2003 which addresses a question very close to mine, but
the code provided doesn't work. The code is the following:
# I add this to let you
2005 Apr 19
1
controlling the x axis of boxplots
v 2.0.1 (sooooh old!) on Win2k
I think I know the answer to this but I can hope ...
I have data for continuous variables (measures of residents) by a
categorical variable in range (1,22), the units in which they live.
I want to plot these data with a pair of boxplots one above another
with same x-axis (1,22) using par(mfrow=c(2,1)) and then plotting
first for the women then for the men.
2005 Apr 13
3
terminate R program when trying to access out-of-bounds array element?
I want R to stop running a script (after printing an
error message) when an array subscript larger than the
length of the array is used, for example
x = c(1)
print(x[2])
rather than printing NA, since trying to access such
an element may indicate an error in my program. Is
there a way to get this behavior in R? Explicit
testing with the is.na() function everywhere does not
seem like a good
2005 Apr 10
2
Plotting the occassional second label
Dear useRs,
I'm trying to plot spray quantities against dates, and label the points
on the plot. Basically quite simple, but sometimes two chemicals have
been used and are listed in separate rows in the table as below; then
the labels are written on top of each other.
> spray
SprayDate PD Trt Qwater Qai
1 2005-03-09 Spidermites Pegasus 1300 1.04
2
2005 May 11
2
time zones, daylight saving etc.
Hi, I have a whole bunch of data, which looks like:
15/03/2003 10:20 1
15/03/2003 10:21 0
15/03/2003 12:02 0
16/03/2003 06:10 0
16/03/2003 06:20 0.5
16/03/2003 06:30 0
16/03/2003 06:40 0
16/03/2003 06:50 0
18/03/2003 20:10 0.5
etc. (times given on a 24 hour clock)
and goes on for years. I have some code:
2006 Dec 17
2
X11 fonts and Ubuntu
Hi,
I am moving from Windows XP to Ubuntu 6.10 and installed R 2.4.0. When I
run eg plot.lm (things work fine with plot.default - eg
plot(rnorm(30),rnorm(30)))
plot(lmobject)
I can get the first plot and then this message:
Hit <Return> to see next plot:
Error in text.default(x, y, labels.id[ind],cex=cex, xpd=TRUE, :
could not find any X11 fonts
Check that the Font Path is correct