You hope it makes sense, but it doesn't to me. Can you describe it without the
multiple instances? Your last equation in particular seems confusing (e.g.
undefined variable N, integrating by a variable N_1 to a limit of N_1, what is
a_2 and why is it being used to determine gamma_1).
For clarit
Hi,
On Mar 22, 2013, at 11:09 PM, Justin Long wrote:
> Greetings,
>
> I confess to being new to R, which I am exploring for some simulation
> modeling purposes. I am a long time programmer in PHP.
>
> I am having some trouble getting over the "steep learning curve" with
> some very basic things
Greetings,
I confess to being new to R, which I am exploring for some simulation
modeling purposes. I am a long time programmer in PHP.
I am having some trouble getting over the "steep learning curve" with
some very basic things which are probably just little "a-ha" things in
R. I have hunted and
Hello,
Does anyone know how to change background and text colors in script windows in
R? (I have changed the console's background and text colors by using Edit>GUI
preferences, but that doesn't seem to work for script windows.) I am using R
2.15.1 (32-bit) for Windows, and am using Windows 7.
Hi all,
I am using GAM to model time trends in a logistic regression. Yet I would
like to extract the the fitted spline from it to add it to another model,
that cannot be fitted in GAM or GAMM.
Thus I have 2 questions:
1) How can I fit a smoother over time so that I force one knot to be at a
par
Hello all,
I use arima to fit the model with
fit <- arima(y, order = c(1,0,1), xreg = list.indep, include.mean = TRUE)
and would like to use predict() to forecast:
chn.forecast <- rep(0,times=num.record)
chn.forecast[1] <- y[1]
for (j in 2:num.record){
indep
On the subject of boxplots, I have multiple data sets of unequal sample
sizes and was wondering what would be the most efficient way to read in
the data and plot side-by-side boxplots, with options for controlling
the orientation of the plots (i.e. vertical or horizontal) and the
spacing? Your
HI,
Try this:
set.seed(15)
lst<-
list(matrix(sample(1:15,20,replace=TRUE),ncol=5),matrix(sample(4:20,20,replace=TRUE),ncol=5),matrix(sample(8:25,20,replace=TRUE),ncol=5))
library(abind)
arr1<-abind(lst,along=3)
apply(arr1,c(1,2),median)
# [,1] [,2] [,3] [,4] [,5]
#[1,] 17 13 19 12 7
Hello,
You're forgeting to tell gfeom_rect that the x and y aesthetics are
already set elsewhere. You must include NULL, NULL as the first two
arguments:
p + geom_rect(data = rectlib,
aes(NULL, NULL, xmin = xmin, xmax = xmax, ymin = -Inf, ymax = Inf),
fill='red', alpha=0.2)
ggplot(fcs,aes(x=year,y=federal.ps))+geom_line()+geom_rect(data=rectlib,aes(x=xmin,y=Inf,xmin=xmin,xmax=xmax),ymin=-Inf,ymax=Inf,fill="red",alpha=0.2)
For some reason x and y must be defined as data sources for all layers.
---
Questions about spatstat should be directed to the R-Sig-Geo list, or
better still, to the package maintainers.
To add a bit to what Blaser Nello has already told you:
(1) Your syntax in respect of the use of the min() function is indeed
incomprehensibly bizarre.
(2) Blaser Nello has indicated
Questions about spatstat should be directed to the R-Sig-Geo list, or
better still, to the package maintainers.
To add a bit to what Blaser Nello has already told you:
(1) Your syntax in respect of the use of the min() function is indeed
incomprehensibly bizarre.
(2) Blaser Nello has indicated
Hey all,
I have a list of matrices. I'd like to calculate the median across all those
matrices for each element. What I'd like to end up with is a matrix containing
the median of all [1,1] [1,2] etc. elements across all matrices.
Is there a concise way of doing that?
Thanks!
_
Thanks, that shows that I am not making one of my "really stupid" mistakes.
What is really annoying is that I can find examples on the web that work just
fine and I cannot se how my example is that different. I even tried changing
from using as.Date() to POSIXct() and to POSIXlt in case the d
Hi Janh,
When you say that you have "multiple data sets of unequal sample sizes" are you
speaking of the same kind of data" For example are you speaking of data from a
set of experiments where the variables measured are all the same and where when
you graph them you expect the same x and y sca
I get "year not found" and we've exceeded my ability to debug ggplot
code. I hope someone else chimes in: I'd like to know what the answer
is too.
Sarah
On Fri, Mar 22, 2013 at 5:01 PM, John Kane wrote:
> Ah , thanks Sarah
> So that's why the error message changed! I was getting different one
Ah , thanks Sarah
So that's why the error message changed! I was getting different one earlier.
I had defined rect earlier and apparently, when stripping down the code I
negelected to include it in the example. Renamed rect as rectlib
Now what I get is "Error in eval(expr, envir, enclos) : ob
Hi John,
This bit of your code:
geom_rect(data=rect
Your reproducible example doesn't create rect, and rect() already
exists, so geom_rect() is trying to treat a function as data.
Sarah
On Fri, Mar 22, 2013 at 4:42 PM, John Kane wrote:
> What am I missing? When I run the code below I get th
What am I missing? When I run the code below I get the error message
"Error: ggplot2 doesn't know how to deal with data of class function"
Googling suggests a message of "Error: ggplot2 doesn't know how to deal with
data of class XXX" is not uncommon but I don't see why I am getting a
"function
Hi,
Try this:
con<-file("Rout2122.text")
Lines1<- readLines(con)
close(con)
indx<-rep(c(TRUE,FALSE),each=2) #changed here
Lines2<-Lines1[!grepl("[A-Za-z]",Lines1)]
res<-read.table(text=paste(gsub("^\\s+","",Lines2[indx]),gsub("^\\s+","",Lines2[!indx])),sep="",header=FALSE)#some
changes
nm1<-un
It sounds like, although your "noon" and "midnight" data are separate rows,
they are not fully independent. If I understand correctly, the operation
you want to perform would be simple if you had (at least temporarily) a
single row with columns ddawn.midnight, ddusk.midnight, ddawn.noon,
ddusk.noon
Hi,
I also need to read this format of file in R, it is a Wordpad file.
On Thu, Mar 21, 2013 at 5:07 PM, arun wrote:
>
>
> Hi,
> con<-file("Rout1112.text")
> Lines1<- readLines(con)
> close(con)
> indx<-rep(rep(c(TRUE,FALSE),each=2),2)
> Lines2<-Lines1[!grepl("[A-Za-z]",Lines1)]
>
>
> res<
Hello,
I'm very new to using R, but I was told it could do what I want. I'm not sure
how best to enter the information but here goes...
I'm trying to transfer the following integral into R to solve for ln(gamma_1),
on the left, for multiple instances of gamma_i and variable N_i.
gamma_i is, fo
Solved my own problem. If interested:
http://stackoverflow.com/questions/15563589/odd-error-error-in-predictmatobjectsmoothk-data-by-variable-must
On 03/21/2013 02:14 PM, Andrew Crane-Droesch wrote:
Dear List,
I'm getting an error in mgcv, and I can't figure out where it comes
from. The se
On 2013-03-22 11:43, Christofer Bogaso wrote:
Hello again,
Let say I have following user defined function:
fn <- function(x, y) {
Vec1 <- letters[1:6]
Vec2 <- 1:5
return(list(ifelse(x > 0, Vec1, NA), ifelse(y > 0, Vec2, NA)))
}
Now I have
Hello,
Try the following.
idx <- which(subz$fix == "noon")
if(idx[length(idx)] == nrow(subz)) idx <- idx[-length(idx)]
subz$day[idx + 1] <- subz$day[idx]
Hope this helps,
Rui Barradas
Em 22-03-2013 18:18, zuzana zajkova escreveu:
Hi,
I would appreciate if somebody could help me with this
Hello,
You get only one value because ifelse is vectorized, and the condition
has length(x > 0) == 1. (You get as many values as there are in the
condition.) Try instead
fn2 <- function(x, y) {
Vec1 <- letters[1:6]
Vec2 <- 1:5
list(if(x > 0) Vec1 else NA, if(y > 0) Ve
I plot a dendrogram using the following code:
hc <- hclust(dist(USArrests[1:10,]), "ave")
unlist(as.dendrogram(hc))
[1] 7 1 8 4 6 10 9 2 3 5
how can I easily flip some leaves so that the unlist results are:
[1] 7 1 8 4 6 10 9 5 3 2
Thanks a lot!
[[alternative HTML ve
Hello again,
Let say I have following user defined function:
fn <- function(x, y) {
Vec1 <- letters[1:6]
Vec2 <- 1:5
return(list(ifelse(x > 0, Vec1, NA), ifelse(y > 0, Vec2, NA)))
}
Now I have following calculation:
> fn(-3, -3)
[[1]]
[1]
Hi,
I would appreciate if somebody could help me with this small issue...
I have a dataframe like this (originaly has more than 100 000 rows):
> subz
jultimedtime fixddawnddusk day
101608 15006 2011-02-01 19:14:49 19.24694 noon 7.916667 19.88333 1
1
On Fri, 22 Mar 2013 09:31:53 -0700 Bert Gunter
wrote:
> Well...
>
> On Fri, Mar 22, 2013 at 8:20 AM, Ranjan Maitra <
> maitra.mbox.igno...@inbox.com> wrote:
>
> > I don't believe that you necessarily need to use simulation for this.
> > But you do need numerical integration. Here is a skeletal
Well...
On Fri, Mar 22, 2013 at 8:20 AM, Ranjan Maitra <
maitra.mbox.igno...@inbox.com> wrote:
> I don't believe that you necessarily need to use simulation for this.
> But you do need numerical integration. Here is a skeletal approach.
>
> Calculate the density (distribution) of the order statis
Look carefully at the help file. Your x1 and x2 need to define a rectangular
grid so that there is a value of y for each combination of different x1 and
x2 values. When this is not the case, you don't get an error, just a blank
plot. It is not clear from the little piece of data that you included i
Hello José,
This is a much convenient way of looking at the components!
Thanks very much!
Cheers,
Rebecca
-Original Message-
From: Jose Iparraguirre [mailto:jose.iparragui...@ageuk.org.uk]
Sent: Friday, March 22, 2013 11:25 AM
To: Yuan, Rebecca; R help
Subject: RE: error while extract
Thank you!
Hanna
2013/3/22 Ranjan Maitra
> I don't believe that you necessarily need to use simulation for this.
> But you do need numerical integration. Here is a skeletal approach.
>
> Calculate the density (distribution) of the order statistics of a
> multivariate sample. Then since the u
Yes, it should be $p.value
Have a look at the components here:
> names(ht)
José
José Iparraguirre
Chief Economist
Age UK
T 020 303 31482
E jose.iparragui...@ageuk.org.uk
Twitter @jose.iparraguirre@ageuk
Tavis House, 1- 6 Tavistock Square
London, WC1H 9NB
www.ageuk.org.uk | ageukblog.org.uk
I don't believe that you necessarily need to use simulation for this.
But you do need numerical integration. Here is a skeletal approach.
Calculate the density (distribution) of the order statistics of a
multivariate sample. Then since the underlying distribution is
multivariate normal, use a mult
Dear Blaser and Pat,
I missed the original posting because "deltaMethod" appears near the end of
the message subject and was truncated by my email reader.
The problem is caused by lexical scoping. That is, deltaMethod(), which is
in the car namespace, will see objects in the global environment, b
Yes. What I meant is "the distribution of order statistics from a
non-iid sample of a (normal) distribution with specified sample
covariance matrix".
Thanks for the idea of simulation. I guess there is no other way
around.
Hanna
2013/3/22 Bert Gunter
> As you suggest, Ted, it appears fro
Hello All,
On the subject of boxplots, I have multiple data sets of unequal sample
sizes and was wondering what would be the most efficient way to read in the
data and plot side-by-side boxplots, with options for controlling the
orientation of the plots (i.e. vertical or horizontal) and the spacin
Hello Sarah,
Thanks! I will look into help next time before sending out the question.
Thanks,
Rebecca
-Original Message-
From: Sarah Goslee [mailto:sarah.gos...@gmail.com]
Sent: Friday, March 22, 2013 10:22 AM
To: Yuan, Rebecca
Cc: R help
Subject: Re: [R] error while extracting the p-
On Fri, Mar 22, 2013 at 2:03 PM, Yuan, Rebecca
wrote:
> Hello all,
>
> I tried to extract the p-value from adf.test in tseries; however, I got the
> error message such as
>
>> ht=adf.test(list.var$aa)
>> ht$p-value
> Error in ht$p - value : non-numeric argument to binary operator
>> ht
>
>
Hi,
When I look at ?adf.test I see:
A list with class
"htest"
containing the following components:
statistic the value of the test statistic.
parameter the lag order.
p.valuethe p-value of the test.
method a character string indicating what type of test was performed.
data.name a charac
As you suggest, Ted, it appears from the question that the OP really means
"order statistics of a sample of 10 from the distribution." So what she
appears to want is the distribution of order statistics from a non-iid
sample of a (normal) distribution with specified sample covariance matrix.
The
Hello all,
I tried to extract the p-value from adf.test in tseries; however, I got the
error message such as
> ht=adf.test(list.var$aa)
> ht$p-value
Error in ht$p - value : non-numeric argument to binary operator
> ht
Augmented Dickey-Fuller Test
data: list.var$aa
Dickey-Fuller = -2.3
Thanks all. you guys are really helpful.
On Fri, Mar 22, 2013 at 2:48 PM, peter dalgaard wrote:
> What Bill says, plus the fact that the default handling of logicals in
> modelling is to convert them to factors and then use treatment contrasts,
> which will effectively give you the right indica
Hi Elisa,
I hope this is what you wanted.
dat1<-read.csv("peaks.csv",sep=",")
#Subset
dat2<-dat1[1:5,]
res1<-do.call(cbind,lapply(seq_len(nrow(dat2)),function(i)
do.call(rbind,lapply(split(rbind(dat2[i,],dat2[-i,]),1:nrow(rbind(dat2[i,],dat2[-i,]))),
function(x) {x1<-rbind(dat2[i,],x);
abs((x
This is off-topic in this forum. Please go to R-devel for questions about
R-beta.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
On 22-Mar-2013 13:02:25 li li wrote:
> Thank you all for the reply.
>
> One example of my question is as follows.
>
> Suppose X1, ..., X10 has multivariate normal distribution
> and X(1), ..., X(10) are the corresponding order statistics.
>
> My question is that whether there is a R function tha
On Mar 22, 2013, at 13:21 , Erin Hodgess wrote:
> In R-beta (Masked Marvel), when I do the example from the read.pnm help
> file, this is what happens:
>
> x <- read.pnm(system.file("pictures/logo.pgm",package="pixmpap")[1])
"pixmpap"? Any chance of a typo?
-pd
> Warning message:
> In rep(c
Instead of NaN's, I get the error message: Error in eval(expr, envir, enclos) :
object 'z' not found. The reason you get the NaN's is, because you defined z in
your global environment. The deltaMethod doesn't find the z defined in your
function. I don't know why or how to fix this. Somebody with
Thank you all for the reply.
One example of my question is as follows.
Suppose X1, ..., X10 has multivariate normal distribution
and X(1), ..., X(10) are the corresponding order statistics.
My question is that whether there is a R function that would
help compute the c which satisfies
P(X(4)
>
Ah Yes, good point. However, it still does not correct the situation. I still
get NaN's.
--
View this message in context:
http://r.789695.n4.nabble.com/Trouble-embedding-functions-e-g-deltaMethod-in-other-functions-tp4662178p4662187.html
Sent from the R help mailing list archive at Nabble.com.
In R-beta (Masked Marvel), when I do the example from the read.pnm help
file, this is what happens:
x <- read.pnm(system.file("pictures/logo.pgm",package="pixmpap")[1])
Warning message:
In rep(cellres, length=2): x is NULL so the result will be NULL
In R-2.15.3, it's all right.
Thanks,
Erin
On
Le 22/03/13 12:34, Sahana Srinivasan a écrit :
while (a<=10)
{
while (b<=10)
{
n<-as.numeric(df[a,b)];
...;
}
}
The problem is that when I print out 'n' I get the following errors :
"NULL" (if printed without as.numeric), and "numeric(0)" if printed with
the as.numeric.
Perhaps with
n<-as.nume
Here is what you sent:
deltaSE <- function(mod, x){
mod.SE <- list()
for(i in 1:length(xVal)){
z <- xVal[i]
mod.SE[[i]] <- deltaMethod(mod, "(m0^(1/lambda) - (z *
m0/t0)^(1/lambda))^lambda")$SE
}
mod.SE
}
deltaSE(nlls, xVal)
but with
On 22-03-2013, at 12:34, Sahana Srinivasan
wrote:
> Hi everyone,
> I am trying to use the values from every cell of the data frame in a
> further calculation.
> This is the code that I am using to catch every element of the data-frame.
>
> while (a<=10)
> {
> while (b<=10)
> {
> n<-as.numeric(
Sahana,
The notation
df[a,b)]
is plain wrong. I think you meant (but I may be mistaken)
df[a, b]
and I am not still sure if that would work in your example. Have you
instead considered subset()? E.g.,
subset(df, a <= 10 & b <= 10)
See ?subset for more details.
Also, "df" is a very bad n
Hi everyone,
I am trying to use the values from every cell of the data frame in a
further calculation.
This is the code that I am using to catch every element of the data-frame.
while (a<=10)
{
while (b<=10)
{
n<-as.numeric(df[a,b)];
...;
}
}
The problem is that when I print out 'n' I get the fol
Dear R community,
I've been writing simple functions for the past year and half and have come
across a similar problem several times. The execution of a function within
my own function produces NaN's or fails to execute as intended. My conundrum
is that I can execute the function outside of my fu
Kulupp online.de> writes:
>
> I have two vectors (a and b) with counts of animals and wanted to
> calculate fisher's alpha:
>
> library(vegan)
> a <- c(2043, 1258, 52, 1867, 107, 1624, 2, 157, 210, 402, 5, 107, 267,
> 2, 13683)
> b <- c(2043, 1258, 52, 1867, 107, 1624, 2, 157, 210, 402, 5, 10
On 22.03.2013 01:09, Abby Frazier wrote:
Hello,
I am trying to decide which package to use to calculate the non-parametric
Sen's Slope for identifying trends in rainfall data (determine the slope
between all pairs of points and take the median of those slopes). I have
found three packages tha
I typically run
R CMD Sweave
which resolves issues with style files in directories unknown to your
LaTeX distribution.
Best,
Uwe Ligges
On 21.03.2013 18:44, lgh0504 wrote:
The pdflatex is the an excutable programe located in your MiKTex‘ bin
folder, I guess you have not add your MikTex
For the record, one may also nest one do.call within another, e.g. via
functional::Curry
lapply(X = mylist2,
FUN = do.call,
what = Curry(FUN = f2, y = Y)
)
On 03/13/2013 12:22 PM, Blaser Nello wrote:
> One way is to use the do.call function. For example:
>
> re
Thank you Jean
Basically I know that it is possible, however it is quite sensitive to starting
values and those 2 peaks do not provide perfect fit. There is probably third
peak between those 2 (based on other results).
But if I put third peak to nls I get an error
> fit <- nls(sig ~ d +
+ a1*e
What Bill says, plus the fact that the default handling of logicals in
modelling is to convert them to factors and then use treatment contrasts, which
will effectively give you the right indicator variables automagically (This in
contrast to SAS where you can confuse yourself by declaring a 0/1
Why do you first say min(Datos$x) and then give the numeric value of this
minimum? Just delete all numerical values:
danta=ppp(Datos$x, Datos$y, c(min(Datos$x), max(Datos$x)),
c(min(Datos$y), max(Datos$y)))
or if you really want to type the numeric constants (probably a bad idea)
On Mar 22, 2013, at 4:04, Erin Hodgess wrote:
> Dear R People:
>
> I am trying to replicate a cool example that I saw on the R-bloggers some
> time ago by kafka399.
>
> Here are the lines tI think may be causing the trouble:
>
> gray_file <- read.pnm(path)
>
> pos[i,] <- c(gray_file@grey)
68 matches
Mail list logo