Hi,
On Fri Apr 2, xt_wang wrote:
I want to use R function Matrix inverse in my c code, please
tell me how I can.
If there is a sample which can tell me how it works. It will
be fantastic.
A good place to start learning how to interface R with C is the
Writing R Extensions manual installed
Ajay Shah wrote:
where it is asif the summary.lm(m) statement never occurred. If I put
in a statement print(m) it works, but the summary.lm(m) does not work.
Now here's what's weird: Suppose I remove the statement that comes
AFTER this summary.lm(m) statement. That is, I don't say
details =
Ajay Shah writes:
buoyancy - function(year, taxbase, tax, description, plotname) {
cat(Simple full OLS regression with all data:\n)
logtax = log(tax)
logtaxbase = log(taxbase)
m = lm(logtax ~ logtaxbase)
summary.lm(m)
details = summary.lm(m)
}
This program does not
Hi Everyone,
I'm new here and am using R for studying linear algebra with Lay's
Linear Algebra and Its Applications (2nd Edition). Some of the
exercises are to be solved via computer or calculator and instructions
are provided on how to use Maple, Mathematica, etc. but neither R nor
S.
So
Is there a function that does the same as pretty but on a log-scale?
Suppose you have
x - exp( runif( 100, 0, 6 ) )
(which will between 1 and 403), then I would like to have a result like:
log.pretty( x )
[1] 1 5 10 50 100 500
Bendix C.
--
Bendix Carstensen
Senior
does anybody know of a nice test to detect trend turning points in
time series? Possibly with reference?
You can look at the function breakpoints() in the package strucchange
and the function segmented() in the package segmented which do
segmentation of (generalized) linear regression
Hi,
I've just upgraded to 1.9.0 and one of my Sweave files that produces a
number of barplots in a standard manner now produces them in a
different way. I have made a couple of small changes to my code to
get the back the output I was getting before upgrading and now (mostly
out of curiosity)
Hi,
Is there a function in R that lets one represent an integer in binary
format for a given number of bits? So an example would be
binary.function(num=5, num.of.bits=8)
0101
Or, is this something I have to write myself?
Any help would be appreciated.
Cheers,
Sam.
[EMAIL PROTECTED] wrote:
Hi, excuse me i am newbee in R, but i dont understand the following code
not work. Libro1.xls have two files and not load in R, under windows. Thanks
library(RODBC)
f-file.choose()
f
[1] C:\\Mis documentos\\ruben\\r19\\Libro1.xls
help(odbcConnectExcel)
canal-
Samuel Edward Kemp wrote:
Hi,
Is there a function in R that lets one represent an integer in binary
format for a given number of bits? So an example would be
binary.function(num=5, num.of.bits=8)
0101
Or, is this something I have to write myself?
Any help would be appreciated.
Hi,
I just wrote a little C program (and interfaced it with R) that does it
for me, but I will take a look at that function.
Cheers,
Sam.
Uwe Ligges wrote:
Samuel Edward Kemp wrote:
Hi,
Is there a function in R that lets one represent an integer in binary
format for a given number of
Hi Sam. Try:
as.binary - function(n,base=2 , r=FALSE)
{
out - NULL
while(n 0) {
if(r) {
out - c(out , n%%base)
} else {
out - c(n%%base , out)
}
n - n %/% base
}
return(out)
}
HTH
robin
Hi,
Is there a function in R that lets one represent an integer
Dear Joerg,
See
http://www.brodgar.com/timeseries.htm
and especially:
http://www.brodgar.com/chronoexample.htm
http://www.brodgar.com/chronoexample2.htm
for methodology and examples of detecting breakpoints in multivariate time series.
Kind regards,
Alain Zuur
www.brodgar.com
[EMAIL PROTECTED] wrote:
Dear all,
I would like to add a legend to a time series plot, but
cannot get it done. I have searched the archive about this,
but to no avail ...
I have three sets of time series data stored in a matrix
wMat. The following code plots the the data with
a legend, but it
Your question has been answered by others. I just want to point out that
you should not be calling summary.lm() directly, but should call the generic
summary() instead.
Andy
From: Ajay Shah
Folks,
I have a strange situation, which I may have isolated as a bug
report. Or, it could just
Is there any way to get a numerical summary of the values of a difftime
object? E.g.
TimeToWean - difftime(WeanDate, BirthDate, units = days)
I can repeat
sum(TimeToWean == 20)
with as many other values are needed to build up a frequency table,
but is there a simpler way in R version 1.8.1?
I M S White wrote:
Is there any way to get a numerical summary of the values of a difftime
object? E.g.
TimeToWean - difftime(WeanDate, BirthDate, units = days)
I can repeat
sum(TimeToWean == 20)
with as many other values are needed to build up a frequency table,
but is there a simpler way in
I M S White wrote:
Is there any way to get a numerical summary of the values of a difftime
object? E.g.
TimeToWean - difftime(WeanDate, BirthDate, units = days)
I can repeat
sum(TimeToWean == 20)
with as many other values are needed to build up a frequency table,
but is there a simpler
Samuel == Samuel Edward Kemp [EMAIL PROTECTED]
on Wed, 14 Apr 2004 22:20:24 +0100 writes:
Samuel Hi, Is there a function in R that lets one represent
Samuel an integer in binary format for a given number of
Samuel bits? So an example would be
binary.function(num=5,
James Wettenhall [EMAIL PROTECTED] writes:
Hi,
On Fri Apr 2, xt_wang wrote:
I want to use R function Matrix inverse in my c code, please
tell me how I can.
If there is a sample which can tell me how it works. It will
be fantastic.
A good place to start learning how to interface R
[EMAIL PROTECTED] writes:
On April 15th, Elizabeth wrote:
snip
In execises 39-42, determine if the columns of the matrix span
R4:
snip
(or x - matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5,
4, -2, 2, 8, -9, 7, 15), nrow=4, ncol=4)
That is the whole of
Apache may not aware the PATH to R, try 'exec(/pathToR/R CMD ...)'.
In addition, apache and R should be in the same physical driver.
-Junwen
I've developed a web application in PHP and R
my script is
?php
...
exec(R CMD BATCH --silent /home/marcello/R_in/myfile.bat
On April 15th, Elizabeth wrote:
snip
(or x - matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5,
4, -2, 2, 8, -9, 7, 15), nrow=4, ncol=4)
qr(x)$rank
gives the rank
qr.R(qr(x))
gives the R part (an upper triangular matrix similar to the one
produced by Gauss elimination).
With
Fred J. wrote:
Browse[1] Lframe
v v v v v v v v
1 8 7 6 5 4 3 2 1
2 9 8 7 6 5 4 3 2
3 10 9 8 7 6 5 4 3
4 11 10 9 8 7 6 5 4
5 12 11 10 9 8 7 6 5
6 13 12 11 10 9 8 7 6
7 14 13 12 11 10 9 8 7
8 15 14 13 12 11 10 9 8
Browse[1] fdim(Lframe,q=2)
Error in
Dear R-help,
I was bitten by the behavior of all() when given logical(0): It is TRUE!
(And any(logical(0)) is FALSE.) Wouldn't it be better to return logical(0)
in both cases?
The problem surfaced because some un-named individual called randomForest(x,
y, xtest, ytest,...), and gave y as a
I'm trying to determine the lack of fit for regression on the following:
data - data.frame(ref=c(0,50,100,0,50,100),
actual=c(.01,50.9,100.2,.02,49.9,100.1),
level=gl(3,1))
fit - lm(actual~ref,data)
fit.aov -
Dear R-help:
I have a data frame (df1) with elements a, b, and c that identify a unique
set of conditions of interest; l and m identify other conditions; and x and
y are responses.
df1 - data.frame(a = c(1,1,1,2,2,2,3,3,3), b = c(10,10,10,20,20,20,30,30,30),
c =
On Wed, 14 Apr 2004, Fred Rohde wrote:
I wasn't sure if JRR or BRR methods were valid for quantiles?
BRR is valid, as is Fay's method, a smoothed version. The jackknife
methods probably aren't. At some point I should probably try to add
bootstrap methods for designs where BRR doesn't fit well.
Andy Liaw wrote:
I was bitten by the behavior of all() when given logical(0): It is
TRUE! (And any(logical(0)) is FALSE.) Wouldn't it be better to
return logical(0) in both cases?
It seems to me that what R does is strictly speaking correct.
Anything you say about the members of the empty
I wrote:
I was bitten by the behavior of all() when given logical(0):
It is TRUE!
(And any(logical(0)) is FALSE.) Wouldn't it be better to
return logical(0)
in both cases?
I guess the behavior is consistent with:
prod(numeric(0))
[1] 1
sum(numeric(0))
[1] 0
but why?
Andy
Have you considered try?
When I do this, I prefer to parameterize the problem to avoid
situations where the function is undefined and provide alternative
algorithms were a function will have numerical difficulties. For
example, suppose I want (sin(x)/x), and I get NA when x = 0. I
On Thu, 15 Apr 2004, Liaw, Andy wrote:
Dear R-help,
I was bitten by the behavior of all() when given logical(0): It is TRUE!
(And any(logical(0)) is FALSE.) Wouldn't it be better to return logical(0)
in both cases?
No, it wouldn't. The convention that For all x in A: P(x) is true
Putting it simly I have a date in format MMDD
Year month day
20030301
and I need simply the day of the week as an integer or even as
string...
according to the documentation in ISOdate or strptime functions
I need to format it ...
If I try something like :
strptime(20030301,%u)
[1]
Hello list,
I am just starting to write some R functions (R 1.8 and Windows XP) and
got stuck as described below:
We have a bunch of time series data files, each is about 10,000 values.
There is a 12-line header in each one. I can read them and plot them
easily with R, but I want to make an
On Thu, 15 Apr 2004 10:40:41 -0400, Liaw, Andy [EMAIL PROTECTED]
wrote :
Dear R-help,
I was bitten by the behavior of all() when given logical(0): It is TRUE!
(And any(logical(0)) is FALSE.) Wouldn't it be better to return logical(0)
in both cases?
As Rolf said, this behaviour makes sense.
MMarques Power wrote:
Putting it simly I have a date in format MMDD
Year month day
20030301
and I need simply the day of the week as an integer or even as
string...
according to the documentation in ISOdate or strptime functions
I need to format it ...
If I try something like :
Hello Randy,
Thursday, April 15, 2004, 4:08:14 PM, you wrote:
RZ I am just starting to write some R functions (R 1.8 and Windows XP) and
RZ got stuck as described below:
RZ We have a bunch of time series data files, each is about 10,000 values.
RZ There is a 12-line header in each one. I can
Liaw, Andy [EMAIL PROTECTED] writes:
I wrote:
I was bitten by the behavior of all() when given logical(0):
It is TRUE!
(And any(logical(0)) is FALSE.) Wouldn't it be better to
return logical(0)
in both cases?
I guess the behavior is consistent with:
prod(numeric(0))
[1] 1
Dear R users,
I used the multivariate random numbers generation function in MASS for my
study. I wonder what is an approriate way to cite the library and its
authors in my publication to express my gratefulness?
best regards,
Yu-Kang
__
[EMAIL
Thanks to Rolf, Thomas, Duncan Doug for the explanations! It's one of
those things that I should have remembered from high school but clearly
didn't...
I've changed my code to:
[If y is factor:]
if (!is.null(ytest)) {
if (!is.factor(ytest)) stop(ytest must be a factor)
wettenhall at wehi.EDU.AU writes:
:
: On April 15th, Elizabeth wrote:
: snip
: In execises 39-42, determine if the columns of the matrix span
: R4:
: snip
: (or x - matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5,
: 4, -2, 2, 8, -9, 7, 15), nrow=4, ncol=4)
:
:
David == David Whiting [EMAIL PROTECTED]
on 15 Apr 2004 11:42:18 + writes:
David Hi,
David I've just upgraded to 1.9.0 and one of my Sweave
David files that produces a number of barplots in a
David standard manner now produces them in a different way.
David I have
Hello,
I just downloaded RW1090. No problems. My thanks to everybody involved in the
project. I work in Win98
I updated my library, some problems with some files that were in the PACKAGES list
but not in 1.9/ site, now all are.
I tried to install Zelig from Harvard
what is fdim()?
a package from CRAN which calculate the fractal
dimension of datasets.
once you have it installed do
library(fdim)
help(fdim)
thanks
fdim
Error: Object fdim not found
Please, consider to follow the posting guide and
help the readers of
this list to easily
R. Heberto Ghezzo [EMAIL PROTECTED] writes:
Hello,
I just downloaded RW1090. No problems. My thanks to everybody involved in the
project. I work in Win98
I updated my library, some problems with some files that were in the PACKAGES list
but not in 1.9/ site, now all are.
I tried to install
From: Fred J.
what is fdim()?
a package from CRAN which calculate the fractal
dimension of datasets.
once you have it installed do
library(fdim)
help(fdim)
That's not the point.
[Uwe said:]
Please, consider to follow the posting guide and
help the readers of
this list to easily
R == R Heberto Ghezzo [EMAIL PROTECTED]
on Thu, 15 Apr 2004 12:16:03 -0400 writes:
R Hello, I just downloaded RW1090. No problems. My thanks
R to everybody involved in the project. I work in Win98 I
R updated my library, some problems with some files that
R were in the
On Thu, 15 Apr 2004 18:10:27 +0200, Martin Maechler
[EMAIL PROTECTED] wrote :
David == David Whiting [EMAIL PROTECTED]
on 15 Apr 2004 11:42:18 + writes:
David Hi,
David I've just upgraded to 1.9.0 and one of my Sweave
David files that produces a number of barplots in a
James writes:
Have you tried det(x) and/or eigen(x) ?
A zero determinant (within computer precision) means that the matrix
does not have full rank, i.e. it does not span R4. Count how many
eigenvalues are zero (within computer precision). What does this
tell you?
I'm still on chapter 1
Take a look at this thread:
https://www.stat.math.ethz.ch/pipermail/r-help/2004-February/044162.html
In general, it depends, but for MASS you should probably cite the book
by Venables Ripley.
-roger
Tu Yu-Kang wrote:
Dear R users,
I used the multivariate random numbers generation function
I can't load the packages locfit, lokern and quantreg.
When I try to load the 3 packages the R program says that the pakages are not properly
installed. He says to see the note in ?library.
I think that the error is because there is no built field in the 3 packages.
What can I do to make the
I suspect that some people still might not have caught why
the behavior is a good thing.
We want
any(c(A, B))
to give the same answer as
any(A) || any(B)
This should be the behavior even if all of the elements are
in one of the vectors.
This actually is useful in coding, though I can't think
Hi,
I want to draw a level plot. The levels are not evenly spaced, so I did
something like: levels=c(0,2,5,10,30,60). I still want the color bar (key) on
the right side to be evenly spaced so that the small numbers (0,2,5) are not
squeezed together.
Does anyone know how to do it?
Thanks!
There are indeed a number of ways to do this.
If all have exactly the same number of values, and they have the same
times, then a matrix or dataframe would be a reasonable place to
store them. In that case I would have one column per file.
Otherwise, I would tend to use a list.
Here is a toy
Uwe Ligges wrote:
I guess it is clipped in this case. Use par(usr) after ts.plot() to
see what the user coordinates are, and whether (1, -0.3) is a sensible
location to place the legend.
Uwe Ligges
Just to add to Uwe's good suggestion -- what I usually do is
opar - par(no.readonly=TRUE)
Hi,
-Original Message-
From: [EMAIL PROTECTED]
I can't load the packages locfit, lokern and quantreg.
When I try to load the 3 packages the R program says that the
pakages are not properly installed. He says to see the note
in ?library.
I think that the error is because there is no
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Dear guRus,
I'm stuck and really would appreciate some help. I've already crawled the net...
I want to do some Boxplot which are sorted by the median and not alphabetically.
What I did so far:
x - subset(mydata, Verwalt.Doku==1, select=c(1, 2))
P - plot(x[,1], x[,2], plot=F)
Thanks for the explanation. And for all your work on this package.
Thomas Lumley [EMAIL PROTECTED] wrote:On Wed, 14 Apr 2004, Fred Rohde wrote:
I wasn't sure if JRR or BRR methods were valid for quantiles?
BRR is valid, as is Fay's method, a smoothed version. The jackknife
methods probably
Was there supposed to be any content to this post? It
doesn't bode well for the course. :-)
Bob
[EMAIL PROTECTED] wrote:
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
Bob Cain [EMAIL PROTECTED] writes:
Was there supposed to be any content to this post? It doesn't bode
well for the course. :-)
I was actually reading it with some curiosity as to how they managed
to find 5 locations that were close to everyone on R-help...
Things should be described as
Elizabeth (etb [EMAIL PROTECTED]) wrote:
In execises 39-42, determine if the columns of the matrix span
R4:
4
Presumably that's R, 4-dimensional real space.
(or x - matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5,
H. Bromberger wrote:
Dear guRus,
I'm stuck and really would appreciate some help. I've already crawled
the net...
I want to do some Boxplot which are sorted by the median and not
alphabetically.
What I did so far:
x - subset(mydata, Verwalt.Doku==1, select=c(1, 2))
P - plot(x[,1], x[,2],
Liaw, Andy [EMAIL PROTECTED] wrote:
I was bitten by the behavior of all() when given logical(0): It
is TRUE! (And any(logical(0)) is FALSE.) Wouldn't it be better
to return logical(0) in both cases?
It would be disastrous. For all integer n = 0,
Peter Dalgaard wrote:
I was actually reading it with some curiosity as to how they managed
to find 5 locations that were close to everyone on R-help...
Close, for sufficiently large values of 'close'...
:D
Jason
__
[EMAIL PROTECTED] mailing list
Has anyone writtent an R function for estimating linear
models with distributed lags(using matrix algebra)?
Y(t) = Bo + B1Xt-1+ B2Xt-2+e
Thanks,
-
[[alternative HTML version deleted]]
All,
Does anyone know if there is an option I can set to turn screen-buffered
output on and off with the win32 rgui? (Apart from the point and click
method).
I am running some simulations where it is useful to watch output but it
gets mildly tiresome having to manually switch things on and
Has anyone writtent an R function for estimating linear
models with distributed lags(using matrix algebra)?
Y(t) = Bo + B1Xt-1+ B2Xt-2+e
The dse bundle, with libraries dse1 and dse2 have functions for this
in VARX or state space form.
Cheers
Jason
Dear R-help faithful,
I am trying to build a program which will take repeated samples (w/o
replacement) from a population of values. The interesting catch is that I
would like the sample values to be removed from the population, after each
sample is taken.
For example:
pop-1:10
sample(pop, 2)
Use negative indexing; e.g., pop - pop[-c(3, 7)] removes the 3rd and 7th
element of pop.
Andy
From: Joseph Sakshaug
Dear R-help faithful,
I am trying to build a program which will take repeated samples (w/o
replacement) from a population of values. The interesting
catch is that I
I am trying to install packages, WHat i did is:
options(CRAN= http://cran.us.r-project.org/;)
install.packages(pakgs)
However I got error message like:
trying URL `http://cran.us.r-project.org//bin/windows/contrib/PACKAGES'
Error in download.file(url = paste(contriburl, PACKAGES, sep = /), :
I am trying to install packages, WHat i did is:
options(CRAN= http://cran.us.r-project.org/;)
install.packages(pakgs)
Is that really the package name? I can't find it on CRAN.
However I got error message like:
...
argument `lib' is missing: using C:/PROGRA~1/R/rw1051/library in:
Linda portman wrote:
I am trying to install packages, WHat i did is:
options(CRAN= http://cran.us.r-project.org/;)
install.packages(pakgs)
However I got error message like:
trying URL `http://cran.us.r-project.org//bin/windows/contrib/PACKAGES'
Error in download.file(url = paste(contriburl,
Ctrl-W.
-roger
[EMAIL PROTECTED] wrote:
All,
Does anyone know if there is an option I can set to turn screen-buffered
output on and off with the win32 rgui? (Apart from the point and click
method).
I am running some simulations where it is useful to watch output but it
gets mildly tiresome
Has anyone writtent an R function for estimating linear
models with distributed lags(using matrix algebra)?
Yt=B0+S j=1j=10 Xt-j+e
Thanks a lot!
-
[[alternative HTML version deleted]]
__
I meant via a function or something like:
options( buffered.output = FALSE)
Sorry, I should have made that clearer.
Cheers
Toby
-Original Message-
From: Roger D. Peng [mailto:[EMAIL PROTECTED]
Sent: Friday, April 16, 2004 1:11 PM
To: Patterson, Toby (Marine, Hobart)
Cc: [EMAIL
I sent this to R-help recently, but I'm not sure if it was
received correctly. It it is in:
https://www.stat.math.ethz.ch/pipermail/r-help/2004-April.txt.gz
but not yet in:
http://tolstoy.newcastle.edu.au/R/help/04/04/index.html
Apologies if I've sent it twice.
On Thu, 15 Apr 2004, James
77 matches
Mail list logo