Dear Jeff,
I am sending an updated version of the code.
The initial version assumed that the time points correspond to an
integer sequence. The code would fail for arbitrary times.
The new code is robust. I still assume that the data is in column-format
and that you want the time to the p
Suppose your data were represented as parallel vectors "time" and "type",
meaning that at time[i] a type[i] event occurred. You didn't say what you
wanted if there were a run of "A" or "B". If you are looking for the time
span between the last of a run of one sort of event and the first of a run
Dear Jeff,
My answer is a little bit late, but I hope it helps.
jrdf = read.table(text="Time Event_AEvent_B Lag_B
1 1 10
2 0 11
3 0 00
4 1 00
5 0 11
6 0
, Jan 12, 2022 1:44 am
Subject: Re: [R] Method Guidance
Hi Jeff,
A completely obscure question deserves a completely obscure answer:
jrdf<-read.table(text="Time Event_A Event_B Lag_B
1 1 1 0
2 0 1 1
3 0 0 0
4
-project.org
Subject: Re: [R] Method Guidance
Hello,
Here is a base R solution for what I understand of the question.
It involves ave and cumsum. cumsum of the values of Event_A breaks Event_B in
segments and ave applies a function to each segment. To find where are the
times B, coerce to logical and
Hello,
Here is a base R solution for what I understand of the question.
It involves ave and cumsum. cumsum of the values of Event_A breaks
Event_B in segments and ave applies a function to each segment. To find
where are the times B, coerce to logical and have which() take care of
it. Data in
Hi Jeff,
A completely obscure question deserves a completely obscure answer:
jrdf<-read.table(text="Time Event_AEvent_B Lag_B
1 1 10
2 0 11
3 0 00
4 1 00
5 0 11
6
1) Figure out how to post plain text please. What you saw is not what we see.
2) I see a "table" of input information but no specific expectation of what
would come out of this hypothetical function.
3) Maybe you will find something relevant in this blog post:
https://jdnewmil.github.io/blog/po
R-Help Forum
Looking for a little guidance. Have an issue were I'm trying to determine
the time between when Event A happened(In days) to when a subsequent Event B
happens. For Example at Time 1 Evat A happens and subsequently Event B
happens at the same day (0) and the next day (1) then Event
Hello,
in some R sessions, method dispatch for objects of the (S4) class “lavaan"
fail. An example from such a “bad” session:
> library(lavaan)
> HS.model <- ' visual =~ x1 + x2 + x3
+ textual =~ x4 + x5 + x6
+ speed =~ x7 + x8 + x9 '
> fit <- cfa(HS.model, data =
Hi,
I'm trying to use method of moments estimation to estimate 3 unkown paramters
delta,k and alpha.
so I had system of 3 non linear equations:
1) [delta^(1/alpha) *gamma (k-(1/alpha)) ]/gamma(k) = xbar
2) [delta^(2/alpha) *gamma (k-(2/alpha)) ]/gamma(k) = 1/n *sum (x^2)
3) [delta^(3/alpha)
botto
Sent: Thursday, December 12, 2013 5:15 PM
To: capricy gao; r-help@r-project.org
Subject: Re: [R] method default for hclust function
Absolute distance is the default distance in hclust.
v<-c(1,2,3,4,5,6)
dist(v)
2 1
3 2 1
4 3 2 1
5 4 3 2 1
6 5 4 3 2 1
Eliza
> Date:
On Thu, Dec 12, 2013 at 3:09 PM, capricy gao wrote:
> I could not figure out what was the default when I ran hclust() without
> specifying the method.
According to help("hclust"), the default method is complete linkage.
HTH,
Peter
__
R-help@r-projec
Absolute distance is the default distance in hclust. v<-c(1,2,3,4,5,6)
dist(v)
2 1
3 2 1
4 3 2 1
5 4 3 2 1
6 5 4 3 2 1
Eliza
> Date: Thu, 12 Dec 2013 15:09:19 -0800
> From: capri...@yahoo.com
> To: r-help@r-project.org
> Subject: [R] method default for hclust
I could not figure out what was the default when I ran hclust() without
specifying the method.
For example:
I just have a code like:
hclust(dist(data))
Any input would be appreciated:)
[[alternative HTML version deleted]]
__
R-help@r-project
Please read the proto vignette before asking further questions about
it. It is an alternative to/version of OOP different from S3 and S4.
-- Bert
On Fri, Aug 9, 2013 at 8:13 AM, Simon Zehnder wrote:
> Hi Martin,
>
> is proto in S3?
>
> I will take a look first at the simple package EBImage.
>
>
Hi Martin,
is proto in S3?
I will take a look first at the simple package EBImage.
Thank you very much for the suggestions!
Best
Simon
On Aug 9, 2013, at 5:01 PM, Martin Morgan wrote:
> On 08/09/2013 07:45 AM, Bert Gunter wrote:
>> Simon:
>>
>> Have a look at the "proto" package for whi
On 08/09/2013 07:45 AM, Bert Gunter wrote:
Simon:
Have a look at the "proto" package for which there is a vignette. You
may find it suitable for your needs and less intimidating.
Won't help much with S4, though! Some answers here
http://stackoverflow.com/questions/5437238/which-packages-make-
Hi Bert,
thank you very much for your suggestion! I will take a look at it soon!
Best
Simon
On Aug 9, 2013, at 4:45 PM, Bert Gunter wrote:
> Simon:
>
> Have a look at the "proto" package for which there is a vignette. You
> may find it suitable for your needs and less intimidating.
>
> Chee
Simon:
Have a look at the "proto" package for which there is a vignette. You
may find it suitable for your needs and less intimidating.
Cheers,
Bert
On Fri, Aug 9, 2013 at 7:40 AM, Simon Zehnder wrote:
> Hi Martin,
>
> thank you very much for this profound answer! Your added design advice is
>
Hi Martin,
thank you very much for this profound answer! Your added design advice is very
helpful, too!
For the 'simple example': Sometimes I am still a little overwhelmed from a
certain setting in the code and my ideas how I want to handle a process. But I
learn from session to session. In f
On 08/04/2013 02:13 AM, Simon Zehnder wrote:
So, I found a solution: First in the "initialize" method of class C coerce
the C object into a B object. Then call the next method in the list with the
B class object. Now, in the "initialize" method of class B the object is a B
object and the respecti
So, I found a solution: First in the "initialize" method of class C coerce the
C object into a B object. Then call the next method in the list with the B
class object. Now, in the "initialize" method of class B the object is a B
object and the respective "generateSpec" method is called. Then, in
Dear R-Users and R-Devels,
I am struggling with the method dispatch for S4 objects. First I will give a
simple example to make clear what the general setting in my project is.
Three classes will be build in the example: A is just a simple class. B
contains A in a slot and C inherits from B. In
On 11/19/2012 04:21 PM, Andrea Spano wrote:
Hello the list,
As a simple example:
rm(list = ls())> setClass("tre", representation(x="numeric"))> setMethod("show", "tre", def = function(object) cat(object@x))[1] "show">
setMethod("summary", "tre", def = function(object) cat("This is a tre of v
Hello the list,
As a simple example:
> rm(list = ls())> setClass("tre", representation(x="numeric"))>
> setMethod("show", "tre", def = function(object) cat(object@x))[1] "show">
> setMethod("summary", "tre", def = function(object) cat("This is a tre of
> value ", object@x, "\n"))Creating a ge
On 09/09/2012 12:14 AM, Zhang Qintao wrote:
Hi, All,
I am trying to use R to make the following type of boxplot while I couldn't
find a way to do it.
My dataset looks like X1 Y1 X2 Y2 SPLIT. The split highlights my
experiment details and both x and y are continuous numerical values. I
need
The symbols function allows you to place boxplot symbols at specified
x,y coordinates. Would that do what you want?
On Sat, Sep 8, 2012 at 8:14 AM, Zhang Qintao wrote:
> Hi, All,
>
> I am trying to use R to make the following type of boxplot while I couldn't
> find a way to do it.
>
> My dataset
On Sep 8, 2012, at 7:14 AM, Zhang Qintao wrote:
> Hi, All,
>
> I am trying to use R to make the following type of boxplot while I couldn't
> find a way to do it.
>
> My dataset looks like X1 Y1 X2 Y2 SPLIT. The split highlights my
> experiment details and both x and y are continuous numeric
-Original Message-
> From: qintao.zh...@gmail.com
> Sent: Sat, 8 Sep 2012 22:14:26 +0800
> To: r-help@r-project.org
> Subject: [R] method or package to make special boxplot
>
> Hi, All,
>
> I am trying to use R to make the following type of boxplot while I
> couldn&
Hi, All,
I am trying to use R to make the following type of boxplot while I couldn't
find a way to do it.
My dataset looks like X1 Y1 X2 Y2 SPLIT. The split highlights my
experiment details and both x and y are continuous numerical values. I
need to plot y vs. x with split as legend and boxp
I've been following the example in the R help page:
http://stat.ethz.ch/R-manual/R-devel/library/survival/html/frailty.html
library(survival);
coxph(Surv(time, status) ~ age + frailty(inst, df=4), lung)
Here, in this particular example they fixed the degrees of freedom for the
random institutio
Thank you both for very helpful answers. I have indeed missed the help pages
about "(" and now the situation is more clear.
> You can use this syntax by defining a function `x<-` <- function(...) {}
> and it could be an S3 method, but it is a completely separate object from
> x.
Unfortunately
The details here are much more appropriate for R-devel, but please
check the help pages for "(" and "[", and note
- "[" is generic and "(" is not.
- the primitive `(` is used to implement constructions such as
(x <- pi) and not x(...).
The special handling of operators such as "[" is part of th
On 11-01-13 3:09 AM, Taras Zakharko wrote:
Dear R gurus,
I am trying to create a nicer API interface for some R modules I have
written. Here, I heavily rely on S3 method dispatch mechanics and
makeActiveBinding() function
I have discovered that I apparently can't dispatch on function call
Dear R gurus,
I am trying to create a nicer API interface for some R modules I have
written. Here, I heavily rely on S3 method dispatch mechanics and
makeActiveBinding() function
I have discovered that I apparently can't dispatch on function call
operator (). While .Primitive("(") exists, whi
On 25/04/2010 9:07 AM, Albert-Jan Roskam wrote:
Hi,
I'm having trouble seeing the added value over functions defined by setGeneric
vis-a-vis
methods defined by inheritance and polymorphism. setGeneric offers a 'clean' call
to a generic function, ie. no need to call new(), so less typing to do
Hi,
I'm having trouble seeing the added value over functions defined by setGeneric
vis-a-vis
methods defined by inheritance and polymorphism. setGeneric offers a 'clean'
call to a generic function, ie. no need to call new(), so less typing to do for
the user. But such explicit calls can also be
Hi,
I'm having trouble seeing the added value over functions defined by setGeneric
vis-a-vis
methods defined by inheritance and polymorphism. setGeneric offers a 'clean'
call to a generic function, ie. no need to call new(), so less typing to do for
the user. But such explicit calls can also be
method in "exportMethods". What did I miss here? Thanks a lot
> for your help.
>
>
>
> export(MackChainLadder, MunichChainLadder, BootChainLadder, MultiChainLadder)
> export(Join2Fits, JoinFitMse, Mse, residCov)
>
> importFrom(stats, quantile, predict, coef, vcov,
tFrom(stats, quantile, predict, coef, vcov,
residuals, fitted, fitted.values, rstandard)
importFrom(methods, show, coerce)
importFrom(graphics, plot)
#Classes
exportClasses(triangles, MultiChainLadder, MultiChainLadderFit,
MCLFit, GMCLFit, MultiChainLadderMse)
On 03/01/2010 01:31 PM, Zhang,Yanwei wrote:
> Dear all,
>
> In a package, I defined a method for "summary" using
setMethod(summary, signature="abc") for my class "abc", but when the
package is loaded, the function "summary(x)" where x is of class "abc"
seems to have called the default summary func
Dear all,
In a package, I defined a method for "summary" using setMethod(summary,
signature="abc") for my class "abc", but when the package is loaded, the
function "summary(x)" where x is of class "abc" seems to have called the
default summary function for "ANY" class. Shouldn't it call the met
-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of rubystallion
Sent: Wednesday, January 13, 2010 11:57 AM
To: r-help@r-project.org
Subject: [R] Method for reduction of independent variables
Hello
I am currently investing software code metrics for a variety o
Hello
I am currently investing software code metrics for a variety of software
projects of a company to determine the worst parts of software products
according to specified quality characteristics.
As the gathering of metrics correlates with effort, I would like to find a
subset of the metrics
You are right,but I´ll explain,my code creates a time series,after some
transformations I need to make a prediction,which predicts 10values using
the above,then written in a file,I put the code to see if it looks better:
# TODO: Add comment
#
# Author: Ignacio2
##
s
>> Sent: Tuesday, November 24, 2009 12:22 PM
>> To: yonosoyelmejor
>> Cc: r-help@r-project.org
>> Subject: Re: [R] Method
>>
>>
>> On Nov 24, 2009, at 1:44 PM, yonosoyelmejor wrote:
>>
>> >
>> > I use length(myVector),but when i want t
On Nov 24, 2009, at 3:21 PM, David Winsemius wrote:
On Nov 24, 2009, at 1:44 PM, yonosoyelmejor wrote:
I use length(myVector),but when i want to use for example
exp(x.reconstruida[length(myVector)+1:length(myVector)+9]), I need
that
function returns the number of last element,would then:
Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius
> Sent: Tuesday, November 24, 2009 12:22 PM
> To: yonosoyelmejor
> Cc: r-help@r-project.org
> Subject: Re: [R] Method
>
>
> On Nov 24, 2009, at 1:
On Nov 24, 2009, at 1:44 PM, yonosoyelmejor wrote:
I use length(myVector),but when i want to use for example
exp(x.reconstruida[length(myVector)+1:length(myVector)+9]), I need
that
function returns the number of last element,would then:
if the last position of my vector is 1440
exp(x.reco
If the last position of your vector is 1440, what do you expect to get
from 1440 + 1???
And you certainly need some parentheses in there if you expect to get a range of
values from your vector.
Perhaps you need some subtraction?
And no, we still can't tell exactly what you want. If this doesn't
a
I use length(myVector),but when i want to use for example
exp(x.reconstruida[length(myVector)+1:length(myVector)+9]), I need that
function returns the number of last element,would then:
if the last position of my vector is 1440
exp(x.reconstruida[1440+1:1440+9]
This is what I need, I hope havin
myVector <- c(seq(10),23,35)
length(myVector)
myVector[length(myVector)]
it's unclear to me which of the two you want ...
HTH, Joh
yonosoyelmejor wrote:
>
> Hello, i would like to ask you another question. Is exist anymethod to
> vectors that tells me the last element?That is to say,I have a v
On Tue, 24 Nov 2009 10:14:18 -0500 Sarah Goslee
wrote:
> x <- runif(45) # make a test vector
> length(x) # position of the last element
> x[length(x)] # value of the last element
For the last one, this should be even better: tail(x, 1)
But, actually benchmarking this, it turns out
On Nov 24, 2009, at 10:20 AM, Keo Ormsby wrote:
yonosoyelmejor escribió:
Hello, i would like to ask you another question. Is exist anymethod
to
vectors that tells me the last element?That is to say,I have a
vector, I
want to return the position of last element. I hope having explained.
A
It isn't entirely clear what you want. Maybe one of these?
x <- runif(45) # make a test vector
length(x) # position of the last element
x[length(x)] # value of the last element
Sarah
On Tue, Nov 24, 2009 at 5:18 AM, yonosoyelmejor
wrote:
>
> Hello, i would like to ask you another
yonosoyelmejor escribió:
Hello, i would like to ask you another question. Is exist anymethod to
vectors that tells me the last element?That is to say,I have a vector, I
want to return the position of last element. I hope having explained.
A greeting,
Ignacio.
vect1 <- c(1,2,3)
vect1[length(v
Hello, i would like to ask you another question. Is exist anymethod to
vectors that tells me the last element?That is to say,I have a vector, I
want to return the position of last element. I hope having explained.
A greeting,
Ignacio.
--
View this message in context:
http://old.nabble.com/Metho
How can I determine what S3 method will be called for a particular
first-argument class?
I was imagining something like functionDispatch('str','numeric') =>
utils:::str.default , but I can't find anything like this.
For that matter, I was wondering if anyone had written a version of
`methods` whi
hello,
does anybody know a method for calculating grey-level co-occurrence
matrices (GLCM) for RGB-pictures with R?
(unfortunately i haven't found a solution for this problem neither via
(scholar)google nor via r-project helplist)
thank you very much!
best regards
Hans-Joachim Klemmt
--
--
Hi Joe,
You're using the lme() function? If so, then adding
/method = "ML" /
to the argument list should do the trick.
Cheers,
Luc
joewest wrote:
Hi
I am doing lme models and they are coming out using the REML method, can
anyone please tell me how i use the ML method and exactly what i put
Hi
I am doing lme models and they are coming out using the REML method, can
anyone please tell me how i use the ML method and exactly what i put in to R
to do this?
Just wanted to say thanks for everyone who helped with my last question.
Thanks
Joe
--
View this message in context:
http://w
First of all I'd like to thank all those who answered me back teaching me
different ways to get the calledfunction modify global data rather than its
own. I fixed that.
Now I have a similar pproblem. Whenever the caller passes a matrix to the
called function I thought the called function would
On 11/7/2008 3:24 AM, Hans-Joachim Klemmt wrote:
hello,
i am looking for a method to return rgb-values of predifined pixels of
jpg images.
can anybody help me?
See the rimage package, with function read.jpeg. It will read the whole
file into a large array, with separate red, green, blue
. Philippe Grosjean
) ) ) ) )
( ( ( ( (Numerical Ecology of Aquatic Systems
) ) ) ) ) Mons-Hainaut University, Belgium
( ( ( ( (
..
Kurapati, Ravichandra (Ravichandra) wrote:
Hi ,
can some body tell to me "how to run a R method /function
hello,
i am looking for a method to return rgb-values of predifined pixels of
jpg images.
can anybody help me?
thank you very much
best regards
hans-joachim klemmt
--
--
Dr. Hans-Joachim Klemmt
Forstoberrat
Organisationsprogrammierer IHK
Bayerische Landesanstalt für
Hi ,
can some body tell to me "how to run a R method /function as a
background process from R interface"
Thanks
K.Ravichandra
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://st
--Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of hadley wickham
Sent: Monday, July 07, 2008 8:10 AM
To: Ben Bolker
Cc: [EMAIL PROTECTED]
Subject: Re: [R] Method for checking automatically which distribtions fits
a data
Suppose I have a vector of data.
Is there a m
:10 AM
To: Ben Bolker
Cc: [EMAIL PROTECTED]
Subject: Re: [R] Method for checking automatically which distribtions fits
a data
>> Suppose I have a vector of data.
>> Is there a method in R to help us automatically
>> suggest which distributions fits to that data
>> (e.g. no
>> Suppose I have a vector of data.
>> Is there a method in R to help us automatically
>> suggest which distributions fits to that data
>> (e.g. normal, gamma, multinomial etc) ?
>>
>> - Gundala Viswanath
>> Jakarta - Indonesia
>>
>
> See
>
> https://stat.ethz.ch/pipermail/r-help/2008-June/166259.h
To: r-help stat.math.ethz.ch
> Sent: Sunday, July 6, 2008 4:50:20 PM
> Subject: [R] Method for checking automatically which distribtions fits a data
>
> Hi,
>
> Suppose I have a vector of data.
> Is there a method in R to help us automatically
> suggest which di
g the fits (possibly penalizing distributions which
require more parameters - for instance, using the Akaike Information
Criterion(?)).
- Original Message
From: Gundala Viswanath <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Sunday, July 6, 2008 4:50:20 PM
Subject: [R] Method f
Hi,
In my experience, I just plot the data set then figure it out.
Maybe you could try this?
I really wonder that there is such a R function exists.
If yes, please let me know.
Thanks
Chunhao Tu
Quoting Gundala Viswanath <[EMAIL PROTECTED]>:
Hi,
Suppose I have a vector of data.
Is there a met
Hi,
Suppose I have a vector of data.
Is there a method in R to help us automatically
suggest which distributions fits to that data
(e.g. normal, gamma, multinomial etc) ?
- Gundala Viswanath
Jakarta - Indonesia
__
R-help@r-project.org mailing list
http
74 matches
Mail list logo