cjkogan111 wrote:
Hello,
I am new to R, and trying to work with it. I have a couple of quick
questions. First, I made a program and got the following error message.
--
Error in if
[EMAIL PROTECTED] wrote:
hi all,
I have a simple question that does power spectral analysis related to
capacity dimension, information dimension, lyapunov exponent, hurst
exponent.
Hurst Aanalysis is implemented in fSeries from Rmetrics.
The following functions are available:
hi, here's a way:
attr(table(unlist(d)),'dimnames')[[1]]
[1] 1 2 3
as.numeric(table(unlist(d)))
[1] 1 1 2
soren
- Original Message -
From: Bingshan Li [EMAIL PROTECTED]
To: jim holtman [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Sent: Sunday, September 17, 2006 6:14 AM
Subject: Re:
Hey,
I am given a data frame, which actually contains a matrix. But I need to
convert the data frame into a matrix so that I can use the matrix operators.
Can anybody help me out? Thanks a lot.
Thaleia
[[alternative HTML version deleted]]
look at ?data.matrix()
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
Hey,
I have a question on Dirichlet process. I am using a Dirichlet process as a
prior.
So I end up with a mixture distribution with a continuous component and
a random number of discrete components at some mass-points. I tried some
algorithms, but it's too too inefficient. Anyone know some
You can use 'names'
d = as.data.frame(matrix(c(1, 2, 3, 3), 2,2))
x - table(unlist(d))
x
1 2 3
1 1 2
names(x)
[1] 1 2 3
On 9/17/06, Søren Merser [EMAIL PROTECTED] wrote:
hi, here's a way:
attr(table(unlist(d)),'dimnames')[[1]]
[1] 1 2 3
as.numeric(table(unlist(d)))
[1] 1 1 2
This is the way to get the frequencies. But what I
want is to store the elements in one vector and their
frequencies in another vector. My problem is that when
I call table to return the frequency table, I do not
know how to extract these two vectors. I tried
table(...)$dinnames and it did
On Sun, 17 Sep 2006, jim holtman wrote:
You can use 'names'
d = as.data.frame(matrix(c(1, 2, 3, 3), 2,2))
x - table(unlist(d))
x
1 2 3
1 1 2
names(x)
[1] 1 2 3
You can, but Søren was equally correct: names() on a 1D array actually
looks up the dimnames. OTOH, we do really want to
Hello,
i would like to insert R code in LaTeX document.
I see something about the 'listings' package, but i would like if it is the
best way and if it is possible to use the command \include{programme.R}.
I have the following solution but it doesn't work with \include and \input
==
LaTex
On Sun, 2006-09-17 at 16:45 +0200, Alexandre Depire wrote:
Hello,
i would like to insert R code in LaTeX document.
I see something about the 'listings' package, but i would like if it is the
best way and if it is possible to use the command \include{programme.R}.
I have the following solution
--- Finosaur [EMAIL PROTECTED] wrote:
I am given a data frame, which actually contains a
matrix. But I need to convert the data frame into a
matrix so that I can use the matrix operators. Can
anybody help me out? Thanks a lot.
Thaleia
d - as.matrix(data.frame)
Alexandre Depire depire at gmail.com writes:
Hello,
i would like to insert R code in LaTeX document.
I see something about the 'listings' package, but i would like if it is the
best way and if it is possible to use the command \include{programme.R}.
I have the following solution but it
Hy all,
Is there a direct way to build the complete function call of an arbitrary
function?
Here's what I want to do. A function will build a function which will itself
call a probability density function for some law given in argument to the
first function:
f(gamma, 1000)
will return,
Mitchell Maltenfort mmalten at gmail.com writes:
I'm still new to R and wouldn't mind meeting other R users, at any
level of experience.
This list is as good a place as any. Other is an R conference. There may also be
some undergrads at economics dept at UPenn. Anupam.
New users may also want to look at SciViews R Graphical User Interface(GUI). It
can be a good learning tool. Its text based editor is basic compared to WinEdt
with the R editing plug-in, or ESS and (X)Emacs combination. But it has
point-and-click menus that help in writing code, and easy view of
With minor modifications, I got your example to work. After
reading in your 'testdata', I then made 'site' and 'Array' factors:
testdata$site - factor(testdata$site)
testdata$Array - factor(testdata$Array)
# Note: S-Plus and R are case sensitive, so 'array' and 'Array' are two
Hi everybody
I'm trying to simulate a stochastic process in R. I would like consider n
log normal time series. The first time serie has a growth rate lower than
the second and so on. the initial time of the first serie is lower than the
initial time of the second and so on. In the long run the
Try this. We use do.call to call f with the args defined by ...
except that we replace the first arg with ..1+a (where ..1 means
first arg in R):
F - function(f, a)
function(...) do.call(match.fun(f), replace(list(...), 1, ..1 + a))
g - F(+, 1000)
g(1,2) # 1003
On 9/17/06, Vincent
Hello R users,
I have a substantial question about statistics, not about R itself, but
I would love to have an answer from an R user, in form of an example in
R syntax. I have spent whole Sunday searching in Google and browsing the
books. I've been really close to the answer but there are at
On 9/17/2006 12:36 PM, Vincent Goulet wrote:
Hy all,
Is there a direct way to build the complete function call of an arbitrary
function?
Here's what I want to do. A function will build a function which will itself
call a probability density function for some law given in argument to the
An easier way is to use summary()
summary(lmfit)
or
summary(lmfit)$coefficients
Estimate Std. Error t value Pr(|t|)
(Intercept) 9.872541 5.2394254 1.884279 0.13262386
exped 3.681715 0.9294818 3.961040 0.01666313
or
summary(lmfit)$coefficients[,2]
(Intercept)
Dear R-friends,
I have to simple questions. First I would like to exclude some columns from a
dataframe and after I need select rows that satisfy some conditions.
My data frame looks like
Region Species Bodysize Weigth Age
Africa Sp1 10.2 20 2
Africa Sp2 12.2 12 2
Africa
Fellow R-helpers,
Suppose we create a histogram as follows (although it could be any vector
with zeroes in it):
R lenh - hist(iris$Sepal.Length, br=seq(4, 8, 0.05))
R lenh$counts
[1] 0 0 0 0 0 1 0 3 0 1 0 4 0 2 0 5 0 6 0 10 0 9 0 4 0
[26] 1 0 6 0 7 0 6 0 8 0
Miltinho,
On Sun, Sep 17, 2006 at 05:08:29PM -0300, Milton Cezar wrote:
Dear R-friends,
I have to simple questions. First I would like to exclude some
columns from a dataframe and after I need select rows that satisfy some
conditions.
My data frame looks like
Region Species Bodysize
Hi,
are there any good charting and analysis tools for use with
currencies, stocks, etc. in R? I have some tools to download currency
data from the NYFRB using python and XML. Can we get and parse an XML
download using R? Can we have interaction in R plots? Does anyone
use R for back-testing
Hi:
How can i make that the numbers in the tick annotations of an axis be
written as, say 20 000 and not 2 (i.e. with the little gap seprating
thousands)?
Thanks
Ruben
__
R-help@stat.math.ethz.ch mailing list
I think this should do it:
lenh - hist(iris$Sepal.Length, br=seq(4, 8, 0.05))$counts
lenh # original data
[1] 0 0 0 0 0 1 0 3 0 1 0 4 0 2 0 5 0 6 0 10 0 9
0 4 0 1 0 6 0 7 0 6 0
[34] 8 0 7 0 3 0 6 0 6 0 4 0 9 0 7 0 5 0 2 0 8 0
3 0 4 0
format(1, big.mark= )
[1] 10 000
format(seq(1,10,1), big.mark= , scientific=FALSE)
[1] 10 000 20 000 30 000 40 000 50 000 60 000 70 000
[8] 80 000 90 000 100 000
plot(seq(1, 10, 1), yaxt=n)
axis(2, at=seq(1, 10, 1),
On Sun, 2006-09-17 at 17:47 -0400, Ruben Roa Ureta wrote:
Hi:
How can i make that the numbers in the tick annotations of an axis be
written as, say 20 000 and not 2 (i.e. with the little gap seprating
thousands)?
Thanks
Ruben
There are several ways to format numbers:
?format
On Sun, 17 Sep 2006 15:12:30 -0500,
Sebastian P. Luque [EMAIL PROTECTED] wrote:
[...]
I thought about some very contrived ways to accomplish this, involving
'which' and 'diff', but I sense a function might already be available to
do this efficiently.
I think I found a better combination of
On Sun, 17 Sep 2006 18:05:15 -0400,
jim holtman [EMAIL PROTECTED] wrote:
I think this should do it:
[...]
Thank you Jim, the idea with 'rle' is great. I missed your follow-up
before mine a minute ago with another solution. I'll do some testing with
both.
Cheers,
--
Seb
Hi,
I am using merge to add some variables to an existing dataframe. I
use the option all.x=F so that my final dataframe will only have as
many rows as the first file I name in the call to merge.
With a large dataframe using a lot of by variables, the number of
rows of the merged dataframe
Hi all,
I have a vector and want to merge its elements one by
one into a single string or number. For example,
x=c(1,2,3), what I want is a new number 123. I used
paste but it just output 1 2 3 which is not
what I want. Is there any way to do this?
Thanks!
Bingshan Li wrote:
Hi all,
I have a vector and want to merge its elements one by
one into a single string or number. For example,
x=c(1,2,3), what I want is a new number 123. I used
paste but it just output 1 2 3 which is not
what I want. Is there any way to do this?
Thanks!
Use the
Hi Duncan Murdoch,
Thanks for the trick and it works!
--- Duncan Murdoch [EMAIL PROTECTED] wrote:
Bingshan Li wrote:
Hi all,
I have a vector and want to merge its elements one
by
one into a single string or number. For example,
x=c(1,2,3), what I want is a new number 123. I
used
Hi
I wrote a script which retrieves links from websites and loads them with scan:
...
website-tolower(scan(current.pages[i], what=character, sep=\n, quiet=TRUE))
...
However occasionally, the script finds broken links, such as
http://www.google.com/test. when the script tries to access such
See ?try as in this example:
current.pages - c(http://www.google.com;, http://www.google.com/test;,
http://www.yahoo.com;)
for(i in seq(along = current.pages)) {
website - try(tolower(scan(current.pages[i],
what=character, sep=\n, quiet=TRUE)))
if
I think you may misunderstand the meaning of all.x = FALSE.
Setting all.x to false ensures that only rows of x that have matches
in y will be included. Equivalently, if a row of x is not matched in
y, it will not be in the output. However, if a row in x is matched by
more than one row in y,
39 matches
Mail list logo