On Fri, 13 Aug 2010, Maha Bakoben wrote:
Hi,
I'm trying to fit a multinomial logistic regression to my data which
consists of 5 discrete variables (scales 1:10) and 1000 observations.
I get the following error:
Error in `row.names<-.data.frame`(`*tmp*`, value = c("NA.NA", "NA.NA", :
duplica
Hi
wootten.adrie...@gmail.com napsal dne 12.08.2010 14:15:30:
> Not quite what I was trying to say. The process generates a random
uniform
> number between 0 and 1 and compares to a specific conditional
probability. It
> is looking for this in particular:
>
> random number < Pr( rain(statio
Hi
write.table(tab, "clipboard", sep = "\t", row.names = FALSE)
or
write.table(tab, "somefile.xls", sep = "\t", row.names = FALSE)
Regards
Petr
r-help-boun...@r-project.org napsal dne 13.08.2010 01:47:40:
>
> I need a code to export my output to excel 2007.I am dealing with
> observations o
On 12.08.2010 22:52, Hintzen, Niels wrote:
R CMD build (lower case) indeed works. I was confused with older versions of
Rtools where it didn't matter if you used lower or upper case (as well as that
I thought under DOS
Actually, we are using the Windows command shell rather than any DOS.
it works! Thanks.
__
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 code.
Dear R friends,
I have a matrix with 2060 rows and 41 columns. One column is Date, another is
Transect, and another is Segment. I want to ensure that there are 9 Transects
(1 to 9) for each Date, and 8 Segments (1 to 8) for each Transect in the
matrix, by inserting rows where these are missing
Dear list,
I wish to use a specific driver to process an sweave document in the
inst/doc directory of a package. Specifically, I would like to use
either cacheSweave or pgfSweave to speed up the creation of the
vignette which requires lengthy computations. The same request would
also apply to the
Hi,
I've been meaning to ask the same question before.
Le 13/08/10 11:01, baptiste auguie a écrit :
Dear list,
I wish to use a specific driver to process an sweave document in the
inst/doc directory of a package. Specifically, I would like to use
either cacheSweave or pgfSweave to speed up
Hi
First of all, use data frame instead of matrix. Matrix is vector with
dimensions and hence it can not have mixed values (numeric, character,
date..).
So let's ASDF is your whole data frame
ASDF<-data.frame(Date=c("13/06/2006","19/06/2006","19/06/2006","19/06/2006","19/06/2006","19/06/2006"
On Fri, Aug 13, 2010 at 5:01 AM, baptiste auguie
wrote:
> Dear list,
>
>
> I wish to use a specific driver to process an sweave document in the
> inst/doc directory of a package. Specifically, I would like to use
> either cacheSweave or pgfSweave to speed up the creation of the
> vignette which re
Dear all,
Maybe we should move the discussion to r-devel? So please excuse the
cross-posting, it is to tell people at r-help where to find the rest of the
discussion (in case you agree with me).
I've been wondering about that, too.
Gabor, I use "fake" vignettes along your lines, too.
In or
Please read the posting guide and include a standalone example.
Maybe you want something like the results from
lm(weight ~ Time, data = ChickWeight, subset = Diet==1)
lm(weight ~ Time, data = ChickWeight, subset = Diet==2)
## ... etc ...
Then you could do
(m <- lm(weight ~ Time*Diet, data = C
or
library(xlsReadWrite)
write.xls(tab, "somefile.xls") # not .xlsx
or lots of other possibilities (e.g. RODBC, RExcel, gdata, WriteXLS)
you would have found searching the mailling list archive or looking in
the R import/export manual or the R wiki...
Cheers,
Hans-Peter
__
I did take your advice and change a few things in it to help it run. After
reading through your earlier reply again I understood exactly what you were
saying, so I did apply it in my function too. Thanks for all the advice! I
appreciate it!
Adrienne
On Fri, Aug 13, 2010 at 3:29 AM, Petr PIKAL
Hello André,
> I want to eliminate an element of a list:
>
> list <- seq(1,5,1)
That's not a list, it's a vector
> s <- sample(list,1)
>
> lets say s=3
> Now I want to remove 3 from the list: list2 = {1,2,4,5}
If all values are unique as in your example, this will work
x <- 1:5
s <- sample(x, 1
For the query below I have also included the follwing information. Thanks for
your replies
> str(FeaturePresenceMatrix)
chr [1:65530, 1:40] "0" "0" "0" "0" "1" "0" "0" "0" "0" ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:65530] "4" "5" "6" "7" ...
..$ : chr [1:40] "X1" "X2" "X3" "X4" ..
?as.numeric
On Aug 13, 2010, at 7:50 AM, Amit Patel wrote:
For the query below I have also included the follwing information.
Thanks for
your replies
str(FeaturePresenceMatrix)
chr [1:65530, 1:40] "0" "0" "0" "0" "1" "0" "0" "0" "0" ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:65530]
Hi
r-help-boun...@r-project.org napsal dne 13.08.2010 13:50:20:
> For the query below I have also included the follwing information.
Thanks for
> your replies
>
> > str(FeaturePresenceMatrix)
> chr [1:65530, 1:40] "0" "0" "0" "0" "1" "0" "0" "0" "0" ...
> - attr(*, "dimnames")=List of 2
>
Hi,
I want to build the table of a football league with 11
teams. All play together. So will 55 games.
Since there are an odd number of teams in each round a team
will not play.
The games will be:
games = urnsamples(1:11, x =
c('A','B','C','D','E','F','G','H','I','J','K'), size=2,
replace=F
hi,
maybe an ANCOVA is what you want, which is also done by lm in R
lm(y~x*z)
Am 12.08.2010 17:11, schrieb JesperHybel:
>
> I have a simple dataset of a numerical dependent Y, a numerical independent X
> and a categorial variable Z with three levels. I want to do linear
> regression Y~X for ea
Hi, I'd like to draw a polygon graph. I used the package lattice extra which
includes a function for that (see:
http://latticeextra.r-forge.r-project.org/#panel.xyarea&theme=default). But
i don't want the polygon ending with its filled border at the x-axis (like
in my code). Instead it should be r
Nice question Silvano !
teams <- LETTERS[1:11]
matches <- combn(teams, 2)
draw <- data.frame(team1=matches[1,], team2=matches[2,],
round=sequence(10:1) + rep(0:9, times=10:1))
Is there a prize :-)
Michael
On 13 August 2010 21:30, Silvano wrote:
> Hi,
>
> I want to build the table of a football
In my previous maiul I asked you to run R CMD INSTALL at first (rather
than R CMD check).
You could also look into the mentioned file
C:/Rp/namepackage.Rcheck/00install.out
But we really need that file to understand what is going on.
Uwe Ligges
On 13.08.2010 15:12, anderson nuel wrote:
On Aug 13, 2010, at 3:10 PM, Michael Bedward wrote:
> Nice question Silvano !
>
> teams <- LETTERS[1:11]
> matches <- combn(teams, 2)
> draw <- data.frame(team1=matches[1,], team2=matches[2,],
> round=sequence(10:1) + rep(0:9, times=10:1))
>
> Is there a prize :-)
Maybe you want to sponsor one
Hello,
I would like, if it is possible, to compare the effect of a variable across
regression models. I have looked around but I haven't found anything. Maybe
someone could help? Here is the problem:
I am studying the effect of a variable (age) on an outcome (local recurrence:
lr). I have buil
David,
In the Cox and many other regression models, the effect of a variable
is context-dependent. There is an identifiability problem in what you
are doing, as discussed by
@ARTICLE{for95mod,
author = {Ford, Ian and Norrie, John and Ahmadi, Susan},
year = 1995,
title = {Model inconsi
Hi,
the solution presented below works, but requires some manual
work to get the details right.
It is still difficult.
require(prob)
games = urnsamples(1:11, x =
c('A','B','C','D','E','F','G','H','I','J','K'), size=2,
replace=F,
ordered=FALSE)
games
(round1 = sample(55,5))
(round2 = sample
Dear r-help,
I try this command R CMD INSTALL,but still there are errors.
I look into the installation log file in the namepackage.Rcheck :
* using log directory 'C:/Rp/namepackage.Rcheck'
* using R version 2.10.1 (2009-12-14)
* using session charset: ISO8859-1
* checking for file 'namepackage/D
Dear R team,
I have a simple question.
I tried this command:
phyper(17,449,19551,181, FALSE)
[1] 1.47295e-07
and then I tried this command:
(fisher.test(matrix(c(17,449,181,19551),2,2),
alternative='greater'))$p.value
[1] 3.693347e-06
Shouldn't be identical the results of the two commands ?
Wh
Example is spot on - sr for not providing one myself.
The results you calculate are what I'm looking for.
Would like a function F where I could type:
F(weight ~ Time, data = ChickWeight, SOME ARGUMENT = Diet))
Resulting in
for (i in 1:4){
print(
lm(weight ~ Time, data = ChickWeight, subset =
I have been using generalized linear models in SPSS 18, in order to build
models and to calculate the P values. When I was building models in Excel
(using the intercept and Bs from SPSS), I noticed that the graphs differed
from my expectations. When I ran the dataset again in R, I got totally
diff
OK,
thank you very much for the answer.I will look into that. Hopefully I'll find
smoething that will work out.
Best,
David Biau.
De : Frank Harrell
Cc : r help list
Envoyé le : Ven 13 août 2010, 15h 50min 18s
Objet : Re: [R] How to compare the effect of
Have a look at lmList() in the nlme package.
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of JesperHybel
> Sent: Friday, August 13, 2010 7:56 AM
> To: r-help@r-project.org
> Subject: Re: [R] Linear regression on several groups
Hello,
I am using the val.prob function in the Design package. I understand how
the Brier quadratic error score is calculated, but I do not know how the
Brier score computed on the calibrated rather than raw predicted
probabilities (B cal) is calculated. My question is: how are the calibrated
pr
Hi,
my first email, I hope I don't violate any rules.
I want to run a panel (cross-section-time-series) regression with
fixed effects. I have count data (patent citations) so a Poisson
distribution applies. But I also want to control for over-dispersion
and and excess zeros. I think I read all manu
On 13 August 2010 23:29, peter dalgaard wrote:
>
>> Is there a prize :-)
>
> Maybe you want to sponsor one, because your solution certainly doesn't work!
>
> I see 10 games in the 10th round, all involving team K. That's not how to
> arrange a tournament!
Yes, I'm not going to get a job with
On Fri, 13 Aug 2010, Steffen Krutzinna wrote:
Hi,
my first email, I hope I don't violate any rules.
I want to run a panel (cross-section-time-series) regression with
fixed effects. I have count data (patent citations) so a Poisson
distribution applies. But I also want to control for over-dispers
OK, second attempt. I think this one is a goer (hope)...
teams <- LETTERS[1:11]
matches <- combn(teams, 2)
draw <- data.frame(team1=matches[1,], team2=matches[2,])
# someone will know how to do this in one line...
time <- numeric(55)
k <- 0
for (i in 1:10) {
t0 <- 2*i - 1
n <- 10 - i + 1
fo
Dear All,
Could anyone give me a hand to suggest few packages in R to running Kalman
prediction and filtration ?
Thanks
Fir
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://ww
Hi,
Is there a way to apply the diff operator over a large data frame, by groups in
a single function?
I have a toy data frame that looks like this:
MEASUREMENT BLOCK TRATMENT VALUE1
VALUE2
1 1
On Aug 13, 2010, at 3:47 PM, Andrea Franceschini wrote:
>
> Dear R team,
> I have a simple question.
>
> I tried this command:
> phyper(17,449,19551,181, FALSE)
> [1] 1.47295e-07
>
> and then I tried this command:
> (fisher.test(matrix(c(17,449,181,19551),2,2),
> alternative='greater'))$p.valu
Please check the code. I hope that Brier is on the uncalibrated
probabilities.
Calibrated probabilities are from 1/(1+exp(-[a+b logit(uncalibrated
probs)]) where a and b are maximum likelihood estimators (they will be
0 and 1 in training data).
Frank
Frank E Harrell Jr Professor and Ch
On Aug 13, 2010, at 4:45 PM, Michael Bedward wrote:
> teams <- LETTERS[1:11]
> matches <- combn(teams, 2)
> draw <- data.frame(team1=matches[1,], team2=matches[2,])
>
> # someone will know how to do this in one line...
> time <- numeric(55)
> k <- 0
> for (i in 1:10) {
> t0 <- 2*i - 1
> n <- 1
On Aug 13, 2010, at 5:15 PM, peter dalgaard wrote:
>
> On Aug 13, 2010, at 4:45 PM, Michael Bedward wrote:
>
>> teams <- LETTERS[1:11]
>> matches <- combn(teams, 2)
>> draw <- data.frame(team1=matches[1,], team2=matches[2,])
>>
>> # someone will know how to do this in one line...
>> time <- nu
Silvano uel.br> writes:
>
> Hi,
>
> I want to build the table of a football league with 11
> teams. All play together. So will 55 games.
> Since there are an odd number of teams in each round a team
> will not play.
The easy solution is moving around a table with one team pausing.
#
I ask the question also because I found this line in Wikipedia:
"The test (see above) based on the hypergeometric distribution
(hypergeometric test) is identical to the corresponding one-tailed
version of Fisher's exact test".
Is this wrong ? May I kindly ask a friendly explanation for
not-exper
Hi folks,
R on Ubuntu 10.04 64 bit.
Performed following steps on R:-
### to access to the object
> data(InsectSprays)
### create a .csv file
> write.csv(InsectSprays, "InsectSpraysCopy.csv")
On another terminal
$ sudo updatedb
$ locate InsectSpraysCopy.csv
/home/userA/InsectSpraysCopy.csv
#
Performed following steps on R:-
### to access to the object
data(InsectSprays)
### create a .csv file
write.csv(InsectSprays, "InsectSpraysCopy.csv")
On another terminal
$ sudo updatedb
$ locate InsectSpraysCopy.csv
/home/userA/InsectSpraysCopy.csv
### Read in some data
test01 <- re
Awesome, that works great, and it cuts my runtime down by a lot.
thanks baptiste
I totally forgot that I could just check to see if the number was inbetween
via less than and greater than rather than having to construct the vector.
findInterval also helps with another problem I was having somew
Just to amplify a bit on what Frank said...
Except in special circumstances (othogonal designs, say), regression
models are only "guaranteed" to produce useful predictions -- they may
not tell you anything meaningful about the relative effects of the
regressors because, as Frank said, that depends
Is there a "more efficient/elegant" way to obtain the result "z" below.
a <- c('pink','pink','blue','blue','gold','gold')
b <- c(5,8,9,12,7,4)
agg <- aggregate(x=b,by=list(a), FUN='mean')
m <- match(a, agg[,1])
z <- agg[m,2]
z
[[alternative HTML version deleted]]
___
I try to produce and modify shapes in a PowerPoint presentation but run into a
difficulty setting a variable.
library(RDCOMClient)# load
RDCOMClient package
library(SWinTypeLibs) # package
SWinTypeLibs from Om
Steffen--
You might want to take a look at the MCMCglmm package by Jarrod
Hadfield. It can run a zero-inflated overdispersed Poisson model with
random-effects. (I realize you asked about a fixed-effects model, but
MCMCglmm ought to functionally give you what you want -- an appropriate
mode
From: Stephen Liu
>
> Hi folks,
>
> R on Ubuntu 10.04 64 bit.
>
> Performed following steps on R:-
>
> ### to access to the object
> > data(InsectSprays)
>
> ### create a .csv file
> > write.csv(InsectSprays, "InsectSpraysCopy.csv")
>
>
> On another terminal
> $ sudo updatedb
> $ locate Inse
Hi Erik,
I followed following video as example;
ANOVA in R
http://www.youtube.com/watch?v=Dwd3ha0P8uw&feature=related
Now I got it done;
> boxplot(test01$count ~ test01$spray)
Continued:
> InsectSprays.aov <-(test01$count ~ test01$spray)
> summary(InsectSprays.aov)
Length ClassMode
Hey everyone,
I don't have a question. Instead some helpful advice with things I've
learned from trying to connect 'R' to databases using RODBC.
ROBDC is a very handy tool that, once you have everything fixed up
nicely, is a great way to have scripts run fairly autonomously, safe in the
On Fri, Aug 13, 2010 at 12:26 PM, Eva Nordstrom wrote:
> Is there a "more efficient/elegant" way to obtain the result "z" below.
>
> a <- c('pink','pink','blue','blue','gold','gold')
> b <- c(5,8,9,12,7,4)
> agg <- aggregate(x=b,by=list(a), FUN='mean')
> m <- match(a, agg[,1])
> z <- agg[m,2]
> z
# how would I code in R to look at the letter of the alphabet
# in the second column and create a indicator column for the
# corresponding letter?
data(InsectSprays)
InsectSprays$spray
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/li
On Aug 13, 2010, at 1:03 PM, TGS wrote:
# how would I code in R to look at the letter of the alphabet
# in the second column and create a indicator column for the
# corresponding letter?
data(InsectSprays)
InsectSprays$spray
It's already what most people mean when they say "indicator column"
How about:
tmp <- expand.grid(one = 1:11, two = 1:11)
tmp$week <- ( ( tmp$one + tmp$two ) %% 11 ) + 1
# reformat for simplicity
tmp2 <- tmp[ order(tmp$week), ]
tmp3 <- tmp2[ tmp2$one < tmp2$two , ]
### do some checks to make sure everyone plays everyone
###exactly once and each team plays
To clarify, I'd like to create a column of indicators for the respective
letters so that I could maybe do regression on indicators, etc.
For instance, "A" gets "1", "B" gets "2", and so on.
On Aug 13, 2010, at 10:19 AM, David Winsemius wrote:
On Aug 13, 2010, at 1:03 PM, TGS wrote:
> # how wo
FMH yahoo.com> writes:
>
> Dear All,
>
> Could anyone give me a hand to suggest few packages in R to running Kalman
> prediction and filtration ?
Teach a person to fish ...
install.packages("sos")
library(sos)
findFn("kalman")
## perhaps this could be added to the posting guide?
I am trying to install R-2.11.1 from sources on Ubuntu 10.04. I am
getting the following error when I run ./configure:
configure:6683: checking how to run the C preprocessor
configure:6753: result: gcc -E
configure:6773: gcc -E -I/usr/local/include conftest.c
configure:6773: $? = 0
configure:6787
Hello.
I´m studing extreme values and i´m using the packages: evd, fExtremes and
evir.
I need to convet timeSeries (or data.frame) to class "POSIXct". Like "bmw"
data:
> is(bmw)
[1] "numeric" "vector" "index_timeSeries"
Please help!!
Thank you
[[alternative HTML version deleted]]
__
Giovanni Petris wrote:
I am trying to install R-2.11.1 from sources on Ubuntu 10.04.
Any particular reason? There are Ubuntu packages available...
I am
getting the following error when I run ./configure:
configure:6683: checking how to run the C preprocessor
configure:6753: result: gcc -E
R/S does all of that automatically for you, you do not need to manually create
the indicator variables.
If you do something like:
> fit <- lm( Sepal.Width ~ Species, data=iris, x=TRUE)
Then look at the matrix actually used:
> fit$x
Or the output:
> summary(fit)
You will see that Species was
TGS wrote:
To clarify, I'd like to create a column of indicators for the
respective letters so that I could maybe do regression on indicators,
etc.
For instance, "A" gets "1", "B" gets "2", and so on.
That's precisely how factors are handled by modeling functions in R!
No need to reinvent th
I just tried to do the same task (see beloew) using the rcom package. This
works fine (see below).
Still I would like to now how this can be done using RDCOMClient.
TIA, Mark
library(rcom)
ppt <- comCreateObject("PowerPoint.Application")
pres <- comInvoke(comGetProperty(ppt, "Presentations"), "A
I need to read a data set that has multiple observations per person (like
scanner panel data). I want to use optim and compute the objective function
person by person where each person has multiple observations (as in latent
class models a la Kamakura and Russell (JMR, 1989))? I tried to use the
(
On Aug 13, 2010, at 1:22 PM, TGS wrote:
To clarify, I'd like to create a column of indicators for the
respective letters so that I could maybe do regression on
indicators, etc.
You can just enter that column name in a regression formula. No need
to create a separate variable. Try:
lm(c
If you just want to visualize the effect on one variable on the response from
some different models then you might try Predict.Plot from the TeachingDemos
package. It takes a little tweaking to get it to work with cph objects, but
here is a basic example (partly stolen from the help page for cp
# Greg, if R automatically does that then I don't know why it's treating each
indicator
# as a different regressor. In other words, I am interested in treating 'spray'
as one
# independent variable.
#
# Erik, which book do you suggest I read? Thanks.
data(InsectSprays)
lm(InsectSprays$count ~ 0
Read documentation for TukeyHSD by typing the command:
?TukeyHSD
The input to that function should usually be, "a fitted model object,
usually an aov fit."
You have not created a "fitted model object."
This seems to work:
model <- aov(InsectSprays$count ~ InsectSprays$spray)
TukeyHSD(model)
T
Dear all,
I was wondering if there is a simple way to avoid printing the multiple
cross-validation automatic output to the console of recursive partitionning
functions like rpart or mvpart. For example...
> data(spider)
>
mvpart(data.matrix(spider[,1:12])~herbs+reft+moss+sand+twigs+water,spider,x
Why would you want to do this? Confidence intervals tell you about the
uncertainty of the mean of y give x, not the individual data points. It may
make more sense to use prediction intervals that tell you about individuals
rather than means, but that still means throwing away alpha% of legitim
This is all very interesting indeed.
so I appreciate that the effect of a variable will depend on the presence of
other variables and that the effect of this variable has a statistical meaning
only in a specific model. With the particularity of inconsistency if data arise
from non normal distri
R Experts,
I would like to create a series of variables without having
to assign a separate line of code for each new variable. My dataframe (DF)
contains
two groups of linked variables (ESP1:ESP9) and (ECRL1:ECRL9). Within ESP1:ESP9
are
abbreviated species codes (full dataframe contains 26 co
If you're trying to follow the youtube video you have a typing mistake here:
InsectSprays.aov <-(test01$count ~ test01$spray)
I think this should be:
InsectSprays.aov <-aov(test01$count ~ test01$spray)
youre missing the functioncall "aov" on the right hand side of the
assignment operator '<-'
Frank E Harrell Jr Professor and ChairmanSchool of Medicine
Department of Biostatistics Vanderbilt University
On Fri, 13 Aug 2010, Biau David wrote:
This is all very interesting indeed.
so I appreciate that the effect of a variable will depend on the
presenc
Hello,
Is there a way to get a single TRUE or FALSE statement from comparing two
vectors? For example,
c(1,2,3) == c(1,2,3)
produces
TRUE TRUE TRUE
where I would like it to produce only
TRUE
for use in an if statement.
Likewise, when two vectors are not exactly identical (in all elements) I
w
Comments inline below.
-- Bert
On Fri, Aug 13, 2010 at 11:04 AM, Biau David wrote:
> This is all very interesting indeed.
>
> so I appreciate that the effect of a variable will depend on the presence of
> other variables and that the effect of this variable has a statistical
> meaning only in a
?all
nikhil.l...@gmail.com
On Aug 13, 2010, at 2:49 PM, Downey, Patrick wrote:
c(1,2,3) == c(1,2,3)
__
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
?all
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
spec.
Hi Mitch,
How about identical()?
> identical(c(1,2,3), c(1,2,5))
[1] FALSE
> identical(c(1,2,3), c(1,2,3))
[1] TRUE
See ?identical and ?all.equal for more information.
HTH,
Jorge
On Fri, Aug 13, 2010 at 2:49 PM, Downey, Patrick <> wrote:
> Hello,
>
> Is there a way to get a single TRUE or FA
Patrick,
See all(). For example,
> all(c(1,2,3)==c(1,2,3))
[1] TRUE
> all(c(1,2,3)==c(2,1,3))
[1] FALSE
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Downey, Patrick
> Sent: Friday, August 13, 2010 1:49 PM
> To: r-help@r
all(c(1, 2, 3) %in% c(1,2,3))
On Fri, Aug 13, 2010 at 3:49 PM, Downey, Patrick wrote:
> Hello,
>
> Is there a way to get a single TRUE or FALSE statement from comparing two
> vectors? For example,
> c(1,2,3) == c(1,2,3)
> produces
> TRUE TRUE TRUE
>
> where I would like it to produce only
> TRUE
have a look at function all() but also at function all.equal() -- for
your example,
x1 <- c(1,2,3)
x2 <- c(1,2,3)
x3 <- c(1,2,5)
all(x1 == x2)
all(x1 == x3)
# this safer
isTRUE(all.equal(x1, x2))
isTRUE(all.equal(x1, x3))
I hope it helps.
Best,
Dimitris
On 8/13/2010 8:49 PM, Downey, Patri
So you want 1 degree of freedom for InsectSprays? You believe that the
difference between A and B is exactly the same as between B and C which is
exactly the same as between D and E (etc.)? that seems an odd assumption, but
you can get that by using as.numeric (as I and others have already sta
Hello!
If I have in my data frame MyFrame a variable saved as a Date and want
to translate it into years, I currently do it like this using "zoo":
library(zoo)
as.year <- function(x) as.numeric(floor(as.yearmon(x)))
myFrame$year<-as.year(myFrame$date)
Is there a function that would do it directl
You've tried:
as.numeric(format(Sys.Date(), '%Y'))
On Fri, Aug 13, 2010 at 4:36 PM, Dimitri Liakhovitski <
dimitri.liakhovit...@gmail.com> wrote:
> Hello!
>
> If I have in my data frame MyFrame a variable saved as a Date and want
> to translate it into years, I currently do it like this using "
On Aug 13, 2010, at 3:36 PM, Dimitri Liakhovitski wrote:
Hello!
If I have in my data frame MyFrame a variable saved as a Date and want
to translate it into years, I currently do it like this using "zoo":
library(zoo)
as.year <- function(x) as.numeric(floor(as.yearmon(x)))
myFrame$year<-as.yea
myFrame$year<-years(strptime(x))
On Fri, Aug 13, 2010 at 12:36 PM, Dimitri Liakhovitski
wrote:
> Hello!
>
> If I have in my data frame MyFrame a variable saved as a Date and want
> to translate it into years, I currently do it like this using "zoo":
>
> library(zoo)
> as.year <- function(x) as.nu
# I wasn't trying to do ANOVA. I was simply trying to figure out how regress
count on sprays (this is after I saw another poster asking an unrelated
question with the InsectSprays dataset).
#
# Anyhow, David clarified this but also, thanks for your explanation as well.
rm(list = ls()); sprays <
My decision tree grows only with one split and based on what I see in
E-Miner it should split on more variables. How can I adjust splitting
criteria in R?
Also is there way to indicate that some variables are binary, like variable
Info_G is binary so in the results would be nice to see "2) Info_G=
But in your comment, it sounded like you were in the realm of ANOVA when you
made the degrees of freedom comment. I'm not going to get into the theory of
statistics with you :) I'm just trying to learn R, take it easy. Yes, I
understand that in the regression problem, the degrees of freedom for
On 8/13/2010 11:08 AM, Hosack, Michael wrote:
R Experts,
I would like to create a series of variables without having
to assign a separate line of code for each new variable. My dataframe (DF)
contains
two groups of linked variables (ESP1:ESP9) and (ECRL1:ECRL9). Within ESP1:ESP9
are
abbreviate
Dear users,
I would like to plot several histograms superimposed on the same panel
with different colors, with superimposed polygons appearing with
transparency effects. I also want estimated densities to appear on the
same plot. For several reasons, including that I like it, I want to use
the lat
Hi Yvonnick,
Have you looked at ggplot2? There are two examples at the end of [1].
HTH,
Jorge
[1] http://had.co.nz/ggplot2/geom_histogram.html
On Fri, Aug 13, 2010 at 4:12 PM, Yvonnick NOEL <> wrote:
> Dear users,
>
> I would like to plot several histograms superimposed on the same panel
>
Take a look on this
Packages:
- KFTRACK
- UKFSST
- TRACKIT
2010/8/13 FMH
> Dear All,
>
> Could anyone give me a hand to suggest few packages in R to running Kalman
> prediction and filtration ?
>
> Thanks
> Fir
>
>
>
>
> __
> R-help@r-project.org m
Andrea Franceschini wrote:
> I ask the question also because I found this line in Wikipedia:
> "The test (see above) based on the hypergeometric distribution
> (hypergeometric test) is identical to the corresponding one-tailed
> version of Fisher's exact test".
>
> Is this wrong ? May I kindly as
1 - 100 of 143 matches
Mail list logo