Re: [R] NADA package/cenboxplot() method: maximum censored percentage

2012-08-16 Thread David L Lorenz
Rich, The cenboxplot function uses cenros to estimate the censored values. The cenros function requires at least 2 uncensored observations to be able to do the regression. The cenros function does issue a warning when there are more than 80% censored data, but that is suppressed in

Re: [R] R-help Digest, Vol 112, Issue 6

2012-06-06 Thread David L Lorenz
Rich, The documentation for cenboxplot states that the second argument must be logical and not integer. the function cenboxplot substitutes synthetic values for censored values using ros, hence the error message from the ros method. I also do not understand how you expect group = 'SO4' to

Re: [R] correlation between XY coordinates

2012-05-07 Thread David L Lorenz
Chris, I think that you really need to quantify what you mean by correlation. Things to consider would depend on what the matrices represent--are they the estimates of the same set of N geographic points, are they traces of the same line, are they traces of the same polygon outline? If either

[R] Warning on R CMD check

2012-01-18 Thread David L Lorenz
I am trying to check and build a package that requires another package that generates a warning, so the check step never really completes with no warnings. The package uses some routines in the lubridate package, but when the lubridate package is loaded for the check, I get these warnings:

Re: [R] Warning on R CMD check

2012-01-18 Thread David L Lorenz
Michael, I just checked. I've got 0.2.5. I'll update tonight and see if that fixes the problem. Dave From: R. Michael Weylandt michael.weyla...@gmail.com To: David L Lorenz lor...@usgs.gov Cc: r-help@r-project.org r-help@r-project.org Date: 01/18/2012 03:32 PM Subject: Re: [R] Warning on R CMD

Re: [R] htest class members and print method

2011-12-15 Thread David L Lorenz
Rui, The answer to your last question is easy--you cannot add a new component to an object of class htest and have it printed by print.htest. But that does not mean that you cannot add a component to the output for your own use. You will need to decide what you want for output, both

[R] help for fgui

2011-04-12 Thread David L Lorenz
Anybody use fgui? I find it very handy. I have a question about an argument to the call to gui in the first example. The argument is argFilter, my question has to do with specifying multiple filters. The argument in that example is argFilter=list(flname={{Text files} {.txt}}) ) ##

Re: [R] How to get all combinations between two character vectors?

2011-03-11 Thread David L Lorenz
Rainer, The are probably lots of ways, I'd use levels(interaction(c(a, b), c('x', 'y'), sep='')) Dave Hi I know there is a function - I have used it before - but I always forget what it is called... I need the combination of two character vectors, i.e: x - c(a, b) y - c(x, y) z -

[R] Paired data survival analysis, part 2

2011-01-28 Thread David L Lorenz
I'm curious. I've used the paired-prentice Wilcoxon test for the analysis of parried survival data. I haven't run into use of the coxph for that previously, but I have seen it referenced a couple of times in recent web searches. I have a data set of subjects like this: SubjectT1 R1 T2

Re: [R] Saving objects inside a list

2011-01-03 Thread David L Lorenz
Eduardo, Try this: object.list - sapply(objects(), function(x) get(x), simplify=F, USE.NAMES=T) Dave From: Eduardo de Oliveira Horta eduardo.oliveiraho...@gmail.com To: r-help r-help@r-project.org Date: 01/03/2011 11:32 AM Subject: [R] Saving objects inside a list Sent by:

Re: [R] Jaccard dissimilarity matrix for PCA

2010-12-28 Thread David L Lorenz
Jacob, You might have a look at the vegan package. It might compute the Jaccard distance and it might have some other toolsa that you might be interested in. Dave From: Flabbergaster jlund...@gmail.com To: r-help@r-project.org Date: 12/28/2010 08:26 AM Subject: [R] Jaccard dissimilarity

Re: [R] Fitting a Triangular Distribution to Bivariate Data

2010-12-23 Thread David L Lorenz
Dave, I am a little confused. You ask about a triangle distribution, but describe the situation as a relation between y and x. Do you really want a piecewise linear fit of y to x? That could be gotten using nonlinear least squares. Dave From: Jinsong Zhao jsz...@yeah.net To:

Re: [R] Keeping Leading Zeros, Treating numbers as text

2010-12-21 Thread David L Lorenz
James, How about sprintf('%05d', 210) It works for fixed length id numbers. Dave From: James Splinter james.r.splin...@gmail.com To: R-help@r-project.org Date: 12/21/2010 02:44 PM Subject: [R] Keeping Leading Zeros, Treating numbers as text Sent by: r-help-boun...@r-project.org Hello,

Re: [R] check for item in vector

2010-12-13 Thread David L Lorenz
CH, How about any: any(Tiger == animal) The function which will tell you the index if any match which(Tiger == animal. You should also look at the match funciton. Dave From: C.H. chainsawti...@gmail.com To: R-help r-help@r-project.org Date: 12/13/2010 08:50 AM Subject: [R] check for

Re: [R] predict.lm[e] with formula passed as a variable

2010-12-13 Thread David L Lorenz
Thorn, Here's how I do it: retval - list(as.name('lm'), formula=as.formula(paste(Response, ~, Explan, sep='')), data=as.name(Data)) #... optionally add other arguments retval - eval(as.call(retval)) Dave From: Thaler, Thorn, LAUSANNE, Applied

Re: [R] (no subject)

2010-12-10 Thread David L Lorenz
Andrija, You should be able to extract the data that you want using a call like this (AD substituted for your c) with(AD, tapply(X2, X1, function(x) sort(x, dec=T)[1:5])) That returns a list like this: $`1` [1] 10 9 8 7 6 $`2` [1] 25 24 23 22 21 Just package it the way that you want.

Re: [R] More elegant magnitude method

2010-12-07 Thread David L Lorenz
Jonathan, I'd just return the integer part of the common log: floor(log10(x)) Dave From: Jonathan P Daily jda...@usgs.gov To: r-help@r-project.org Date: 12/07/2010 01:44 PM Subject: [R] More elegant magnitude method Sent by: r-help-boun...@r-project.org I have a need to find the order of

Re: [R] extracting P values from lm model

2010-11-29 Thread David L Lorenz
Rosario, The summary function will compute the f-statistic, from which you can compute the attained p-value. Here's a snippet that shows the f-stat. summary(lm(Y ~ X))$fstatistic valuenumdfdendf 34.23125 1.0 8.0 Dave From: Rosario Garcia Gil

Re: [R] the first. from SAS in R

2010-11-23 Thread David L Lorenz
It all has to do with the precedence of the ! operator. Compare !duplicated(v) + 0 with (!duplicated(v)) + 0 Dave From: Charles C. Berry cbe...@tajo.ucsd.edu To: Dennis Murphy djmu...@gmail.com Cc: r-help@r-project.org Date: 11/23/2010 10:08 AM Subject: Re: [R] the first. from SAS in R Sent