On Tue, 14 May 2013, meng wrote:
Many thanks.
Another question:
model- glm(count ~ drug*result, family = poisson)
anova(model,test=Chisq)
Df Deviance Resid. Df Resid. Dev Pr(Chi)
NULL 3 47.522
drug 1 0.032 2
Hi,
Does anyone know how to simulate a long time series (say 1000 daily series)
or generally a series, with inverse empirical distribution and generalized
pareto distribution (meaning to say the time series has a marginal
distribution of empirical and GPD distribution.)?
Does anybody know if
Many thanks.
Another question:
model- glm(count ~ drug*result, family = poisson)
anova(model,test=Chisq)
Df Deviance Resid. Df Resid. Dev Pr(Chi)
NULL3 47.522
drug 10.032 2 47.491 0.85858
result 1
Hello to everybody,
Â
I seem to be in struggle with the websockets in R. I wanted to download the
streaming data from the BitCoin exchange MtGox directly to R, but R cannot
establish the connection.
The websocket specs are defined as:
* Host: websocket.mtgox.com or socketio.mtgox.com
I have in a dataframe X : 3 Variables X$a , X$b, X$c
I would like to replace in X the values of X$a by the values of X$c but
only when X$b==TRUE
I have tried to put in place a loop but as I have a lot of rows it is very
very long to run.
Thanks for your help
--
View this message in
Hello,
Try the following.
X$a[X$b] - X$c[X$b]
Hope this helps,
Rui Barradas
Em 14-05-2013 09:06, fgrelier escreveu:
I have in a dataframe X : 3 Variables X$a , X$b, X$c
I would like to replace in X the values of X$a by the values of X$c but
only when X$b==TRUE
I have tried to put in
Hello,
One approach is using ifelse:
X - data.frame(a=c(1,1,1,1,1,1),
b=c(TRUE,TRUE,FALSE,FALSE,FALSE,TRUE), c=c(2,2,2,2,2,2))
X
a b c
1 1 TRUE 2
2 1 TRUE 2
3 1 FALSE 2
4 1 FALSE 2
5 1 FALSE 2
6 1 TRUE 2
X - within(X, a - ifelse(b==TRUE, c, a))
X
a b c
1 2 TRUE 2
2 2
Dear experts,
I wanted to signal a peculiar, unexpected behaviour of 'apply'. It is not a
bug, it is per spec, but it is so counterintuitive that I thought it could
be interesting.
I have an array, let's say test, dim=c(7,5).
test - array(1:35, dim=c(7, 5))
test
[,1] [,2] [,3] [,4] [,5]
Dear David,
First, I would like to say thank you for your very soon reply. Second, I
want to clarify the question because it seems to not carrying exactly what
I want to ask. Let take an example on R data.frame:
V1 - 1
df2 - df[V1== 1,] # df is a data.frame, this command is correct, right?
The
On 13-05-14 4:52 AM, Luca Nanetti wrote:
Dear experts,
I wanted to signal a peculiar, unexpected behaviour of 'apply'. It is not a
bug, it is per spec, but it is so counterintuitive that I thought it could
be interesting.
I have an array, let's say test, dim=c(7,5).
test - array(1:35,
On Tue, 14 May 2013, Luca Nanetti luca.nane...@gmail.com writes:
Dear experts,
I wanted to signal a peculiar, unexpected behaviour of 'apply'. It is not a
bug, it is per spec, but it is so counterintuitive that I thought it could
be interesting.
I have an array, let's say test, dim=c(7,5).
Hello,
The problem is that apply returns the results vector by vector and in R
vectors are column vectors. This is not exclusive of apply with sample
as the function to be called, but of apply in general. Try, for instance
apply(test, 1, identity) # transposes the array
The rows are
On 14-May-2013 09:46:32 Duncan Murdoch wrote:
On 13-05-14 4:52 AM, Luca Nanetti wrote:
Dear experts,
I wanted to signal a peculiar, unexpected behaviour of 'apply'.
It is not a bug, it is per spec, but it is so counterintuitive
that I thought it could be interesting.
I have an array, let's
On Tue, May 14, 2013 at 4:52 AM, Luca Nanetti luca.nane...@gmail.com wrote:
Dear experts,
I wanted to signal a peculiar, unexpected behaviour of 'apply'. It is not a
bug, it is per spec, but it is so counterintuitive that I thought it could
be interesting.
I have an array, let's say test,
Dear R users,
I may have found a bug in the function 'data.table'. I have a similar
question as the one in this post:
http://stackoverflow.com/questions/3367190/aggregate-and-weighted-mean-in-r
I have a dataset with assets, quantity traded, date and time. I would like
to calculate the value
t(apply(test,1,sample)) will also do.
As the OP noted, the results are simply transposed. So if an operation is
to be applied to rows, yielding modified rows, simply transpose the results.
Cheers,
Tsjerk
On Tue, May 14, 2013 at 12:07 PM, Ted Harding ted.hard...@wlandres.netwrote:
On
Hi,
I'm trying to do quite a simple task, but I'm stuck.
I've set xaxs = 'i' as I want the origin to be (0,0), but unfortunately I
have points that are sat on the axis. R draws the axis over the points,
which hides the points somewhat and looks unsightly.
Is there any way of getting a point to
Probably but since we don't know what you are doing, it is very hard to give
any advice.
Please read this for a start
https://github.com/hadley/devtools/wiki/Reproducibility and give us a clear
statement of the problem
Thanks
John Kane
Kingston ON Canada
-Original Message-
Hello to everybody,
I'm repeating my post as the previous one was posted in HTML - sorry guys!
I seem to be in struggle with the websockets in R. I wanted to download the
streaming data from the BitCoin exchange MtGox directly to R, but R cannot
establish the connection.
The websocket specs
Hi,
Try:
set.seed(24)
dat1- as.data.frame(matrix(sample(1:60,15*5,replace=TRUE),ncol=15))
colnames(dat1)- paste0(a,c(3,1,5,7,2,8,11,14:15,10,9,6,12:13,4))
subDat1-dat1[colnames(dat1)[as.numeric(gsub([A-Za-z],,colnames(dat1)))=10]]
subDat1
# a3 a1 a5 a7 a2 a8 a10 a9 a6 a4
#1 18 56 37 55 6 42
Dear colleagues,
This is to inform you that I will be giving a webinar on the apcluster
package on Thursday, June 13, 2013, 7:00pm CEST (10:00am PDT).
The outline of the one-hour webinar is as follows:
- Introduction to affinity propagation (AP) clustering
- The apcluster package, its
Hi all,
I am facing the imbalanced classification problems. That means I have a
dataset, in which the ratio of majority data to minority data is 100:1 (or
more).
In addition, the independent variables are many and this is a binary
classification questions.
The model I built give poor predictive
Try this
set.seed(42)
dat - matrix(c(runif(48), 0, 0), 25, 2, byrow=TRUE)
# Complete plot symbol on axes, but axis on top
plot(dat, xaxs=i, yaxs=i, pch=16, col=red, xpd=TRUE)
# Complete plot symbol on axes with symbol on top
plot(dat, xaxs=i, yaxs=i, type=n)
points(dat, xaxs=i, yaxs=i, pch=16,
Let's try again after restraining Outlook's desire to use html.
set.seed(42)
dat - matrix(c(runif(48), 0, 0), 25, 2, byrow=TRUE)
# Complete plot symbol on axes, but axis on top
plot(dat, xaxs=i, yaxs=i, pch=16, col=red, xpd=TRUE)
# Complete plot symbol on axes with symbol on top
plot(dat,
Manta mantino84 at libero.it writes:
Dear R users,
I may have found a bug in the function 'data.table'. I have a similar
question as the one in this post:
http://stackoverflow.com/questions/3367190/
aggregate-and-weighted-mean-in-r
[snip]
While I run the command
Can someone help what I need to do to make 'devtools' work?
A quick asking around indicates that Rtools 3.0 should work fine for 2.15.3
maintenance. Thus, the issue is probably a purely formal bug in devtools's
version comparison logic, and you need to pester its maintainer. Unless it
has
Thanks a lot Guys
That works
I appreciate your helps
Best regards
Frederic
FREDERIC GRELIER DIRECTEUR DATA
T +33 (0) 1 83 94 04 08 - P +33 (0) 6 70 50 01 05 - F +33 (0) 1 53 19 41
84
WWW.WEBORAMA.COM http://www.weborama.com/ - 15, RUE CLAVEL - 75019
PARIS
-Message d'origine-
De :
I have some longitudinal data I'm fitting with an asymptotic growth function
constrained to the origin. Visual inspection of the dataset suggests this is
reasonable!
library(nlme)
results - groupedData(y~Days | ID, data=results)
m1 - nlsList(SSasympOrig, na.omit(results))
m1
Call:
Model:
hello, I wrote a foreach loop containing where clauses. R indicates an
error in the compilation of the where clause.
Could you please tell me why not right?
foreach (series. combine = c)%:% when (mydata [3] = u [1]) % Dopar% (mydata
[5] / sum (mydata [5]))
L 'error reported by R is:
Error:
#this should also work
within(X,a- ifelse(b,c,a))
# a b c
#1 2 TRUE 2
#2 2 TRUE 2
#3 1 FALSE 2
#4 1 FALSE 2
#5 1 FALSE 2
#6 2 TRUE 2
A.K.
- Original Message -
From: Pascal Oettli kri...@ymail.com
To: fgrelier fgrel...@weborama.com
Cc: r-help@r-project.org
Sent: Tuesday, May
On May 14, 2013, at 17:06 , martinizza wrote:
hello, I wrote a foreach loop containing where clauses. R indicates an
error in the compilation of the where clause.
Could you please tell me why not right?
foreach (series. combine = c)%:% when (mydata [3] = u [1]) % Dopar% (mydata
[5] / sum
On 14/05/2013 11:06 AM, martinizza wrote:
hello, I wrote a foreach loop containing where clauses. R indicates an
error in the compilation of the where clause.
Could you please tell me why not right?
foreach (series. combine = c)%:% when (mydata [3] = u [1]) % Dopar% (mydata
[5] / sum (mydata
Hi -
My sample size is about 190, consequently the plot output (below) is
quite squashed up and the id numbers down the L axis overlay each other
and are not legible
plot(confint(lmList(x ~ slope | id, data), pooled = TRUE), order = 1)
Is it possible to either reduce the size of the id
Hi -
I would like the plot ordered by intercept.
Ordering is doable if the intervals function is substituted with the
confint function and order=1 included. Is ordering doable with intervals
function, please?
Thanks!
M
results-lmList(x~slope|id,data)
plot(intervals(results))
Dear all,
I need to plot more than one surface in 3D using R.
I tried with persp function, it produce only one surface.
Could you please help me how can I do it? The X and Y axis are the same
but I have Z1 and Z2. I want to have both results in one graph.
Thanks
Amir
--
R Help -
Why is that in the results below, changing the order of the factor
(trialType2: levels - DD, SD, DS, SS) changes the estimates in the fixed
effects tests?
tmp.dat4$trialType2 - sort(tmp.dat4$trialType, decreasing = TRUE)
mod2c - lme(proportion.down ~ trialType2, data = tmp.dat4,
Please don't post in html. The list strips it out and we, now, have no idea of
what you are doing.
Have a look at https://github.com/hadley/devtools/wiki/Reproducibility for
suggestions on how to ask a qustion here.
Sample code and sample data (see ?dupt) are usually desirable.
John Kane
On 14/05/2013 1:10 PM, Amir wrote:
Dear all,
I need to plot more than one surface in 3D using R.
I tried with persp function, it produce only one surface.
Could you please help me how can I do it? The X and Y axis are the same
but I have Z1 and Z2. I want to have both results in one
On 14/05/2013 11:54 AM, Michelle Morters wrote:
Hi -
My sample size is about 190, consequently the plot output (below) is
quite squashed up and the id numbers down the L axis overlay each other
and are not legible
plot(confint(lmList(x ~ slope | id, data), pooled = TRUE), order = 1)
Is it
Or better yet see ?dput, sorry.
John Kane
Kingston ON Canada
-Original Message-
From: jrkrid...@inbox.com
Sent: Tue, 14 May 2013 09:20:59 -0800
To: mm...@hermes.cam.ac.uk, r-help@r-project.org
Subject: Re: [R] query re plot(confint(lmList...
Please don't post in html. The list
On Tue, May 14, 2013 at 10:05 AM, Michelle Morters
mm...@hermes.cam.ac.ukwrote:
Hi -
I would like the plot ordered by intercept.
One way will be to tweak the ?intervals.lmList object
require(nlme)
fm1 - intervals(lmList(distance ~ age | Subject, Orthodont))
fm2 - fm1[order(fm1[,2,1]),,]
My question has been answered elsewhere, but here is the answer:
?restrict
On Mon, May 13, 2013 at 8:49 PM, Dimitri Liakhovitski
dimitri.liakhovit...@gmail.com wrote:
Hello!
I was wondering if it is at all possible (in vars or maybe outside of
it?) to include non-consequite lags into the
I am investigating various R packages that facilitate estimation of linear
Gaussian multivariate state space models. I stumbled across the MARSS
package (http://cran.r-project.org/web/packages/MARSS/index.html), which I
believe is very well done, but am finding one missing feature that I cannot
This is Circle 8.1.47 of 'The R Inferno'.
http://www.burns-stat.com/documents/books/the-r-inferno/
Pat
On 14/05/2013 09:52, Luca Nanetti wrote:
Dear experts,
I wanted to signal a peculiar, unexpected behaviour of 'apply'. It is not a
bug, it is per spec, but it is so counterintuitive that I
I have a text file of data as below and doing a ggplot line plot of all the ids
as separate mini line plots which works with the following code.
Problem how do I order the dates for each id plot on the x axis so that the
dates are going from oldest to most recent
Thanks in advance
Dave
Thank you for supplying the code. It would be easier to help you if we also
had some data to work with. ?dput
https://github.com/hadley/devtools/wiki/Reproducibility
I think reorder() is likely to do the trick but I don't have enough time to
mock up some data and check at the moment.
Have a
Hi R-people,
I performed controlled experiments to evaluated the seeds germination of
two palms under four levels of water treatments. I conducted a generalized
linear model (GLM) with a Poisson distribution to verify whether there were
significant differences in the number of seed germination
boxplot( Daten$weight~interaction(Daten$Dosis,Daten$sex, drop=TRUE))
means-tapply( Daten$weight, Daten$Dosis, mean)
points(means, pch=5, col=red, lwd=5)
...only the boxplots for male got that point on them,
its really weird because I don't think that I
Your value column will be input as character because of the signs and you
need to convert the dates in %m/%d/%y format to real R dates.
--
David
Sent from my iPhone
On May 14, 2013, at 3:59 PM, David Lyon david_ly...@yahoo.com wrote:
I have a text file of data as below and doing a ggplot
Hi,
Does anyone know how to simulate a long time series (say 1000 daily series)
or generally a series, with inverse empirical distribution and generalized
pareto distribution (meaning to say the time series has a marginal
distribution of empirical and GPD distribution.) using the R package?
Does
I think you need to read ?setClass and ?setMethod. There is an example of
defining a [ method for a class that inherits from 'data.frame'. I suspect
you need to capture the various possibilities for the arguments being present
or missing.
--
David
Sent from my iPhone
On May 14, 2013, at
Edward Patzelt patze003 at umn.edu writes:
R Help -
Why is that in the results below, changing the order of the factor
(trialType2: levels - DD, SD, DS, SS) changes the estimates in the fixed
effects tests?
I think you're not doing what you expected. By sorting the factor,
you are
On May 14, 2013, at 8:02 PM, David Winsemius wrote:
I think you need to read ?setClass and ?setMethod. There is an
example of defining a [ method for a class that inherits from
'data.frame'. I suspect you need to capture the various
possibilities for the arguments being present or
Hi,
I'm trying to analyze repeated measurements of body temperature data
collected from 7 randomly chosen subjects (e.g. turtles). I am using R,
along with the nparLD package to test for an effect of diel period (fixed
factor: day or night) and season (sub-plot fixed factor: spring, summer,
fall)
Hi,
It is because of the unequal lengths of x and y.
I was able to plot without the errors. But, not sure if this is what you
wanted.
mydata - read.table(TestData.csv, header=TRUE, sep=\t)
reg1-lm(MW01~Year,data=mydata)
Arguably you are looking in the wrong place (there's a special mixed-models
mailing list for R), but I can answer the question.
No.
At least, there's nothing in lme4, and I haven't done anything (since I
want a more general solution than Stata and MLWiN implement) and I'd be
surprised if someone
On May 14, 2013, at 21:04 , Bel Braz wrote:
Hi R-people,
I performed controlled experiments to evaluated the seeds germination of
two palms under four levels of water treatments. I conducted a generalized
linear model (GLM) with a Poisson distribution to verify whether there were
Hi,
You may also replace the NAs using ?na.approx() from library(zoo).
library(zoo)
mydata2- mydata
mydata2$MW01-na.approx(mydata2$MW01)
plot(MW01~Year,data=mydata2,col=ifelse(D_MW01,black,red),ylab=END
(mg/L),pch=ifelse(D_MW01,19,24),cex=1)
with(mydata2,lines(Year,MW01,lty=c(1),col=black))
58 matches
Mail list logo