Try WBS.labs - as.vector(WBS)
WBS.labs[1]
substr(WBS.labs[1],1,1)
etc..
Cheers,
Simon.
Hello
1/ 'priors' is a table looking like:
W123 T678 S789
23 42 11
12 35 9
etc
2/ WBS - labels(priors) gives me a result of class list and length
1 looking like:
W123 T678
Umm. Again...
Try WBS.labs - as.vector(WBS[[1]])
WBS.labs[1]
substr(WBS.labs[1],1,1)
etc..
Cheers,
Simon.
Hello
1/ 'priors' is a table looking like:
W123 T678 S789
23 42 11
12 35 9
etc
2/ WBS - labels(priors) gives me a result of class list and length
1
On Mon, 16 May 2005, Anders Schwartz Corr wrote:
The row.names in my matrix seem to be out of order. I don't remember
putting row.names in in the first place, I don't see what use they are,
and they are out of order (perhaps because I sorted them at one point when
the data was in data.frame
Hi
the following gave me a shock:
atan(2)
[1] 1.107149
atan(2+0i)
[1] -0.4636476+0i
or, perhaps more of a gotcha:
atan(1.0001+0i)
[1] -0.7853482+0i
atan(0.+0i)
[1] 0.7853482+0i
evidently atan()'s branch cuts aren't where I thought they were.
Where do I look for documentation on this?
Suresh Krishna wrote:
Sonya Ku wrote:
Hi I am just beginning to learn R and have fitted several GAM to my
species presense/absence data.
I have used plot(x,y) using fitted.values as a y variable against
predictors. However, it is hard to see general relationships where
there is wide spread in
Hi,
poids taillefumeursexesportetat
85184ouihomme1malade
65175ouihomme1malade
74180ouihomme2gueri
79175ouihomme2malade
71165nonhomme3gueri
80185nonhomme3gueri
75
Laura Quinn wrote:
Please could someone point me in the right direction as I appear to be
having a total mental block with fairly basic PCA problem!
I have a large dataframe where rows represent independent
observations and columns are variables. I am wanting to perform PCA
sequentially on blocks
On Mon, 16 May 2005, Robin Hankin wrote:
Hi
the following gave me a shock:
atan(2)
[1] 1.107149
atan(2+0i)
[1] -0.4636476+0i
or, perhaps more of a gotcha:
atan(1.0001+0i)
[1] -0.7853482+0i
atan(0.+0i)
[1] 0.7853482+0i
evidently atan()'s branch cuts aren't where I thought they were.
Where do
Sorry, I don't think I made myself clear enough with my initial query!
I am wishing to investigate the temporal evolution of the pca: if we
assume that every 50 rows of my data frame is representitive of, for
instance, 1 day of data, I am hoping to automate a process whereby a pca
is performed on
Hallo
See lattice
temp-read.table(clipboard, header=T)
temp
poids taille fumeur sexe sport etat
1 85184oui homme 1 malade
2 65175oui homme 1 malade
3 74180oui homme 2 gueri
4 79175oui homme 2 malade
5 71165non
Apologies for the mass mailing today!
I am attempting to produce a contour plot for phsical data on a map
matrix. I have a small number of data points which each has an (x,y)
co-ordinate together with a corresponding value which I would like to
cvreate a contour plot for.
I have tried the
Laura Quinn wrote:
Sorry, I don't think I made myself clear enough with my initial query!
I am wishing to investigate the temporal evolution of the pca: if we
assume that every 50 rows of my data frame is representitive of, for
instance, 1 day of data, I am hoping to automate a process whereby a
hi all ... again
I'm sorry ... my answer doesn't deal with the subject.
off-topic ;(
Pierre
At 10:33 16/05/2005 +0100, Laura Quinn wrote:
Sorry, I don't think I made myself clear enough with my initial query!
I am wishing to investigate the temporal evolution of the pca: if we
assume that
Dear David,
I would like to use summarize(Hmisc) and print.xtable(xtable) in a
single Sweave document, but a conflict with the 'label' function
prohibits this at the moment!
Would you be able to correct the conflicting code? I will gladly test
the new package!
I have tried latex(Hmisc) to
Laura Quinn wrote:
Apologies for the mass mailing today!
I am attempting to produce a contour plot for phsical data on a map
matrix. I have a small number of data points which each has an (x,y)
co-ordinate together with a corresponding value which I would like to
cvreate a contour plot for.
I have
UweL == Uwe Ligges [EMAIL PROTECTED]
on Sun, 15 May 2005 16:41:22 +0200 writes:
UweL Kjetil Brinchmann Halvorsen wrote:
Tolga Uzuner wrote:
How do I suppress the following ?
Warning messages: 1: the condition has length 1 and
only the first element will
Dear Dr. Paul Murrel,
Yes, this is exactly what I need.
Thank's you very much.
Best wishes,
Muhammad Subianto
On this day 5/16/2005 5:36 AM, Paul Murrell wrote:
Hi
(cc'ed to Pierre Lapointe because this should answer the question
about [R] Centered overall title with layout() as well)
Muhammad
Hi everyone,
I have a question on parsing speed.
I have two functions:
F1
F2
As things are now, F2 calls F1 internally:
F2 = function(x){
if (something == 1){
y = F1(x)
}
if (something ==2){
do whatever
}
}
*Assuming there could be some difference*, is is faster to use the code
as written
Professor Ripley
thanks for this. Always good to know that I'm not missing any
documentation!
The source is clear; formula 4.4.39 effectively has a branch cut at
|z|=1.
A 'n' S show the standard branch cuts in their figure 4.4, which are
different (they
were the ones I was expecting).
Dear R-users,
I used to give commands such as:
source(file=~/path/to/file.R, chdir=TRUE)
but with the latest v. 2.1.0 it does not seem to work anymore.
I tried to figure out what it was going on and it seems that the string
for which
class(file)
[1] character
is changed to
class(file)
[1]
On Mon, 16 May 2005, Robin Hankin wrote:
Professor Ripley
thanks for this. Always good to know that I'm not missing any documentation!
The source is clear; formula 4.4.39 effectively has a branch cut at |z|=1.
A 'n' S show the standard branch cuts in their figure 4.4, which are
different (they
You can use the akima package to interpolate to a regular grid, then plot
that. Another choice is to fit a smooth surface, using any number of
smoothers available in R and CRAN.
Andy
From: Laura Quinn
Apologies for the mass mailing today!
I am attempting to produce a contour plot for
There was a pre-existing bug. ?source in 2.0.1 says
file: a connection or a character string giving the name of the
file or URL to read from.
yet it contained
if (chdir (path - dirname(file)) != .) {
You cannot reasonably run dirname() on a connection or a URL, and it
throws
One possible solution without renaming the functions is to add namespace to
either xtable or Hmisc. Given the size of Hmisc, it probably would be much
easier to do that with xtable.
With namespace in xtable, you can do xtable:::label() to refer to the
label() in xtable specifically.
Andy
Laura Quinn [EMAIL PROTECTED] wrote:
I am wishing to investigate the temporal evolution of the pca: if we
assume that every 50 rows of my data frame is representitive of, for
instance, 1 day of data, I am hoping to automate a process whereby a pca
is performed on every 50 rows of data and the
Even without a namespace one could explicitly reference the label
in xtable via:
xtable.label - get(label, package:xtable)
On 5/16/05, Liaw, Andy [EMAIL PROTECTED] wrote:
One possible solution without renaming the functions is to add namespace to
either xtable or Hmisc. Given the size of
Dear All,
I have an optimization problem of the form:
l=A*p=u
where l and u are vectors of lower and upper bounds, p is a vector
of parameters and A a linear constraint matrix.
When l=u, it is easy to reparametrize in which case the result is a new set
of parameters p' to be optimized.
My
Hi Andy and Gabor,
Thanks for your help so far! I am discovering another R dimension.
Trying to put my head around all thisthe conflict actually exposes
itself when calling summarize(Hmisc). Summarize(Hmisc) calls label
internally, so I can not call it explicitly. Simply calling
Do you need label in both xtable and Hmisc? If you only need
it in Hmisc and not in xtable then just be sure you have loaded
xtable first and Hmisc second. This:
search()
will give you the search path. It will find the first one on the
search path so if Hmisc is before xtable (which would
Dear useRs,
On a GNU/Linux box I want to run some code from the command line. This works
#!/bin/sh
R --vanilla -q --gui=X11 code.r
however I want the plots to appear in a window (as it happens when the
code is run interactively) instead of being saved in 'Rplots.ps'. Is
that doable?
Thank
You need to add the namespace to the source package, by adding a NAMESPACE
file. There's an R News article by Prof. Tierney on how to do this. Also
see the `Writing R Extensions' manual. You should get the package
maintainer to do that, as that constitute a change in the package source
code.
bogdan romocea wrote:
however I want the plots to appear in a window (as it happens when the
code is run interactively) instead of being saved in 'Rplots.ps'. Is
that doable?
You could explicitly startup an X11 graphics device before your first
plot in your R source code, something like:
x11()
I tried to follow your suggestions, but without success:
Error: couldn't find function xtable.mylabel-
... resulting from the code below.
Any suggestions?
Thanks,
Sander.
library(xtable)
xtable.mylabel - get(label, package:xtable)
library(Hmisc) # provides summarize
set.seed(1)
temperature -
Sander,
Thanks for pointing out the conflict between Hmisc and xtable. I am not
sure I have a good solution.
My understand of the namespace solution is that packages can specify
which variables to export for use by the package users. The label
function is not an internal function, rather one
Hi David,
Thanks for creating and supporting xtable. Glad I can contribute by
pointing out problems!
An earlier response from Frank Harrell Jr. suggests that the
responsibility to resolve the conflict lies primarily with you, as Hmisc
'was there first'.
Not sure how disputes over package
For fixing the problem you have, you need:
xtable.mylabel- - get(label-.xtable, package:xtable)
I.e., you need the replacement function.
One possibility of resolving the conflict, as I communicated with Frank, is
to make label() and label-() in Hmisc the S3 default methods, as xtable
defines
That seems like a good solution.
The one problem is that both packages would need their own
label generic functions if they are to operate independently
of each other so if they were both loaded the last one loaded
would give a warning that the label generic from the first loaded
package is
Dear Uwe,
Thank for you advice.
Now, I know how to do with my color printer to print black and white.
James Holtman have advise me about that.
Then I use a simple color like this to use my picture.
print.bw4 -c(blueF = #FF,
redF = #FF,
Dear R-mailers
I want to store data in a seperate file named 'XYZ'
so I uses sink function for it
i runs the loop , say 100 times, and so every of the 100 times the
function is called the result must go to the file. But after soem time
of running it says
Error in sink(C:/XYZ, append = TRUE) :
Hi there,
I'm trying to perform a step(), using variables from a data set with 32.000
observations. The upper model is not so long - (x1 + x2 + x3)^2 - where
x1...x3 are the explanatory variables. Yet, I got a memory problem when
performing it. The message is the following:
Error: cannot
Is this along the lines of what you are trying to do?
sim.data-data.frame(matrix(rnorm(350*10),350,10))
day-seq(1:350)
sim.data-data.frame(day,sim.data)
pc1.load.all-NULL
pc2.load.all-NULL
for (i in seq(0,300,by=50)){
sim.data.i-subset(sim.data,sim.data$dayisim.data$day(i+50))
Using label as an lvalue (i.e. on the left hand side of the assignment)
causes it to refer to a different function, not label itself.
Any any rate, looking at your example,
it seems that you don't actually need to use Hmisc and xtable at the same time
so just make sure that whichever you want
Anubhav Manglick wrote:
Dear R-mailers
I want to store data in a seperate file named 'XYZ'
so I uses sink function for it
i runs the loop , say 100 times, and so every of the 100 times the
function is called the result must go to the file. But after soem time
of running it says
Error in
Dimitri Joe wrote:
Hi there,
I'm trying to perform a step(), using variables from a data set with 32.000
observations. The upper model is not so long - (x1 + x2 + x3)^2 - where
x1...x3 are the explanatory variables. Yet, I got a memory problem when
performing it. The message is the following:
Hi,
I'm going through the book Introductory Statistics with R by Dalgaard to
teach myself R. At the end of each chapter there are some exercises. Does
anyone know of any place on the net where someone has posted the answers to
these?
I've looked at the author's and the publisher's site
Dear all,
I am dealing with a nonlinear model of the form yt = A*exp(-B*T)*Yt-1, where T
represents time and Yt-1 accounts for the accumulated values of y from T=0 to
t-1.
The problem of the models is that the error terms are autocorrelated, so I have
to deal with a model combining
Estimado:
Por medio de la presente notifico que hemos cambiado el dominio de Anew
e-Business Distribution por el siguiente: anew.com.ve
Mucho agradezco tomar en cuenta que ahora mi nueva dirección de correo será
[EMAIL PROTECTED]
Mil gracias
Saludos
Kam Fai Leon
Hello,
I notify you that
graek just graek [EMAIL PROTECTED] writes:
Hi,
I'm going through the book Introductory Statistics with R by
Dalgaard to teach myself R. At the end of each chapter there are
some exercises. Does anyone know of any place on the net where
someone has posted the answers to these?
I've
Dear R users,
I've found bugs.R : the functions for running WinBUGs from R that is
writen by Dr. Andrew Gelman who is a professor from Columbia University.
The bugs.R would be very useful for me, and I think many of you know it
as well. I followed the instuctions on Dr. Gelman's web to install
Hi, there:
I have a question on predict() function.
I built a set of trees using rpart and when I do prediction, I got the
following error:
Error in model.frame.default(Terms, newdata, na.action = act, xlev = attr(object
, :
factor V19 has new level(s) 45
Execution halted
I think the
Hi,
In Order Restricted Statistical Inference by Robertson et al (Chapter
1) there is an algorithm for isotonic regression with two or more
independent variables.
Has this been implemented anywhere in R?
Thanks,
Nathan
Nathan Leon Pace, MD, MStat
University of Utah
Salt Lake City, UT 84132
Professor Ripley,
Thanks very much. You comments were very helpful. I've got it
(almost) all figured out now. My model is for discrete data (discrete
response AND predictors). The issue I'm stuck on is that my saturated
model does NOT predict exactly; the constant is ~1874.052.
Here is
Federico Calboli wrote:
Hi everyone,
I have a question on parsing speed.
I have two functions:
F1
F2
As things are now, F2 calls F1 internally:
F2 = function(x){
if (something == 1){
y = F1(x)
}
if (something ==2){
do whatever
}
}
*Assuming there could be some difference*, is is faster to use the
(just my additional $.02)
... and as a general rule (subject to numerous exceptions, caveats, etc.)
1) it is programming and debugging time that most impacts overall program
execution time;
2) this is most strongly impacted by code readability and size (the smaller
the better);
3) both of which
I have a time series vector (not necessarily ts class) that has NAs in
it.
How can I omit the NAs when using aggregate.ts() to compute a function
on each window? If there is at least one non-NA value in each window,
I'd like to proceed with evaluating the function; otherwise, I would
like NA
I have a simple question, but I couldn't find the answer in R manuals.
Assume I have a list:
foo - list()
foo[[1]] - c(1, 2, 3)
foo[[2]] - c(11,22,33)
foo[[3]] - c(111,222,333)
foo
[[1]]
[1] 1 2 3
[[2]]
[1] 11 22 33
[[3]]
[1] 111 222 333
How to use list index to get a vector of, say, the
On 5/16/05, Luke [EMAIL PROTECTED] wrote:
I have a simple question, but I couldn't find the answer in R manuals.
Assume I have a list:
foo - list()
foo[[1]] - c(1, 2, 3)
foo[[2]] - c(11,22,33)
foo[[3]] - c(111,222,333)
foo
[[1]]
[1] 1 2 3
[[2]]
[1] 11 22 33
[[3]]
[1] 111
Its the indexing function written in ordinary function form. That is,
foo[1:2] can be written as [(foo, 1:2)
On 5/16/05, Luke [EMAIL PROTECTED] wrote:
Yes, it works. Althought I can understand the help page of sapply, I
don't know why it works. What is [?
-Luke
On 5/16/05, Gabor
Hi Gabor, thanks a lot. I understand it now. But Andrew's method is
easier for me to understand. Can I extend my question? I have a data
file, every line has such format:
2:102 5:85 ...
The number before colon is data entry index, the number after colon is
data entry value, and other data entries
If you have the data in files in such format, with one entry per line, you
can do something like:
dat - matrix(scan(fileWithData, sep=:), ncol=2, byrow=TRUE)
Then the first column of dat would be the indices, and the second column
would be the values.
Andy
From: Luke
Hi Gabor, thanks a
Dear R users,
I followed the instuctions on Dr. Gelman's web to install all
of documents that bugs.R needs, but when I try to run the school example that
the web posted in R, I got an error: couldn't find function bugs, what's
wrong?
Thanks,
Jia
Hello.
R is having some trouble installing a package because it passed arguments to
gcc which were non-existent directories and files. It also didn't find
g77, although it's in a directory in my $PATH; I tricked it by making a
sym link in /usr/bin.
What file does R get these parameters
Oops,
I just erased all my data using this gizmo that I thought would replace -9
with NA.
A) Can I get my tcn5 back?
B) How do I do it right next time, I learned my lesson, I'll never do it
again, I promise!
Anders Corr
for(i in 1:dim(tcn5)[2]){ ##for the number of columns
+
On Mon, 16 May 2005, Brooks Miner wrote:
Professor Ripley,
Thanks very much. You comments were very helpful. I've got it (almost) all
figured out now. My model is for discrete data (discrete response AND
predictors). The issue I'm stuck on is that my saturated model does NOT
predict
64 matches
Mail list logo