Re: [R] Knitr: how to find out from within a .Rmd file the output type?

2014-10-31 Thread Jeff Laake - NOAA Federal
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 havenb't

Re: [R] import and export data for RMark package

2014-10-22 Thread Jeff Laake - NOAA Federal
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 kristi.glo...@hotmail.com wrote: Dear R users,I wondering how I can

Re: [R] configure lyx2.0.2 with sweave in windows 32 bit.

2012-02-14 Thread Jeff Laake
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

Re: [R] RMark error: only 0's may be mixed with negative subscripts

2010-11-08 Thread Jeff Laake
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 data set using the Robust

Re: [R] Error Running TinnR with R

2010-03-12 Thread Jeff Laake
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

Re: [R] About the interaction A:B

2010-03-05 Thread Jeff Laake
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

Re: [R] About the interaction A:B

2010-03-05 Thread Jeff Laake
You are correct that you need to use ~-1+A:B. I use that all the time and just spaced it out when I was writing the response. Using ~A:B will produce one too many columns. Didn't follow your other question. You can always look at the result of model.matrix to see if it is correct or dig

Re: [R] What is your system for WorkFlow and Source Code Organizing in R ?

2010-02-21 Thread Jeff Laake
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/Jeff Laake/Desktop/MyDocuments/R Development/) { # Detaches package if it is loaded; installs and builds package

Re: [R] Use of R in clinical trials

2010-02-18 Thread Jeff Laake
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

Re: [R] Deleting many columns of a data frame with the same name in a row

2010-02-02 Thread Jeff Laake
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 columns from

Re: [R] Subset and plot

2010-02-02 Thread Jeff Laake
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

Re: [R] Subset and plot

2010-02-02 Thread Jeff Laake
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

Re: [R] Is there a way to make blocks of code independent from each other?

2010-01-31 Thread Jeff Laake
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

Re: [R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread Jeff Laake
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

Re: [R] behavior of by

2008-10-29 Thread Jeff Laake
$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 P. Luque wrote: On Tue, 28 Oct 2008 18:04:57 -0700, Jeff Laake [EMAIL PROTECTED] wrote: Any insight into the behavior

[R] behavior of by

2008-10-28 Thread Jeff Laake
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 change

Re: [R] behavior of by

2008-10-28 Thread Jeff Laake
: 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't entirely understand what it is saying. I'm

Re: [R] Function not returning a vector?

2008-08-28 Thread Jeff Laake
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

Re: [R] matrix row product and cumulative product

2008-08-18 Thread Jeff Laake
),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 wrote: On Sun, 17 Aug 2008, Jeff Laake wrote: I spent a lot of time searching and came up empty handed on the following query

Re: [R] matrix row product and cumulative product

2008-08-18 Thread Jeff Laake
)) system.time(apply(xmat,1,prod)) system.time(Reduce(*,as.data.frame(xmat),accumulate=FALSE)) Jeff Laake wrote: Thanks for the tips on inline, jit and Reduce. The latter was exactly what I wanted although the loop is still the fastest for the simple product (accumulate=TRUE for reduce). With regards

[R] matrix row product and cumulative product

2008-08-17 Thread Jeff Laake
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