Fernando Saldanha schrieb:
I tried to assign values to specific elements of a time series and got
in trouble. The code below should be almost self-explanatory. I wanted
to assign 0 to the first element of x, but instead I assigned zero to
the second element of x, which is not what I wanted. Is
avneet singh wrote:
i got the first part:
agm.data$ProdCategory=as.factor(agm.data$ProdCategory)
the second i am still struggling with
For the second part, see ?is.na.
Uwe Ligges
On 4/26/05, avneet singh [EMAIL PROTECTED] wrote:
I have 2 questions. In essence i am trying to create product
Zhongming Yang [EMAIL PROTECTED] writes:
You can get the source code from the source package and modify
it. You'll have to read the relevant documentation about the tools you
need to compile it---see the archives, there was a discussion recently
about this, and see the documenation that comes
Zhongming Yang wrote:
Dear All:
I am working on writing some R functions to make statistical reports automatically. Dr. Harrell's Hmisc has all the wonderful stuff. But sometimes I need change some formats, so I want to read through it and make some modifications to fit my project.
Ideally,
Hi
On 26 Apr 2005 at 16:18, avneet singh wrote:
i got the first part:
agm.data$ProdCategory=as.factor(agm.data$ProdCategory)
the second i am still struggling with
?is.na
is.na(whatever)
is what you probably want.
Cheers
Petr
On 4/26/05, avneet singh [EMAIL PROTECTED] wrote:
I belive that the problem is not with the table, but with your predictions
which are not 0s and 1s.
Ales Ziberna
- Original Message -
From: Stephen Choularton [EMAIL PROTECTED]
To: 'R Help' r-help@stat.math.ethz.ch
Sent: Wednesday, April 27, 2005 4:19 AM
Subject: [R] making table() work
As you can se from the example bellow, survreg works prefeclty fine with
numerical values. (I'm runing R2.0.1 on WinXP(SP2) and 32bit AMD with
survival version 2.17.).
As the posting guide asks, plese provide a small example.
Ales Ziberna
library(survival)
Loading required package: splines
Thank you very much for all the
useful answers.
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Hello
Trying to install the MySQL package, I get the following error. The help
archive contains something on this issue but did not help. I work on linux
suse 9.3
Configuration error:
Could not locate the library libz required by MySQL.
The library libz however is not on any mirrors I
Ales - I have identified the problem. It is caused by missing data. In
my previous posting I was analysing a dataset which happened to have 190
missing values in the covariate. I compared two models:
r0 - survreg(s ~1)
r1 - survreg(s~x)
anova(r0,r1)
I was using anova to investigate the
Dear all,
I would like to call TLNise (Two-Level Normal indipendent sampling
estimation)
software within R.
This software estimates a hierarchical model and it can be download from
Philip Everson's website at
http://www.swarthmore.edu/NatSci/peverso1/TLNise/tlnise.htm;.
The TLNise software
Dear list;
This might sound a bit naive, but then I am new to linking C DLL's to R.
I have built a DLL using GCC and am able to load the DLL in R
(is.loaded(contents)==TRUE). When I include it in my function it returns
NaN for all the variables. My R function is,
dyn.load(c:/data/tempdll.dll)
accetta == accetta [EMAIL PROTECTED]
on Wed, 27 Apr 2005 11:55:56 +0200 writes:
accetta Dear all, I would like to call TLNise (Two-Level
accetta Normal indipendent sampling estimation) software
accetta within R.
accetta This software estimates a hierarchical model and it
Just for the record and to avoid confusion: R IS
supported in Crimson Editor. Look under syntax files
568 and 314. I've used it for a couple of years to no
ill effect. It is fine for light use to moderate use.
However, given the updates in R, maybe the syntax
files are a little long in tooth in a
Dear all,
How can I take a levels from a dataset.
For example,
data(iris)
x.iris - iris[,1:4]
y.iris - iris[,5]
y.iris
[1] setosa setosa setosa setosa setosa setosa
[7] setosa setosa setosa setosa setosa setosa
[139] virginica virginica
On Apr 27, 2005, at 8:21 AM, Muhammad Subianto wrote:
Dear all,
How can I take a levels from a dataset.
For example,
data(iris)
x.iris - iris[,1:4]
y.iris - iris[,5]
y.iris
[1] setosa setosa setosa setosa setosa setosa
[7] setosa setosa setosa setosa setosa
probably you want:
levels(y.iris)
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web:
Thanks you very much.
levels(y.iris)
Best regards,
Muhammad Subianto
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
Well... did you look at the help page on factors???
Did you even make a search?
The answer is within your question:
levels(iris[,5])
[1] setosa versicolor virginica
Eric
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Muhammad Subianto
On 4/26/05, Fernando Saldanha [EMAIL PROTECTED] wrote:
I tried to assign values to specific elements of a time series and got
in trouble. The code below should be almost self-explanatory. I wanted
to assign 0 to the first element of x, but instead I assigned zero to
the second element of x,
On Wed, 27 Apr 2005 10:25:55 +0100 João Mendes Moreira wrote:
My mistake.
I am sending the ImageBeforeError.RData file.
No, no, no! Please the read the posting guide and please read the
answers that were posted for you. As you obviously did not do that, let
me read it to you again:
Z
Dear all,
If I have dataset like,
A125
B 2
AA0
C 0
A11
B 3
A10
C 3
B 0
A145
A17
C 0
B 0
A10
B 6
B 3
Is there any function to split like,
A125
A11
A10
A145
A17
A10
or
AA0
C 0
A10
B 0
B 0
Hi,
Just wondering if anyone has created (or knows where one is available from)
an MSI installation file for R v2.0.1?
Many thanks,
Richard.
Richard Abraham
Senior Information Systems Officer
Department of Social Medicine, University of
Jan Sabee wrote on 4/27/2005 5:58 AM:
Dear all,
If I have dataset like,
A125
B 2
AA0
C 0
A11
B 3
A10
C 3
B 0
A145
A17
C 0
B 0
A10
B 6
B 3
Is there any function to split like,
A125
A11
A10
A145
A17
A10
or
AA
Hi,
I'm trying to convert a vector containing dates in
character format (dd/mm/yy): mdy.date (from date
package) seems to be able to do that, but it returns
to me a vector containing julian dates... but
negative!
for example:
16/12/03 is converted into -20470
it is because R recognizes year
On Tuesday 26 April 2005 21:52, Ivy_Li wrote:
Hello everybody,
Could I consult you two questions?
Recently I write some code about lattice plot.
1) bwplot function
I know the lattice default background color is grey and the box
color is green, but I don't like the color. So I change the
you could use as.Date(), i.e.,
ss - 16/12/03
as.Date(ss, %d/%m/%y)
julian(as.Date(ss, %d/%m/%y))
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel:
You haven't even begun to tell us how you are doing this. R does not
itself convert dates to numbers, to wit:
as.Date(16/12/03, %d/%m/%y)
[1] 2003-12-16
Here's one way:
x - as.Date(16/12/03, %d/%m/%y)
xx - as.POSIXlt(x)
xx$year - xx$year-100
as.Date(xx)
On Wed, 27 Apr 2005, alessandro carletti
Richard Abraham wrote:
Hi,
Just wondering if anyone has created (or knows where one is available
from) an MSI installation file for R v2.0.1?
Many thanks,
Richard.
The setup program build by Inno Setup, as you find it in the binaries
section of CRAN is much better than what you would get with
On Wed, 27 Apr 2005, Richard Abraham wrote:
Brian,
I can use an MSI installer package to install R on any number of Windows PCs
without leaving my desk by using Windows' Group Policy. Is this possible
using R's own scriptable installer? The FAQ doesn't say.
Well, did you look at the reference
Dear R-help,
First I apologize if my question is quite simple.
I need add some of data in the first place my dataset, how can I do that.
I have tried with rbind, but I did not succes.
0.1 3.6 0.4 0.9 rose
4.1 4.0 1.2 1.2 rose
4.4
Brian,
I can use an MSI installer package to install R on any number of Windows
PCs without leaving my desk by using Windows' Group Policy. Is this
possible using R's own scriptable installer? The FAQ doesn't say.
Thanks,
Rich.
--On 27 April 2005 14:17 +0100 Prof Brian Ripley [EMAIL PROTECTED]
Thanks, Gabor. Reading your suggestion (and a previous one as well) I
realized I surely expressed myself quite badly when asking the
question.
Luckily one person privately suggested the following solution, which
is exactly what I was looking for:
x[time(x)==2] - 0
This works wonderfully.
Hi,
I am trying to debug my code and looking for any tool to help me out with
it. My main problem is with the error messages I can not figure out where
they come from (what function produced them) and what do they mean. Is there
such a think as list of error messages produced by R and standard R
Try this:
x- matrix(1:12, nrow = 4, byrow = T)
y - matrix (13:24, nrow=4, by.row=T)
To add the rows of y before the rows of x:
rbind(y,x)
--
Tyler Smith
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
Muhammad Subianto said the following on 2005-04-27 15:48:
Dear R-help,
First I apologize if my question is quite simple.
I need add some of data in the first place my dataset, how can I do that.
I have tried with rbind, but I did not succes.
Can you send a reproducible example where rbind
Thanks Jari
although these libraries are installed now, I get the following message:
Configuration error:
could not find the MySQL installation include and/or library
directories. Manually specify the location of the MySQL
libraries and the header files and re-run R CMD INSTALL.
Somebody
If you want to add rows to a data frame using rbind, your additional rows must
be in a data frame with the same (column) names.
R data( iris )
R a - data.frame( Sepal.Length=c(1:4), Sepal.Width=c(2:5),
Petal.Length=c(3:6), Petal.Width=c(4:7), Species=rep(rosa,4))
R b - iris[1:10,]
R
Hi,
I would like to break a dataset in n.classes quantiles.
Till now, I used the following code:
Classify.Quantile - function (dataset, nclasses = 10)
{
n.probs - seq(0,1,length=nclasses+1)
n.labels = paste(C, 1:nclasses-1, sep=)
n.rows - nrow(dataset)
n.cols -
Thanks all for your help.
Kind regards,
Muhammad Subianto
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Tuszynski, Jaroslaw W. wrote:
Hi,
I am trying to debug my code and looking for any tool to help me out with
it. My main problem is with the error messages I can not figure out where
they come from (what function produced them) and what do they mean. Is there
such a think as list of error messages
Hello,
I'm trying to fit a special kind of proportional odds model from:
Whitehead et al. (2001). Meta-analysis of ordinal outcome using
individual patient data. Statistics in medicine 20: 2243-2260. (model 2)
The data are as follows:
library(nlme)
library(geepack)
library(Design)
Hello,
For reasons I don't understand, data() imports CSV (Comma-Separated
Values) as if they were delimited by semicolons instead of commas. (Are
semicolon-separated Comma-Separated-Value files common somewhere?) Given
that this is the case, if I choose to put comma-delimited CSV files in
my
I have found the tools listed by Uwe to be sufficient for my needs, but you
may also be interested in Mark Bravington's debug package.
-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
The business of the statistician is to catalyze the scientific learning
process. -
Hi:
I'm using RSPerl_0.6-3 calling R from Perl under UNIX system. My perl programs
with the RSPerl work well in my computer. If submitting these programs to a
UNIX system by 'ssh' or to GNQS system by 'qsub', these programs do not work
even though both systems can run R. Details are
Eric Rodriguez wrote:
Hi,
I would like to break a dataset in n.classes quantiles.
Till now, I used the following code:
Classify.Quantile - function (dataset, nclasses = 10)
{
n.probs - seq(0,1,length=nclasses+1)
n.labels = paste(C, 1:nclasses-1, sep=)
n.rows - nrow(dataset)
n.cols -
McGehee, Robert [EMAIL PROTECTED] writes:
Hello,
For reasons I don't understand, data() imports CSV (Comma-Separated
Values) as if they were delimited by semicolons instead of commas. (Are
semicolon-separated Comma-Separated-Value files common somewhere?) Given
that this is the case, if I
Dear R-users,
I'm felling kind of blocked on a quite simple problem and I wonder if
someone could give me a help with it.
My problem:
x[0] = 100
x[1] = (1+v[1])*x[0]
x[2] = (1+v[2])*x[1]
...
i.e.
x[i] = (1+v[i])*x[i-1]
and x[0]=k
Given a set of v values I wanted to obtain the corresponding x
Dear R:
First of all, nothing is wrong!
I just had a question about the following
Natural language support but running in an English locale
What does than mean, please?
Thanks in Advance
R 2.1.0 Windows
Laura Holt
mailto: [EMAIL PROTECTED]
__
Algebra:
cumprod(1+v)*x[0]
-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
The business of the statistician is to catalyze the scientific learning
process. - George E. P. Box
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Can someone please explain to me why
the dates get shifted by one day
when I create an its ( irregular time-series )
object from a matrix for which I've
assigned row names.
E.g. in the example run below,
why does the its object have dates
one-shifted from my original dates?
On Thu, 7 Apr 2005, michael watson (IAH-C) wrote:
Sorry for such an inane question - how do I control the order in which
the boxes are plotted using boxplot() when I pass it a formula and a
data.frame? It seems that the groups are plotted in alphabetical
order... I want to change this
Dear All
I would like to draw a picture with the density curve of a normal
distribution over a histogram of a set of random numbers extracted
from the same normal distribution. Is that possible?
Thanks in advance,
Paul
__
R-help@stat.math.ethz.ch
On Wed, 27 Apr 2005, XIAO LIU wrote:
I'm using RSPerl_0.6-3 calling R from Perl under UNIX system. My perl
programs with the RSPerl work well in my computer. If submitting these
programs to a UNIX system by 'ssh' or to GNQS system by 'qsub', these
programs do not work even though both systems
On Wed, 27 Apr 2005, Laura Holt wrote:
I just had a question about the following
Natural language support but running in an English locale
What does than mean, please?
See the `R Installation and Administration' manual, which does explain
this.
In short it means that your version of R has NLS
On Wed, 27 Apr 2005 19:06:07 +0100 Paul Smith wrote:
Dear All
I would like to draw a picture with the density curve of a normal
distribution over a histogram of a set of random numbers extracted
from the same normal distribution. Is that possible?
To quote Simon `Yoda' Blomberg: This is R.
Paul Smith wrote:
Dear All
I would like to draw a picture with the density curve of a normal
distribution over a histogram of a set of random numbers extracted
from the same normal distribution. Is that possible?
Yes.
If you like to know how, see e.g. ?hist and ?curve.
Uew Ligges
Thanks in
Laura Holt [EMAIL PROTECTED] writes:
Dear R:
First of all, nothing is wrong!
I just had a question about the following
Natural language support but running in an English locale
What does than mean, please?
$ LANG=pt_BR.UTF8 ~/r-devel/BUILD/bin/R
R : Copyright 2005, The R Foundation
Le 27 Avril 2005 14:06, Paul Smith a écrit :
I would like to draw a picture with the density curve of a normal
distribution over a histogram of a set of random numbers extracted
from the same normal distribution. Is that possible?
Sure. See curve() with add=TRUE. Don't forget to use prob=TRUE
On 4/27/05, Achim Zeileis [EMAIL PROTECTED] wrote:
I would like to draw a picture with the density curve of a normal
distribution over a histogram of a set of random numbers extracted
from the same normal distribution. Is that possible?
To quote Simon `Yoda' Blomberg: This is R. There is
Paul Smith [EMAIL PROTECTED] writes:
Dear All
I would like to draw a picture with the density curve of a normal
distribution over a histogram of a set of random numbers extracted
from the same normal distribution. Is that possible?
Yes. If you look at the scripts that go with the ISwR
I don't use 'its' enough to really know but usually when you see dates off
by one and are using POSIXct (which has time zone support) -- POSIXct is
what
'its' uses, it signals that the time zone is different than what you
expected.
Try to specify the time zone explicitly if 'its' supports it.
Hi.
I often wind up with many help windows cluttering my RGui screen when
running Windows R 2.0.1. Is there an R instruction to close one or more
help windows, or an RGui command to close all help windows?
Yours truly,
/Ronnen.
/P.S. E-mailed CC:s of posted replies appreciated.
Dear all,
Is there a function in R dealing with the NPMLE for current status data or
interval censored case 1 data?
Thanks,
Jimmy
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
Assume we have a function like:
foo - function(x, y)
how is it possible to define a binary indexing operator, denoted by $, so
that
x$y
functions the same as
foo(x, y)
__
R-help@stat.math.ethz.ch mailing list
I am trying to find a way to assign values to elements of a vector
that will be defined by a user. So I don't have the name of the vector
and cannot hard code the assignment in advance. In the example below I
have to get() the vector using its name. When I try to assign to an
element I get an
Yes, the Icens package handles all forms of censored data (1-dim)
On Apr 27, 2005, at 11:59 AM, Chao Zhu wrote:
Dear all,
Is there a function in R dealing with the NPMLE for current status
data or interval censored case 1 data?
Thanks,
Jimmy
[[alternative HTML version deleted]]
how about
assign( 'a', { z - get('a'); z[1] - 0; z } )
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Fernando Saldanha
Sent: Wednesday, April 27, 2005 3:22 PM
To: Submissions to R help
Subject: [R] assign to an element of a vector
I am trying to
We have just put a package GPArotation on CRAN. The functions in this
package perform an number of different orthogonal and oblique rotations
for factor analysis, using the gradient projection algorithm described
in Coen A. Bernaards and Robert I. Jennrich (2005), Gradient
Projection
That sounds like a recipe for headaches. If you want to use x$y because
you want a certain kind of x to act like a list with components for
certain y, then you probably want to make a class of objects (x) which
have x$y implemented as foo(x,y). That way you won't break existing code.
Reid
No, and in 6 years of that interface, no one else has asked. (The
information on open windows is not even retained.)
You might like to try the single-window pager option in the preferences.
On Wed, 27 Apr 2005, Ronnen Levinson wrote:
I often wind up with many help windows cluttering my RGui
I should have added that if you're not wedded to $ you can do
$ %f% - function(x,y) foo(x,y)
for whatever name f you want, and then %f% is a binary infix operator form
of foo().
Reid Huntsinger
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
On 4/27/05, Ali - [EMAIL PROTECTED] wrote:
Assume we have a function like:
foo - function(x, y)
how is it possible to define a binary indexing operator, denoted by $, so
that
x$y
functions the same as
foo(x, y)
Here is an example. Note that $ does not evaluate y so you have
You have the dimensions switched, in
double x [*MATDESC][*OBJ];
so when the dimensions aren't equal you do get odd things.
You might be better off defining functions to index into mat with a pair of
subscripts directly (.C() copies the argument anyway). Come to think of it,
there might be
It's not necessary to be that complicated, is it? AFAIK, the '$'
operator is treated specially by the parser so that its RHS is treated
as a string, not a variable name. Hence, a method for $ can just take
the indexing argument directly as given -- no need for any fancy
language tricks
Assume we have a function like:
foo - function(x, y)
how is it possible to define a binary indexing operator, denoted by $,
so
that
x$y
functions the same as
foo(x, y)
Here is an example. Note that $ does not evaluate y so you have
to do it yourself:
x - structure(3, class =
I have JUST started using R. I am using R 2.0.1 on a mac (os x) to
run another program (called GRASPER, Generalized Regression Analysis
and Spatial Prediction for R). When I try to run Grasper, I get an
error for tcl/tk:
library(grasper)
Loading required package: mgcv
This is mgcv 1.1-8
This could be really trivial, but I cannot find the right function to get
the name of an object as a character.
Assume we have a function like:
getName - function(obj)
Now if we call the function like:
getName(blabla)
and 'blabla' is not a defined object, I want getName to return blabla. In
I have a problem getting the lmer function of the lme4 package to use the
appropriate degrees of freedom for testing. Consider the Semiconductor data
from the SASmixed package:
library(SASmixed)
Semi.lme - lme(resistance ~ ET * position, random=~1|Grp, data=Semiconductor)
anova(Semi.lme)
Excuse me! I misunderstood the question, and indeed, it is necessary be
that complicated when you try to make x$y behave the same as foo(x,y),
rather than foo(x,y) (doing the former would be inadvisible, as I
think someelse pointed out too.)
Tony Plate wrote:
It's not necessary to be that
Dear all,
I am trying to fit a nonlinear model with a autocorrelation term, but everytime
I type in the command, I got an error message from Winwows and R closes itself.
The command line is as follows:
mod1-nlme(V~A*exp(-B*A.O)*Vac.t.1.,data,fixed=A+B~1,random=A+B~1|ORDINAL,+
On Wed, 2005-04-27 at 23:03 +, Ali - wrote:
This could be really trivial, but I cannot find the right function to get
the name of an object as a character.
Assume we have a function like:
getName - function(obj)
Now if we call the function like:
getName(blabla)
and 'blabla'
On 4/27/05, Ali - [EMAIL PROTECTED] wrote:
Assume we have a function like:
foo - function(x, y)
how is it possible to define a binary indexing operator, denoted by $,
so
that
x$y
functions the same as
foo(x, y)
Here is an example. Note that $ does
You did not explain the full context of what you are trying to do. Perhaps
this could help:
varName - as.name(bahbah)
varName
bahbah
substitute(a[1] - 0, list(a=varName))
bahbah[1] - 0
So you could perhaps eval() this expression.
Andy
From: Fernando Saldanha
I am trying to find a way
Søren Højsgaard wrote:
I have a problem getting the lmer function of the lme4 package to use the
appropriate degrees of freedom for testing. Consider the Semiconductor data
from the SASmixed package:
library(SASmixed)
Semi.lme - lme(resistance ~ ET * position, random=~1|Grp, data=Semiconductor)
Thank you. I can't believe how much time I spent going over that short
bit of code without noticing that I had switched the dimensions. I was
sure there was some arcane bit of pointer-lore that was eluding me.
Patrick Burns pointed out an alternative approach to me, leaving the
data in the
Here is an example. Note that $ does not evaluate y so you have
to do it yourself:
x - structure(3, class = myclass)
y - 5
foo - function(x,y) x+y
$.myclass - function(x, i) { i - eval.parent(parse(text=i)); foo(x,
i)
}
x$y # structure(8, class = myclass)
If I got it right, in the
On 27 April 2005 at 13:45, Chalasani, Prasad wrote:
| Can someone please explain to me why
| the dates get shifted by one day
| when I create an its ( irregular time-series )
| object from a matrix for which I've
| assigned row names.
I think you initiated the its() object the wrong way --
On 4/27/05, Ali - [EMAIL PROTECTED] wrote:
Here is an example. Note that $ does not evaluate y so you have
to do it yourself:
x - structure(3, class = myclass)
y - 5
foo - function(x,y) x+y
$.myclass - function(x, i) { i - eval.parent(parse(text=i));
foo(x,
i)
You are in fact using the contributed package 'nlme', not just R.
Please read both the section on BUGS in the FAQ and the posting guide, and
send a reproducible example to the nlme maintainer.
One thing the posting guide asks for is a useful subject line. Something
like
`A crash when
90 matches
Mail list logo