Hi,
I am new to R and I am trying to perform a post hoc tukey test using the
multcomp package's ghlt for a lme model. My first attempt at doing so gave
me an output, HOWEVER I have tried to do this again, it keeps coming up with
the error:
(Error in contrMat(table(mf[[nm]]), type = types[pm]) :
On a methodological level, if the choices do not correspond on a cardinal or
at least ordinal scale, you don't want to use correlations. Instead you
should probably use Cramer's V, in particular if the choices are
multinomial. Whether the wide format is necessary will depend on the format
the funct
Your questions is pretty opaque. Please adhere to the posting guide. Provide
a self-contained (!) example (i.e., code) that reproduces your problem.
Generally, you would predict like this:
x<-rnorm(100)
e<-rnorm(100)
y<-x+x^2+e
reg<-gam(y~s(x))
plot(reg)
predict(reg,newdata=data.frame(x=2))
wher
I have 5 GAMs ( model1, model2, model3, model4 and model5)
Before I use some data X(predictor -January to June data) to form a equation
and calculate the expected value of Y (predictand -January to June). After
variable selection, GAMs (Model 1)were bulit up! R-square :0.40
NOW, I want to use new
Hi,
I have a few methodological and implementation questions for ya'll. Thank
you in advance for your help. I have a dataset that reflects people's
preference choices. I want to see if there's any kind of clustering effect
among certain preference choices (e.g. do people who pick choice A also pic
Dear R-users,
I am checking the Cox proportional hazard model with six covariates, and
all of them are time-dependent.
I fitted cox model and try to get the beslow estimator for the baseline
cumulative hazard function.
My question is whether the result of basehaz is actually a breslow estimato
>>> How do I remove all objects except one in R?
Here is another way. ls() gives you a list. get a number (n) of the item
you'd like to keep,
and then do:
rm(list=ls()[n+1:last])
rm(list=ls()[1:n-1])
ls() should return only one object after this.
--
View this message in context:
http://r.78
Dear R-users,
I am trying to produce a levelplot of a matrix of values (430x430) using
"levelplot" from lattice package. My problem is that I am not able to obtain an
image without blank/white lines in some rows and columns (a continuous image).
Attached are two png files (different resolution)
I have been trying to read a dataset which has spaces in column names using
dbGetQuery from RJDBC.
* dataFrame<-dbGetQuery(conn,"select 'Sepal Length','Sepal Width' from
"326_1_Result")*
The resulting dataframe contains column names as
"*Sepal.Length" "Sepal.Width" *
But i would like to mainta
On Wed, 28 Sep 2011, Jean V Adams wrote:
> I want to overlay a small inset map on top of another map, but I can't
> figure out how to do it.
> For example, here are two different maps:
>
> # map 1 - Ohio
> map("state", region= "ohio")
>
> # map 2 - US with Ohio darkened
> map("state")
> map("stat
The consensus is that it is a very bad idea for a file nominally described as a
CSV file to have a varying numbers of fields from record to record. If you have
need for such a file and go to whatever lengths you need to in order to create
it, please mark it as something other than a CSV file whe
This might be obvious but I was wondering if anyone knows quick and easy
way of writing out a CSV file with varying row lengths, ideally an
initial data read from a CSV file which has the same format. See example
below.
I found it quite strange that R cannot write it in one go, so one must
appen
Plaintext data looks like this:
P <- structure(list(X77.BANK = c(0, 0, 0, 0.003181659, -0.006386799,
0.028028724, -0.015347692, -0.015910002, 0.00322897, -0.013062473,
0, -0.03809005, 0.021189299, -0.003460532, -0.010550182, 0.01744389,
0.010139631, -0.01709, 0.010299957, 0), A...A.MATERIAL =
How about the subplot() function in the TeachingDemos package? It is
basically using par() but you do not have to learn all the gory
details.
Regards,
Yihui
--
Yihui Xie
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On T
regexpr() can be used instead of regMatchPos() in S+ and
R. (It has been in S+ longer than regMatchPos.)
Instead of using regexpr and substring I usually use sub()
or gsub(). E.g., since S+ 8.0 and a long time ago in
R you can do
x <- c("Cycle 1 Day 15 Hour 2", "Cycle 2 Day 3")
sub("^.*Day +
On Tue, Sep 27, 2011 at 5:49 PM, Michael Karol wrote:
> R Experts:
>
>
>
> I am trying to isolate the numeric value of day from a string that might
> look like "Cycle 1 Day 8" or "Cycle 12 Day 15".
>
>
>
> In essence, what I need is a function that can look at a character
> string and tell me the
R Experts:
I am trying to isolate the numeric value of day from a string that might
look like "Cycle 1 Day 8" or "Cycle 12 Day 15".
In essence, what I need is a function that can look at a character
string and tell me the location within the string where it matches with
a given string. I
Tal,
require(rms)
f <- Rq()
print(f, latex=TRUE)
latex(f)
Frank
Tal Galili wrote:
>
> Hello dear R help members,
>
> I wish to get a nice LaTeX table for a rq object.
> Trying to use the functions I found so far wouldn't work. I can
> start opening the functions up, but I am wondering if
On Tue, Sep 27, 2011 at 6:15 PM, Jean V Adams wrote:
> For example,
>
> songs <- c("ABCABAABABABCAB", "ABACAB", "ABABCABCBC")
> counts <- gregexpr("ABC", songs)
> sapply(counts, length)
That will still return '1' for the case where its not found, because of the -1.
sapply(counts,function(x){su
Since you are only looking at the distance between two points, they must
fall on a line so no matter how many values you have for each point, their
dimension is still 1. Mahalanobis distance is a way of measuring distance in
multivariate space when the variables (columns) are correlated with one
an
Hi!
2011/9/27 :
> We downloaded R 2.13.1 for UBUNTU. We try to install several packages:
> car, maps, maptools, raster, and we found the following warning or error
> message:
I suggest to use apt-get (synaptic) as much as possible to install R
packages and then use install.packages() for those
Hello dear R help members,
I wish to get a nice LaTeX table for a rq object.
Trying to use the functions I found so far wouldn't work. I can
start opening the functions up, but I am wondering if I had missed some
function which is the one I should be using.
Here is an example session for a bunch
Hi.
We downloaded R 2.13.1 for UBUNTU. We try to install several packages:
car, maps, maptools, raster, and we found the following warning or error
message:
"
Error:
**buffer overflow detected ***=/user/lib/R/bin/exec/R terminated***
We also found the usual error message that the packages are
Hi
I'm using this :)
if (is.element('DESeq', installed.packages()[,1]) == FALSE) {
install.packages('DESeq') }
Robin
2011/9/27 Fabrice Tourre
> Dear list,
>
> How can I detect a package is installed or not? If not, then install it.
>
> For example, in a script, I want to check the package DES
>> apply(mt, 1, function(x) x[!is.nan(x)] )
> [[1]]
> [1] 1 3
>
> [[2]]
> [1] 4 5 6
You need to be a little careful with apply:
> mt2 <- matrix(c(1,4,2,5,3,6),2,3)
> apply(mt2, 1, function(x) x[!is.nan(x)] )
[,1] [,2]
[1,]14
[2,]25
[3,]36
Depending on the input you w
Thank you for your sharing
I got it.
On Tue, Sep 27, 2011 at 9:44 PM, David Winsemius wrote:
>
> On Sep 27, 2011, at 3:19 PM, Fabrice Tourre wrote:
>
>> Dear list,
>>
>> How can I detect a package is installed or not? If not, then install it.
>>
>> For example, in a script, I want to check the p
On Sep 27, 2011, at 4:02 PM, Ben qant wrote:
Hello,
What is the best way to turn a matrix into a list removing NaN's?
I'm new to
R...
Start:
mt = matrix(c(1,4,NaN,5,3,6),2,3)
mt
[,1] [,2] [,3]
[1,]1 NaN3
[2,]456
> apply(mt, 1, function(x) x[!is.nan(x)] )
[[1]]
On 11-09-27 4:03 PM, jose romero wrote:
Hello,
The following piece of code works fine in R.2.10 (ubuntu):
switch(distr,
normal= {if (is.infinite(param["desv"]))
n<- c(n,"La desv. estándar no puede ser Inf.")
if (param["desv"]<0)
Excellent! Thank you!
ben
On Tue, Sep 27, 2011 at 2:07 PM, R. Michael Weylandt <
michael.weyla...@gmail.com> wrote:
> alply is from the plyr package. You'll need to call that if its not already
> loaded.
>
> M
>
>
> On Tue, Sep 27, 2011 at 4:07 PM, R. Michael Weylandt <
> michael.weyla...@gmail.
On 11-09-27 3:19 PM, Fabrice Tourre wrote:
Dear list,
How can I detect a package is installed or not? If not, then install it.
Here's one way. This might be slow if you have all of CRAN installed,
but it's quick enough if you only have a few dozen packages:
installed <- rownames(installed.
alply is from the plyr package. You'll need to call that if its not already
loaded.
M
On Tue, Sep 27, 2011 at 4:07 PM, R. Michael Weylandt <
michael.weyla...@gmail.com> wrote:
> Try this:
>
> alply(mt, 1, function(x) as.numeric(na.omit(x)))
>
> The as.numeric() addition may be necessary to strip
Try this:
alply(mt, 1, function(x) as.numeric(na.omit(x)))
The as.numeric() addition may be necessary to strip the extra attributes
na.omit() wants to add.
Michael
On Tue, Sep 27, 2011 at 4:02 PM, Ben qant wrote:
> Hello,
>
> What is the best way to turn a matrix into a list removing NaN's? I
Hello,
The following piece of code works fine in R.2.10 (ubuntu):
switch(distr,
normal = {if (is.infinite(param["desv"]))
n <- c(n,"La desv. estándar no puede ser Inf.")
if (param["desv"]<0)
n <- c(n,"La desv. estándar no pue
Hello,
What is the best way to turn a matrix into a list removing NaN's? I'm new to
R...
Start:
> mt = matrix(c(1,4,NaN,5,3,6),2,3)
> mt
[,1] [,2] [,3]
[1,]1 NaN3
[2,]456
Desired result:
> lst
[[1]]
[1] 1 3
[[2]]
[1] 4 5 6
Thanks!
Ben
[[alternative HTML v
Hi, I have a seemingly simple proportional test. here is the question I am
trying to answer:
There is a test running each day in the lab, the test comes out as
either positive or negative. So at the end of each month, we can calculate a
positive rate in that month as the proportion of positive
On Sep 27, 2011, at 3:19 PM, Fabrice Tourre wrote:
Dear list,
How can I detect a package is installed or not? If not, then install
it.
For example, in a script, I want to check the package DESeq is
installed or not. If not, then I will using this script to install it.
source("http://www.b
I see what you mean.
Sorry and thanks for pointing that out to me Ben.
bbolker wrote:
>
> B77S auburn.edu> writes:
>
>>
>> I have never used that function, but I know that with read.csv() you can
>> do
>> the following to select only the columns you want:
>>
>> chosen_vars <- read.csv("Workb
I want to overlay a small inset map on top of another map, but I can't
figure out how to do it.
For example, here are two different maps:
# map 1 - Ohio
map("state", region= "ohio")
# map 2 - US with Ohio darkened
map("state")
map("state", region="ohio", fill=T, add=T)
I would like to add map
Dear list,
How can I detect a package is installed or not? If not, then install it.
For example, in a script, I want to check the package DESeq is
installed or not. If not, then I will using this script to install it.
source("http://www.bioconductor.org/biocLite.R";)
biocLite("DESeq")
The pseud
Meredith Jantzen uwo.ca> writes:
> Hello everyone, Apologies in advance, as this is partially a stats
> question and partially an R question. I have been using a GAM to
> model the activity level of bats going into and coming out from a
> forested edge. I had eight microphones set up in a lin
On Sep 27, 2011, at 1:47 PM, arindam fadikar wrote:
I have made a level plot in R of a variable using the lattice package.
This grid corresponds to South Asia. I am only interested in viewing
the values of this variable (aerosol optical depth) for certain
countries in South Asia. I have a dummy
library(sos)
???'M-spline'
This produces ZERO matches. If you want a nonnegative fit and
you don't necessarily need M-splines, there are many ways to do that,
some of which can be found with the sos package (which also includes a
vignette).
There are many different packages of
Hello David(s),
First of all, thank you for your help.
I was running some tests, and I wish to know if I have correctly understood
your explanation. Well, when I use rbind(), I get the variables binded by
row, and when I use cbind() I get the variables binded by column.
The dist() function, as t
Barry Rowlingson wrote on 09/27/2011 12:06:21 PM:
>
> On Tue, Sep 27, 2011 at 5:51 PM, Marcelo Araya
wrote:
> > Hi all
> >
> >
> >
> > I am analyzing bird song element sequences. I would like to know how
can I
> > get how many times a given subsequence is found in single string
sequence.
> >
>
halo david
when I use type= 'interval'
Call: survfit(formula = Surv(ingreso, fecha, estado, type = "interval") ~
categoria)
categoria=C
time n.risk n.event survival std.err lower 95% CI upper 95% CI
2004 95.00 13.14 0.862 0.0354 0.795 0.934
2007 3
Jean: Thanks!
Works great!
Lars
Op 27 sep. 2011 (w39), om 17:22 heeft Jean V Adams [via R] het volgende
geschreven:
df <- as.data.frame(unclass(xt))
dfu <- unique(df)
class_cnt <- apply(dfu, 1, sum)
subject_cnt <- tabulate(match(apply(df, 1, paste, collapse="-"),
apply(dfu, 1, pa
If you are talking about the scatterplot3d package, and we assume your
data is in data.frame called "dat":
library("scatterplot3d")
s3d <- scatterplot3d(dat$obs30, dat$Cases, dat$RANK1)
s3d$points3d(dat$obs30, dat$Cases, dat$RANK2, col=2)
Uwe Ligges
On 26.09.2011 22:08, XINLI LI wrote:
De
Dear list members,
This might be a silly question but I just can't figure it out. I am using
the "ellipse" package on covariance matrices. I would simply like to plot my
ellipses WITH its two axis ploted as well. These axis represents the 2 eigen
vectors of my matrix and it is important that I can
On Tue, Sep 27, 2011 at 5:51 PM, Marcelo Araya wrote:
> Hi all
>
>
>
> I am analyzing bird song element sequences. I would like to know how can I
> get how many times a given subsequence is found in single string sequence.
>
>
>
>
>
> For example:
>
>
>
> If I have this single sequence:
>
>
>
> AB
Hi Marcelo,
Try this:
x <- "ABCABAABABABCAB"
length(gregexpr(pattern="ABC", x)[[1]])
See ?gregexpr for more details (though I admit that it is not easy to
understand this help page)
HTH,
Ivan
Le 9/27/2011 18:51, Marcelo Araya a écrit :
Hi all
I am analyzing bird song element sequences. I
Hi all
I am analyzing bird song element sequences. I would like to know how can I
get how many times a given subsequence is found in single string sequence.
For example:
If I have this single sequence:
ABCABAABABABCAB
I am looking for the subsequence "ABC". Want I need to g
Send this again using dput() to give a plain text output and I'll look at
it.
Also, I think you should probably look into the difference between a row and
a column.
Michael
On Tue, Sep 27, 2011 at 11:48 AM, Samir Benzerfa wrote:
> Many thanks for your hint. I tried regular apply now. However,
On 27.09.2011 14:06, Bhaskaran wrote:
Hi all,
I want to install wgrib2
I guess you will have to explain what wgrib2 is and why it is related to R.
Uwe Ligges
on my windows 7 laptop. It appears that a
precompiled version exists and works for many. I managed to download a
precompiled ver
Thank you very much for a quick reply!
I had not realized the degrees of freedom changed. It was my lack of
understanding of the "aov" function.
I will continue defining the pH as factor for the ANOVA's.
Cheers,
Hronn
-
--
Hrönn Egilsdóttir
PhD Student
Marine Research Institute
Skúlaga
I suspect that the chisquare-test might not be appropriate, as you have
constraints (same number of observations for A in both contingency tables). I
further suspect that there is no test readily available for that, but I might
be wrong. Maybe randomization tests could help here, but it would re
Metronome123 wrote on 09/27/2011 07:24:50 AM:
>
> Startsituation:
>
> structure(c(1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1,
> 0, 1, 1), .Dim = 4:5, .Dimnames = structure(list(subject = c("s1",
> "s2", "s3", "s4"), class = c("c1", "c2", "c3", "c4", "c5")), .Names =
> c("subject",
> "c
Il 27/09/11 01:58, R. Michael Weylandt ha scritto:
Why exactly do you want to "stabilize" your results?
If it's in preparation for publication/classroom demo/etc., certainly
resetting the seed before each run (and hence getting the same sample()
output) will make your results exactly reproducibl
On Tue, Sep 27, 2011 at 2:59 PM, Patrick Breheny wrote:
> On 09/27/2011 07:53 AM, majesty wrote:
>
>> Dear subscribers,
>>
>> I am looking for a function which would allow me to model the dependent
>> variable as the number of successes in a series of Bernoulli trials. My
>> data
>> looks like thi
Dear Michael,
Thanks very much for your answers!
The purpose of my analysis is to test whether the contingency table x is
different from the contingency table y.
Or, to put it differently, whether there is a significant difference between
the joint distribution A&B and A&C.
Based on your
Hi everyone.
I have two questions. Ive found some other questions and answers similar to
these but they didnt solve my problem.
Im working with a panel of firm/years observations (see my reproducible
example). Im using the plm package.
My panel not only is unbalanced but also have some ga
Just for completeness: the manual calculation you'd want is most likely
sum((x-y)^2 / (x+y))
(that's one you can find on the Wikipedia link you provided). To get the same
from chisq.test, try something like
chisq.test(data.frame(x,y)[,c(3,6)])
(there are surely smarter ways, but at least it
HronnE wrote on 09/27/2011 06:27:38 AM:
>
> Hi all
>
> This is probably a simple problem but somehow I am having much trouble
with
> finding a solution, so I seek your help!
>
> I have a data-set with continuous response variables. The explanatory
> variably is 4xpH treatments (so 8.08, 7.94, 7
Hi,
My problem is that i will use rbpspline{SpatialExtremes} to fit a penalized
spline with radial basis functions to my data
but i have two predictor variables and i cannot select knots.
In R help there is an example such that
n <- 200
x <- runif(n)
fun <- function(x) sin(3 * pi * x)
y <- fun(
Your data frame does not seem to have come through with the formatting.
Could you send a plain text example (easily created using dput() ) of what
you have now and what you want?
Michael
On Tue, Sep 27, 2011 at 7:24 AM, wrote:
> Hi,
>
> I already know row.names(comm)[1:5]<- paste("com", 1:5,
>
On Tue, Sep 27, 2011 at 9:43 AM, R. Michael Weylandt <
michael.weyla...@gmail.com> wrote:
> Untested, I believe this should work, though you might need to modify for
> floating point funny business in testing the equalities:
>
> my_list <- list( earth=array(c(0,0,45,0,0,45,0,45),dim=c(2,2,2)),
> m
Hi
Can any one inform me an r package used to fit Cubic M-splines or r functions
used to have design and penalty matrices in fitting cubic M-splines please?
Thanks,
Tigist
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing
Sorry for a long question.
I am in an urgent using R to fit the cox proportional model. My data is a
data frame including 100 individuals which are software stress tests.
There are time-to-failure and six covariates meaning the system resource
(every 4 minutes).
Is it possible to use R to fit the
Startsituation:
structure(c(1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1,
0, 1, 1), .Dim = 4:5, .Dimnames = structure(list(subject = c("s1",
"s2", "s3", "s4"), class = c("c1", "c2", "c3", "c4", "c5")), .Names =
c("subject",
"class")), class = c("xtabs", "table"), call = xtabs(formula = ~s
Hi guys,
I am trying to replace all elements of earth that are equal to zero with their
corresponding elements in mars. I can do the replace with a bunch of for-loops,
but I don't think this is the R way of doing things.
my_list <- list( earth=array(c(0,0,45,0,0,45,0,45),dim=c(2,2,2)),
mars=ar
David Cross is correct. Your covariance matrix is singular because you have
more columns (15) than rows (2). David actually produced the covariance
matrix for cbind(s.1, s.2) which is not singular, but you are using
rbind(s.1, s.2). Try cor(rbind(s.1, s.2)) and you will see that the
correlations ar
On 09/27/2011 07:53 AM, majesty wrote:
Dear subscribers,
I am looking for a function which would allow me to model the dependent
variable as the number of successes in a series of Bernoulli trials. My data
looks like this
ID TRIALS SUCCESSESS INDEP1 INDEP2 INDEP3
1 0
That's cool!
it works :-)))
for me (as a stata user) these are quite basic things and I didn't find them
anywhere for what concerns R. I can't figure out why.
Really, thank you so much,
f.
On 27 September 2011 14:20, Petr PIKAL wrote:
> Hi Francesco
>
> > Dear Petr,
> >
> > thank you so much
On Tue, Sep 27, 2011 at 5:23 AM, Agustin Lobo
wrote:
> I have the following time series:
>
>> class(CCasadesz2)
> [1] "zoo"
>> setmanes <- cut(time(CCasadesz2),breaks="weeks")
>> CCasadeswz <- aggregate(CCasadesz2,sum,by=setmanes)
cut produces a "factor", not a "Date". The by= argument in
aggrega
Stepwise variable selection without heavy penalization is invalid.
Frank
mael wrote:
>
> Hi everyone,
>
> I'm wondering how to select the "best" model when using logistf? AIC does
> not work neither does anova. I tried fitting a glm model but got the
> separation warning message so I tried using
Dear subscribers,
I am looking for a function which would allow me to model the dependent
variable as the number of successes in a series of Bernoulli trials. My data
looks like this
ID TRIALS SUCCESSESS INDEP1 INDEP2 INDEP3
1 00.273 0.055 0.156
2
Hi everyone,
I'm wondering how to select the "best" model when using logistf? AIC does
not work neither does anova. I tried fitting a glm model but got the
separation warning message so I tried using the logistf package but as I
stepwise simplify the model I don't know if the simplification is mot
Hi all
This is probably a simple problem but somehow I am having much trouble with
finding a solution, so I seek your help!
I have a data-set with continuous response variables. The explanatory
variably is 4xpH treatments (so 8.08, 7.94, 7.81 and 7.71) so also
continuous and not technically fac
Hi all,
I want to install wgrib2 on my windows 7 laptop. It appears that a
precompiled version exists and works for many. I managed to download a
precompiled version and placed it in a directory and added this directory to
the PATH.
However, when execute R-command, I get the error suggesting t
Hi Francesco
> Dear Petr,
>
> thank you so much for your quick reply. I was sure that there were some
> smart ways to address my issue. I went through it and took some time to
> look at the help for lapply and mapply.
> However, some doubts still remain. Following your example, I did:
> lll <-v
On Tue, Sep 27, 2011 at 5:56 AM, Ashim Kapoor wrote:
> Dear R-helpers,
>
> It seems to me that a character zoo cannot be coerced to a numeric zoo.
> Below is a minimal example. Can someone tell me what I have done wrong?
>
>> z<-zoo(1:4,order.by=1:4)
>> coredata(z)<-as.character(coredata(z))
>> st
On Tue, Sep 27, 2011 at 5:23 AM, Agustin Lobo
wrote:
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
Provide the output of dput(CCasadesz2) or if that is very large try to
cut it down to make the
On 11-09-27 5:39 AM, arunkumar wrote:
Hi,
I want to capture the error information without throwing it out.
if i use try command it throws and also stores. and not able to get the
error if i use tryCatch command.
a="a"
b=10
c=try(a/b)
That's how. c has now captured the error informati
Thanks for your help - very useful!
Martyn.
--
View this message in context:
http://r.789695.n4.nabble.com/Changing-colour-in-barchart-tp3843209p3846866.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
Not sure what you want to test here with two matrices, but reading the manual
helps here as well:
y a vector; ignored if x is a matrix.
x and y are matrices in your example, so it comes as no surprise that you get
different results. On top of that, your manual calculation is not correct
Thanks!
In principle it is a mathematical problem. I have already found some
solutions with google.
I thought there is maybe an existing R function or package which handel this
stuff. But it seems not to be.
sos package gives me no suitable information for that.
With best regards
--
View this
Did you try regular apply? If you have univariate input, there's no reason
to use the multivariate mapply. Or more generally:
apply(P[-1,],1,function(p) Box.test(p)$p.value)
Michael
On Tue, Sep 27, 2011 at 4:45 AM, Samir Benzerfa wrote:
> Hi everyone,
>
>
>
> I've got a question concerning the
Yes, that sounds right.
Michael
PS -- If you are interested, the code zoo:::`coredata<-.zoo` contains the
line
x[] <- value
confirming my hunch about the old mode being inherited unless a coercion to
a more general one is needed.
On Tue, Sep 27, 2011 at 7:01 AM, Ashim Kapoor wrote:
> Dear Mi
I have the following time series:
> class(CCasadesz2)
[1] "zoo"
> setmanes <- cut(time(CCasadesz2),breaks="weeks")
> CCasadeswz <- aggregate(CCasadesz2,sum,by=setmanes)
> class(CCasadeswz)
[1] "zoo"
> summary(CCasadeswz)
Index CCasadeswz
2009-01-12 00:00:00: 1 Min. :
Hi,
I want to capture the error information without throwing it out.
if i use try command it throws and also stores. and not able to get the
error if i use tryCatch command.
a="a"
b=10
c=try(a/b)
Please help
--
View this message in context:
http://r.789695.n4.nabble.com/Capturing-the-err
Hi everyone,
I've got a question concerning the function Box.test for testing
autocorrelation in my data.
My data consist of (daily) returns of several stocks over time (first
row=time, all other rows=stock returns). I intend to perform a Box-Ljung
test for my returns (for each stock). Sinc
Dear listers:
As a part of a intermediate process, I need to use and modify a very big
matrix (some 3x3) inside the body of a function. If the matrix is
defined in the function, R shows a error message "Cannot allocate vector of
size 6.7 Gb". But if I define the matrix before the function
Dear Micheal,
Thank you. So to make a zoo which has factors in into a numeric,we have to
go from factor to character to numeric. The coredata goes fine from factor
to character. In the numeric conversion we need a new zoo object.
Best,
Ashim
On Tue, Sep 27, 2011 at 4:21 PM, R. Michael Weylandt <
It's just a guess from playing around with a few things. The author of the
package is on this list and he could both confirm that I'm right and say why
exactly it is implemented like this.
My hunch is that it ultimately comes from the fact that
coredata(z) != z
Consider this:
x = letters[1:5]
x
Dear all,
I have some trouble understanding the chisq.test function.
Take the following example:
set.seed(1)
A <- cut(runif(100),c(0.0, 0.35, 0.50, 0.65, 1.00), labels=FALSE)
B <- cut(runif(100),c(0.0, 0.25, 0.40, 0.75, 1.00), labels=FALSE)
C <- cut(runif(100),c(0.0, 0.25, 0.50, 0.80, 1.00), labe
Dear Michael,
I don't think this is mentioned in the zoo FAQ. May I ask where you read
this? Some references ?
Thank you for your help,
Ashim
On Tue, Sep 27, 2011 at 4:06 PM, R. Michael Weylandt <
michael.weyla...@gmail.com> wrote:
> Yes, once made into a character zoo, the core data is marked
Yes, once made into a character zoo, the core data is marked to be of mode
"character" and most attempts to modify involve implicit coercion to that
mode.
The following however works:
library(zoo)
z <- zoo(1:4, order.by=1:4)
str(z)
z.Str <- z
coredata(z.Str) <- as.character(coredata(z))
str(z.St
Dear Petr,
thank you so much for your quick reply. I was sure that there were some
smart ways to address my issue. I went through it and took some time to look
at the help for lapply and mapply.
However, some doubts still remain. Following your example, I did:
lll <-vector(mode = "list", length =
Hi All,
How do I add "com" to the row names of a data frame, without
deleting the plot numbers?
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-gu
Hi all,
I'm using sm library. In the two-dimensional plot of the analysis with one
covariate, I'm able to modify several graphic parameters, either specifying
them directly in the sm.regression() function, either through sm.options().The
only graphical parameter i cannot modify is the width of
Dear R-helpers,
It seems to me that a character zoo cannot be coerced to a numeric zoo.
Below is a minimal example. Can someone tell me what I have done wrong?
> z<-zoo(1:4,order.by=1:4)
> coredata(z)<-as.character(coredata(z))
> str(z)
zoo series from 1 to 4
Data: chr [1:4] "1" "2" "3" "4"
1 - 100 of 114 matches
Mail list logo