I spent a lot of time searching and came up empty handed on the
following query. Is there an equivalent to rowSums that does product or
cumulative product and avoids use of apply or looping? I found a rowProd
in a package but it was a convenience function for apply. As part of a
likelihood calc
l=10)
system.time(cumprod.matrix(xmat))
system.time(t(apply(xmat,1,cumprod)))
system.time(Reduce("*",as.data.frame(xmat),accumulate=FALSE))
system.time(prod.matrix(xmat))
system.time(apply(xmat,1,prod))
system.time(Reduce("*",as.data.frame(xmat),accumulate=TRUE))
Charles C. Berry wr
time(t(apply(xmat,1,cumprod)))
system.time(do.call("cbind",Reduce("*",as.data.frame(xmat),accumulate=TRUE)))
system.time(prod.matrix(xmat))
system.time(apply(xmat,1,prod))
system.time(Reduce("*",as.data.frame(xmat),accumulate=FALSE))
Jeff Laake wrote:
Thanks for the
Try
hazard <- function(x,shape,scale)
{
return ((shape/scale) * (x/scale)^(shape - 1))
}
hazard(1:365,1,1)
--jeff
[EMAIL PROTECTED] wrote:
Why does:
(shape/scale) * (1:365/scale)^(shape - 1)
return a vector of numbers but calling a function
hasard(1:365,shape,scale)
defined like:
hazard
I am old enough. Memory isn't always reliable but Doug Bates recounting
is what I remember and a quick search has BMDP developed in 1961 and SAS
in 1966. To my surprise, the search produced a site that offered BMDP
for sale.
On 2/18/2010 11:15 AM, Peter Dalgaard wrote:
Christopher W. Ryan w
command window
and automates the detach and library() to reattach. I'd be interested
to know how others do this. What I'd like to see is for some way to
initiate that within Tinn-R. I understand it is possible in Eclipse.
bpkg=function(pkg="RMark",pkg.dir="C:/Users/J
On 3/5/2010 9:19 AM, Frank E Harrell Jr wrote:
You neglected to state your name and affiliation, and your question
demonstrates an allergy to R documentation.
Frank
I agree with Frank but will try to answer some of your questions as I
understand it.
First, model.matrix uses the options$contr
r dig into the
internal code. Personally, I've never found it to have a problem.
--jeff
On 3/5/2010 10:16 AM, blue sky wrote:
On Fri, Mar 5, 2010 at 11:41 AM, Jeff Laake wrote:
On 3/5/2010 9:19 AM, Frank E Harrell Jr wrote:
You neglected to state your name and affiliation
I'm considering going back to that version (or switching to Eclipse)
because the newer Tinn-R version requires pacakges Tinn-r and Hmisc and
something is aliasing functions in xtable which blows up my Sweave
runs. For the time being I'm using cut-paste.
On 3/12/2010 10:41 AM, jim holtman wrot
Another package that is not on CRAN or other R depository is RMark. It
works with the software MARK which does the computation. You can find
RMark at http://www.phidot.org/software/mark/rmark/
and MARK from http://www.phidot.org/software/mark/index.html
From the same site you'll find a very c
Put in a function what you would have put in the {} and execute the function
x=1
myf=function()
{
x=3
do something with new value of x
...
}
myf()
print(x) # it will be 1
On 1/31/2010 5:56 PM, Peng Yu wrote:
I'm wondering if there is a way to make blocks of code independent
from each ot
Here is one way with an example:
datas=data.frame(x=1:3,A=1:3,A=1:3)
names(datas)=c("x","A","A")
datas
datas=datas[,names(datas)!="A",drop=FALSE]
datas
On 2/2/2010 8:35 AM, anna wrote:
Hi, I have a data frame datas with half of the columns with the same name
"A". I want to delete all those col
The problem is with attach. You should have seen an error that the
objects are aliased. You have Tanks in your workspace and in the
attached dataframe. It is using the one in your workspace which is not a
factor variable. Try:
c(2,19,21)[Tanks]
with(daily.sub1,c(2,19,21)[Tanks])
Avoid att
Don't need to convert the factors to numeric as that will happen
automatically. See below. However as Rolf pointed out they will be
numbered from 1-4 even though only 3 are left in the subset as all 4
levels are maintained. So the snippet below will work as long as you
specify 4 possible pch
nd problem and
will get back to you. I suggest that you subscribe to the phidot forum.
Jeff Laake (RMark maintainer)
On 11/7/2010 11:03 PM, Umesh Srinivasan wrote:
> Hi all,
>
> I have just started using RMark to analyse capture-recapture data. I am
> trying to analyse a simulated dat
On 2/14/2012 6:51 AM, Rainer M Krug wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 14/02/12 13:41, ATANU wrote:
I am using R 2.14.1. I am trying to configure Lyx with Sweave. I
have read articles but I found none to be complete and I cannot
import sweave document in lyx . Can anyone p
Any insight into the behavior of "by" in the following case would be
appreciated. There is a note in the help details for "by" about
documenting behavior since v2.7 but I don't entirely understand what it
is saying. I'm using R2.7.2 Windows. I'm interested if the following
behavior was a cha
P. Luque wrote:
On Tue, 28 Oct 2008 18:04:57 -0700,
Jeff Laake <[EMAIL PROTECTED]> wrote:
Any insight into the behavior of "by" in the following case would be
appreciated. There is a note in the help details for "by" about
documenting behavior since v2.7 but I don'
and data"
df=data.frame(x=rep(1,3),y=tapply(1:9,factor(c(rep("A",3),rep("B",3),rep("C",3))),sum))
df
by(df$y,df$x,length)
tapply(df$y,df$x,length)
As suggested table(df$x) would have been the more tidy solution for what
I wanted to do.
regards --jeff
Sebastian
Kristi-
Any questions related to RMark should be sent to the forum on RMark at
phidot.org. If you provide me with a snippet of your data I will try to
help you.
regards --jeff
On Wed, Oct 22, 2014 at 5:55 AM, Kristi Glover
wrote:
> Dear R users,I wondering how I can import and extract the dat
This has worked for me to choose the type of code to use to create tables
whether it is pdf or hml/word
doc.type <-
strsplit(rmarkdown:::default_output_format("20141014_Regex_Rmarkdown.Rmd")$name,"_")[[1]][1]
where you would use your .rmd filename in place of
20141014_Regex_Rmarkdown.Rmd I haven
21 matches
Mail list logo