Barry Rowlingson wrote:
However, arima crashes for this:
arima(c(1.71, 1.78, 1.95, 1.59, 2.13), order=c(1,0,0))
I'm not getting what I'd call 'crashes' with your arma or arima
examples- I get an error message and a warning:
arma(c(2.01, 2.22, 2.09, 2.17, 2.42), order=c(1,0))
Error in
Barry Rowlingson wrote:
If you're doing anything in a loop that has the potential to fail
because of singularities or other conditions when your model can't be
fitted, you need to stick what you are doing in a 'try' clause. This
lets you trap errors and do something with them.
Plenty
Function arma is crashing in some (pathological, but crashing is never good)
cases.
For example:
library(tseries)
arma(c(2.01, 2.22, 2.09, 2.17, 2.42), order=c(1,0))
I came to that pathological series while doing test cases; probably there
are crashing cases with longer series.
Alberto
Another pathological test.
arima does not crash for that series that crashes arma:
arima(c(2.01, 2.22, 2.09, 2.17, 2.42), order=c(1,0,0))
However, arima crashes for this:
arima(c(1.71, 1.78, 1.95, 1.59, 2.13), order=c(1,0,0))
arima seems pretty consistent in its crashing behaviour, since
for an expression which will return
the vector
c(C.W[[1]]$level,C.W[[2]]$level,...,C.W[[28]]$level)
H...
Did you try this?
# reproducible example
C.W - list(list(level = 1, x = 2), list(level = 2, y = 3), list(level = 10,
z = 4))
sapply(C.W, function(x) x$level)
Alberto Monteiro
tries to get this information from Wikipedia,
the entries in articles Autoregressive model, Autoregressive moving
average model, and Autoregressive integrated moving average that mention
R were written by me - so there's no point in repeating them (but
corrections are welcome!) :-)
Alberto
, seq(0, 1, length=256), 0))
Explanation:
rgb(0, seq(0, 1, length=256), 0)
creates a vector of colours that begin with black = #0 and
ends up with green = #00FF00.
Parameter nlevels = 256 forces the image to use all colours.
Alberto Monteiro
__
R
includes one (or more) NA (and not N/A) in it.
Test: if (any(is.na(x_ema))) cat(Oops! NAs in x_ema\n)
If you want to get which of them are na: which(is.na(x_ema))
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r
- but still as a string
mean.string - paste(mean(, script, ), sep = )
# Step 2: compute it
eval(parse(text = mean.string))
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http
Dear friends
I am analysing the leaf expansion of a grass species and am interested in
the speed of expansion. I produced exponential models for each of the
treatments and got the equation for leaf size in function of time. I want to
compare the coeficients that gives the initial inclination of
I am trying to plot a small graphic inside the graphic area of a bigger
graphic. Does anybody know the commend for that?
Thanks a lot!
--
MSc José Alberto F. Monteiro
Botanisches Institut
Universität Basel
اÙسÙاÙ
عÙÙÙÙ
[[alternative HTML version deleted]]
of
the series x is deterministic, and two degrees are lost in the
estimation of ar1 and intercept)
What am I misunderstanding?
BTW, a similar example:
x - 1:10
y - sin(x)
reg - lm(y ~ x)
summary(reg)
will give a t-value for 'x' = 0.704 with P(|t|) = 0.501,
which is 2 * (1 - pt(0.704, df=8))
Alberto
metric parameters
in every function.
Maybe Humanity must lose a few more people in airplane crashes
or nuclear plant meltdowns before we ban those unscientific units
from use.
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch
Is there any way to _test_ if a given sequence is a
low-discrepancy sequence?
Or, equivalently, is there any way to measure the discrepancy
of a sequence?
WTIW, ...
http://en.wikipedia.org/wiki/Low-discrepancy_sequence
... doesn't look like something implementation-friendly :-)
Alberto
Why does as.numeric convert matrices and arrays to vectors?
as.numeric(matrix(c(1, 2, 3, 4), 2, 2))
[1] 1 2 3 4
I could only figure out ugly ways to bypass this, like:
x - matrix(c(1, 2, 3, 4), 2, 2)
array(as.numeric(x), dim = dim(x), dimnames = dimnames(x))
Alberto Monteiro
I found a curious bug in read.xls. I don't know if it's reproducible.
It's like this: suppose I do a read.xls in a spreadsheet. A column
begins with a number. Then, any strings below it will be rendered as NA.
If the column begins with a string, then it will be rendered correctly.
Alberto
Suppose that I have a matrix like:
m - rbind(c(1,2,3,4), c(2,3,2,1))
Is there any way to efficiently plot the _lines_ as if
I was doing:
plot(m[1,], type=l)
points(m[2,], type=l, col=red)
(of course, in the real world there much more than
just 2 lines and 4 columns...)
Alberto Monteiro
(that is _not_ a matrix) and the pasting of the
lines of matrix.out?
Alberto Monteiro
PS: this is not a homework, this is evangelism to a Visual Basic
programmer :-)
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
(file.in) returns
an error:
Erro em scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
linha 1 não tinha 1362 elementos
which means
line 1 does not have 1362 elements
(whatever that means!)
Alberto Monteiro
__
R-help@r-project.org
0.8746
I didn't find in the documentation of write.table a way to
remove those quotes, because qmethod is either escape or double :-(
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
, 0.8, 0.9, 0.01, 0.11, 0.21, 0.31, 0.41,
0.51, 0.61, 0.71, 0.81, 0.91, 0.02, 0.12, 0.22, 0.32,
Is there any R function that generates those sequences?
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
The Runuran package includes a simulation for the Triangular Distribution,
urtriang. But I didn't find an analogue of the q* functions (rnorm - qnorm,
runif - qunif), that would invert the CDF (?uqtriang).
Are there any such functions?
Alberto Monteiro
tseries, but didn't understant how
the output from its summary relate to the above quantities.
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org
is a _very_ big number.
Alberto Monteiro
__
R-help@r-project.org 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
for _diagonalizable_ matrices. It
crashes, for example, in cases like:
m - rbind(c(1,1,0), c(0,1,1), c(0,0,1))
m %^% 2
m %*% m
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Is there any function to write a XML structure, after it was
read using xmlTreeParse?
Ex:
library(XML)
x - xmlTreeParse(Irpf2008/aplicacao/dados/12345678901/12345678901.xml)
# write it...
Alberto Monteiro
PS: please, brazilians, don't be offended by my foul language
information
not-xml related (and do what I want - again, sorry for the foul
language).
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting
(x)
# put something here
2 * f1(x)
# probably put something else here too
f2(10)
# 22
f1 - function(x) x - 1
f2(10)
# 22 - f1 inside f2 does not change
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
://en.wikipedia.org/wiki/Aymara_language
...) uses this three value logic system (I think the
computer jargon is trollean logic).
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http
(new.dt2[i]$time2 - d1$time1) # get a vector of deltat's
j.min - which.min(delta.t)
if (delta.t[j.min] = 15 minutes)
new.d2[i]$time1 - d1[j.min]$time1
}
}
# and now merge them
d3-merge(d1, d2, by.x=time1, by.y=time1)
Alberto Monteiro
__
R
distributed? Are they normal? Positive?
If they can be anything, just generate X1, X2 and then compute X3, X4.
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R
Bert Gunter wrote:
Yes. And, amazingly, one can find out about it by typing
help.search(t distribution) .
Why don't you try it for yourself?
Maybe because the obvious search is
help.search(t)
:-)
Alberto Monteiro
__
R-help@r-project.org
the explicit mention of f:
Val - outer(0:n, 0:n, function(j,i) ifelse(j i, 0, u^j*d^(i-j)))
(if u and d are positive integers, there might be a much
faster way of filling Val, using matrix multiplication and
rounding down)
Alberto Monteiro
__
R-help@r
combined
with the (j+1)-th term. So, you take a combination of js in
the 1:i range and combine with js in the 2:(i+1) range... So:
OVal[1:i, i] - a*((1-p)*OVal[1:i, i+1] + p*OVal[2:(i+1), i+1])
The outer loop (in i) probably can't be optimized.
Alberto Monteiro
the y
axis and 1/2 of the way up from the x axis? Thanks.
See the help of par:
?par
Namely:
plot(rnorm(100), rnorm(100))
pu - par()$usr
x - pu[1] * 0.5 + pu[2] * 0.5
y - pu[3] * 0.1 + pu[4] * 0.9
text(x, y, the quick brown fox jumps over a lazy dog)
Alberto Monteiro
resolution.
I saw that R can write in SVG format, using the RSVGTipsDevice
library. I think SVG is the closest format to losslessness
when printing.
Of course, my ecological motivation would ban all formats that
make printing easy, to save the environment by saving a few trees :-)
Alberto Monteiro
I just noticed a weird feature in rimage. It seems that, when
reading an image, the line/colums are transposed.
See this reproducible example. The final image should be black - but (as
expected) not an absolute black (mean(z) is 0.015, sd(z) is 0.055 but
max(z) is 1).
Alberto Monteiro
borders around it.
Alberto Monteiro
__
R-help@r-project.org 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
to have a list of the planet names in roman, but
x[,1] is not an array of strings, and cat(x[,1]) gives an error.
--- end of fictional message ---
FWIW, the reply to this message is:
y - as.matrix(x)
cat(y[,1])
Alberto Monteiro
__
R-help@r-project.org
have
create this interface with other language.
Thank you very much, and I hope that you understand my english.
You mean like a GUI? There are many GUI packages in R, probably
the simpler is the tcltk package.
Alberto Monteiro
__
R-help@r
=,collapse= ))
}
Be careful, the function does not handle empty fields:
digits2text(10^6 + 10)
[1] one million one thousand hundred thousand hundred ten
Alberto Monteiro (today I am purely destructive)
__
R-help@r-project.org mailing list
https
- x
g1(anything) will return (scalar) 0
g2(scalar) will return (scalar) 0, g2(vector) will return
(vector) 0, g2(matrix) will return (matrix) 0.
So, in your original problem, f and (first) g have different
behaviours.
Alberto Monteiro
__
R-help@r
Is there any (list.files)-like function that sorts the files by
(modification) date?
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting
_accented_
characters in filenames and paths. And they are not standard.
So there may be a filename conflict here.
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http
libraries
exist, and check if there is some file protection.
Probably there's a problem with:
/usr/X11R6/lib/libX11.6.dylib
Alberto Monteiro
PS: is there any way to temporarily change the error messages
from one language to another? When I get error messages
in Portuguese it's a pain
, converting height and
value to colors?
OTOH, if it's a function from R^3 to R:
f: (lat, lon, h) - (value)
then I guess the best way is to replace one dimension to time,
and create animations.
Alberto Monteiro
__
R-help@r-project.org mailing list
https
, and
naively says that C is 50 times faster than R?
Alberto Monteiro
__
R-help@r-project.org 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
I need arguments pro-S-PLUS and against SAS for a meeting I will
have next week. S-Plus is (90 - 99)% compatible with R, so using
S-Plus will make things much easier for everyone. But I can't use
this argument. What other arguments could I use?
Alberto Monteiro
Does anybody know how to deffine in the test tukeyHSD the pairs of
comparison that you want to get? It is throw the lmat commnad, but I
don't know the correct usage...
Thanks a lot!
José
--
MSc José Alberto F. Monteiro
Botanisches Institut
Universität Basel
السلام عليكم
are they used?
Why don't you test it yourself?
library(tcltk)
x - tkmessageBox(title=,message=x,icon=question,type=okcancel)
# press x or cancel
x
# Tcl ok or Tcl cancel
To get back from this Tcl-thing to an R-string, use
y - tclvalue(x)
Alberto Monteiro
having to move it around in argument lists. In the C community, it
would be called a global variable.
Global variables in R are used with - instead of -.
For example:
x - 1
y - 1
f - function() {
x - 2
y - 2
}
f()
will turn y to 2 but will not change x.
Alberto Monteiro
really be called the user workspace.
Got it.
So, in this case:
x - 1
f - function() {
x - 2
g - function() {
x - 3
}
g()
x
}
f()
It's expected that f will return 3, but x would still be 1?
Alberto Monteiro
__
R-help@r-project.org mailing
I am tryindo to do a very simple thing but cannont find how to do it
anywhere. I need to formap part of my title as subscript ans superscript.
How can I do it?
Thanks a lot in advance
José
--
MSc José Alberto F. Monteiro
Botanisches Institut
Universität Basel
[[alternative HTML version
and not to ,
like this:
/usr/bin/R --quiet --slave /perl/outfiles/Rscript19785065.R
/perl/outfiles/error19785065.txt 2 error.log
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
a text in Latin-1 and removing the accented
characters, or looping through a directory and renaming
files with weird names, or creating a .wpl file with the mp3s.
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman
could do it in C++, but I am
illiterate in R++ oops S4 classes).
Alberto Monteiro
__
R-help@r-project.org 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
be done in C++,
because C++ can call C functions. Just write the C++ code as:
extern C int myfunction(int x1, int x2)
{
// write C++ code here
return rval;
}
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman
on Windows.
Maybe that's the reason.
Alberto Monteiro
__
R-help@r-project.org 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
loop - necessary in perl but not in R
I tried to contact the author for permissions to translate, adapt
and post the examples to the RWiki, but without success :-(
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo
by people who only knows how to write
Excel spreadshits, and you want to automate the reading
and interpretation of such data so that you, as a R
user, does not have to use Excel to convert the data to
text.
Alberto Monteiro
__
R-help@r-project.org mailing
-like, with
mean close to df, and standard deviation close to sqrt(df).
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
.cnn.com/TECH/space/9911/10/orbiter.03/
;)
That's why it should not be done _at all_, and all functions
should have SI inputs (unless you are from Liberia, Myanmar, etc).
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman
Prof Brian Ripley wrote:
Read ?par and the descriptiuon in 'An Introduction to R'. din,
fin, mai, omi, pin and usr are relevant.
Is there any hope that, instead of fin, din, pin, etc someday
we will have fmm, dmm, pmm?
Alberto Monteiro
__
R
time?
# get 10*100 random d6s
x - sample(1:6, 10*100, replace=T)
# transform into a 10 x 100 matrix
y - matrix(x, 10, 100)
# sum the cols
z - colSums(y)
Of course, you can combine these three lines into one.
Alberto Monteiro
__
R-help@r-project.org
time ago, I noticed that programming that I do for fun
is much more useful for my work in the long range than
programming that I do for work; the algorithms and ideas
that we put into gaming or hobbies are usually flawless
and optimized :-)
What are the R packages with games?
Alberto Monteiro
hungry) option.
Alberto Monteiro
__
R-help@r-project.org 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
), but it will just put some
description of the function in the string.
Also, the assignment in R is -, not =.
Try:
foot - function(){
str1 - format(Sys.Date(),%Y%m%d)
sprintf(99%-4s%s,nm,str1)
}
Alberto Monteiro
__
R-help@r-project.org mailing list
https
); WordExit()
will prompt for the Yes/No/Cancel prompt, and if I answer Yes, it opens
the menu to Save As.
(2) is there any way to write formulas in the evil Word formula format, but
with input as decent latex-like format?
Alberto Monteiro
__
R-help@r
years and such. You know that there are _not_
365.25 days in one year, don't you?
floor(as.numeric(as.Date(2100-02-28) - as.Date(1900-02-28))/365.25)
# 199, should be 200
A less extreme counter-example:
floor(as.numeric(as.Date(2008-02-28) - as.Date(2007-02-28))/365.25)
# 0, should be 1
Alberto
abbreviate
function arguments... Thanks for the (accidental) help :-)
Alberto Monteiro
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
70 matches
Mail list logo