Dear List members
I am trying to find a way to generate a random point in a circle centred in a
geographical location.
So far I have used the following formula (see code below):
random_x = original_x + radius*cos(angle)
random_y = original_y + radius*sin(angle)
where radius is a random number
Hi Albert
On 07-Oct-06 Albert Picado wrote:
Dear List members
I am trying to find a way to generate a random point in a circle
centred in a geographical location.
So far I have used the following formula (see code below):
random_x = original_x + radius*cos(angle)
random_y = original_y +
When I am using Sweave to produce reports I get a strange Warning from latex:
LaTeX Warning: You have requested package `/usr/local/lib/R/share/texmf/Sweave',
but the package provides `Sweave'.
It seems to be completely harmless, but I wonder if it is a symptom of
installation
Göran Broström goran.brostrom at gmail.com writes:
When I am using Sweave to produce reports I get a strange Warning from latex:
LaTeX Warning: You have requested package
`/usr/local/lib/R/share/texmf/Sweave'
but the package provides `Sweave'.
It seems to be completely
On Sat, 7 Oct 2006 [EMAIL PROTECTED] wrote:
Hi Albert
On 07-Oct-06 Albert Picado wrote:
Dear List members
I am trying to find a way to generate a random point in a circle
centred in a geographical location.
So far I have used the following formula (see code below):
random_x =
Why this kind of assignment does not work?
n - 1
f - ifelse(n == 1, sin, cos)
f(pi)
this must be rewritten as:
n - 1
f - cos
if (n == 1) f - sin
f(pi)
[oops. 1.224606e-16 instead of zero. Damn floating point errors :-/]
Alberto Monteiro
I answered Gabor off line, but realize that this may cause some others
confusion. The RGtk2 package requires the GTK libraries to be
installed first. This varies from system to system. Under Windows it
consists of downloading some files from sourceforget (see
below). After which RGtk2 installs
Try
n - 1
f - if (n == 1) sin else cos
f(pi)
On 10/7/06, Alberto Vieira Ferreira Monteiro [EMAIL PROTECTED] wrote:
Why this kind of assignment does not work?
n - 1
f - ifelse(n == 1, sin, cos)
f(pi)
this must be rewritten as:
n - 1
f - cos
if (n == 1) f - sin
f(pi)
[oops.
Alberto Vieira Ferreira Monteiro [EMAIL PROTECTED] writes:
Why this kind of assignment does not work?
n - 1
f - ifelse(n == 1, sin, cos)
f(pi)
It's not supposed to.
'ifelse' returns a value with the same shape as 'test' which is
filled with elements selected from either
On 10/7/06, Gregor Gorjanc [EMAIL PROTECTED] wrote:
Göran Broström goran.brostrom at gmail.com writes:
When I am using Sweave to produce reports I get a strange Warning from
latex:
LaTeX Warning: You have requested package
`/usr/local/lib/R/share/texmf/Sweave'
but
Jue.Wang2 at sanofi-aventis.com writes:
Does any one know why wilcox.exact sometimes doesn't agree with wilcox_test on
the estimate of the
difference of medians in two levels ?
Example removed
See:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/85893.html
Dieter
Peter Dalgaard writes:
Alberto Vieira Ferreira Monteiro [EMAIL PROTECTED] writes:
Why this kind of assignment does not work?
n - 1
f - ifelse(n == 1, sin, cos)
f(pi)
It's not supposed to.
'ifelse' returns a value with the same shape as 'test' which is
filled
I have noticed that dispatch on functions seems not to work
in another case too. We define + on functions (I have ignored
the niceties of sorting out the environments as we don't really
need it for this example) but when we try to use it, it fails even
though in the second example if we run it
---BeginMessage---
Thanks Gabor,
Your version is handy to use, because you can change the function as you like.
However it isn't any faster and if you know some way to make the result matrix
more quickly, I'm interested to learn it. My test material (musical
improvisations) consists of samples
Thanks Gabor,
Your version is handy to use, because you can change the function as you like.
However it isn't any faster and if you know some way to make the result matrix
more quickly, I'm interested to learn it. My test material (musical
improvisations) consists of samples with 2x2
Hi All,
As the subject says, I am working on a powerPC (G4) mac with OSX version
10.4.7.
I upgraded from r-2.2.1 to r-2.4.0 today using the universal binary dmg file
downloaded from CRAN. This is the complete, not mini binary.
The interactive environment works great, but I am having
On Tue, 03-Oct-2006 at 09:56AM -0500, Douglas Bates wrote:
| Versions 0.9975-1 of the Matrix and lme4 packages will soon be available on
| CRAN for use with R version 2.4.0 or later.
How quickly things change!! When I got to look at CRAN, the latest
versions were 0.9975-1 of lme4 and 0.9975-2
Dear r-helpers,
I downloaded http://popgen.unimaas.nl/~jlindsey/rcode/rmutil.tar (it
was originally .tgz, but got unzipped by my browser).
Can anyone give me detailed instructions on installing this and
Lindsey's other packages on R version 2.4.0 (2006-10-03)---(powerpc-
apple-darwin8.7.0,
Hi again.
I had suspected that doing the calculation by a convolution
method might be both straightforward and efficient in R.
I've now located convolve() (in 'base'!!), and have a solution
using this function. Details below. Original statement of
problem, and method originally proposed, repeated
Greetings:
I would like to kindly ask for a little help. The rough code is:
#
dat=data.frame(read.delim(file=all.txt, header = TRUE, sep = \t,
quote=\, dec=.,na.strings = NA))
nc=read.shape(astae.shp, dbf.data=TRUE, verbose=TRUE)
An updated version 1.1.1 of xlsReadWrite has been submitted to cran.
Currently the cran version is still 1.0, but you can download the
updated version already here: http://treetron.googlepages.com.
xlsReadWrite is a package which allows you to natively read and write
Excelfiles (windows only).
bogdan romocea br44114 at gmail.com writes:
A function I've been using for a while returned a surprising [to me,
given the data] error recently:
Error in plot.window(xlim, ylim, log, asp, ...) :
Logarithmic axis must have positive limits
After some digging I realized what was
Hello!
I am trying to use lm to do a simple regression but on a batch of
different files.
Each file has different column names.
I know the first column is the dependent variable and all the rest are
explanatory variables.
The column names are in the first line of the file.
But it seems lm()
One can get a one-line solution by taking the product of the FFTs.
For example, let p - 1:4/8 be the probabilities. Then the solution is:
fft(exp(rowSums(log(mvfft(t(cbind(1-p,p,0,0,0)), inverse = TRUE)/5
On 10/7/06, Ted Harding [EMAIL PROTECTED] wrote:
Hi again.
I had suspected that
someone may know how to do what you asked but a get around is to not
read the header in the file and assign
your own variable names to each column. This way you have control and
you don't worry about doing anything dynamically.
This is pretty easy if you are using read.table and probably also
Try this:
run.lm - function(DF, response = names(DF)[1], fo = y~.) {
fo[[2]] - as.name(response)
eval(substitute(lm(fo, DF)))
}
# test
run.lm(iris)
run.lm(iris, Sepal.Width)
Another possibility is to rename the first column:
On 10/7/06, HelponR [EMAIL PROTECTED] wrote:
This works beautifully! You know I did not know how many columns in advance
either. So this method is very good.
Many thanks!
On 10/7/06, Gabor Grothendieck [EMAIL PROTECTED] wrote:
Try this:
run.lm - function(DF, response = names(DF)[1], fo = y~.) {
fo[[2]] - as.name(response)
Hello,
This is likely fairly silly question, and I apologize to whomever takes the
time to respond.
I am a relatively new user of R, on Windows XP, version 2.3.1.
Say I have a data table that looks like the following:
x
Date Location Amount Blue Green
1 01/01/2001 Central1817
Here are three alternative ways to get the fiscal year as a numeric
value assuming:
dd - as.Date(x$Date,%d/%m/%Y)
# add one to year if month is past March
as.numeric(format(dd, %Y)) + (format(dd, %m) 03)
# same but using POSIXlt
# (Even though there are no time zones involved I have seen
#
29 matches
Mail list logo