Re: [R] Capturing warning within user-defined function

2018-03-06 Thread Jen
1]) Then I could use p[1] to get my estimated proportion. Then I used: ind <- length(attr(p, "warnings")) print(ind) if (ind > 0) {msg <- names(warnings()) } else { msg <- "No warnings" } overall[1,5] <- msg to complete my table. Thanks, again, William! Jen

Re: [R] Capturing warning within user-defined function

2018-03-06 Thread Jen
Hi William, Thanks, I'll give that a shot. I tried using withCallingHandlers without success but II admit I'm not familiar with it and may have used it wrong. I'll report back. Jen On Tue, Mar 6, 2018, 5:42 PM William Dunlap wrote: > You can capture warnings by using w

[R] Capturing warning within user-defined function

2018-03-06 Thread Jen
d of the function but they're not being captured like they are when run outside of the function. Note the 0 output from print(ind) and V7 has "No warnings". I know a lot of things "behave" differently inside functions. Case in point, the use

Re: [R] force axis to extend

2017-03-16 Thread Jen
Yay! That worked! Thanks so much! Jen On Thu, Mar 16, 2017, 9:28 AM David L Carlson wrote: > Use > > plot(NA, xlim=c(0, 5), ylim=c(-35, 35), type="n", axes=FALSE, ann=FALSE) > > to set up the length of the y axis instead o

Re: [R] force axis to extend

2017-03-16 Thread Jen
Hi Jim, Thanks for replying. Unfortunately, that doesn't work. The axis automatically scales to (-30, 25, by 5). Jen On Wed, Mar 15, 2017, 10:09 PM Jim Lemon wrote: > Hi Jen, > It seems way too simple, but does this work? > > axis(side=2,at=seq(-35,35,by=5),cex.axis=0.7)

[R] force axis to extend

2017-03-15 Thread Jen
reasons, I can't use ggplot or lattice. Thanks, Jen df <- data.frame(matrix(c( '18-29','Females', 23.221039, '30-44','Females', 16.665565, '45-59','Females', 7.173238, '60+', 

[R] How to speed this up?

2017-02-28 Thread Jen
Hi, I'm trying to generate 2.5 million phone numbers. The code below generates a random sample of 250K MPNS for Morocco. It takes about 10 minutes. I need to generate 2.5 million. I've run it through once and it took about 45 hours. Is there a way to speed this up? Thanks, Jen

[R] Restructuring data - unstack, reshape?

2011-09-25 Thread Jen M
Hi all, I'm having a problem restructuring my data the way I'd like it. I have data that look like this: Candidate.IDSpecialty Office Score 110002 C London 47 110002 C East 48 11

Re: [R] studentized and standarized residuals

2011-08-10 Thread Jen
Thanks Patrick - at least I know I wasn't being too silly :-) Jen -- View this message in context: http://r.789695.n4.nabble.com/studentized-and-standarized-residuals-tp3732997p3733173.html Sent from the R help mailing list archive at Nabble.com. ___

[R] studentized and standarized residuals

2011-08-10 Thread Jen
Hi, I must be doing something silly here, because I can't get the studentised and standardised residuals from r output of a linear model to agree with what I think they should be from equation form. Thanks in advance, Jennifer x = seq(1,10) y = x + rnorm(10) mod = lm(y~x) rstandard(mod) residuals

Re: [R] different regression coeffs with different starting point

2011-03-14 Thread Jen
Hi Bill, Thanks for your response and I'm sorry -- that was a misleading example of what I was trying to show. This one should illustrate the point: require(AER) data_in = c(0,6,12,18,24,30,36,42,48,54,60,66,72,78) data_in2 = data_in^2 data_in3 = data_in^3 data_out = c(139487.00,13.00,62500.00

[R] different regression coeffs with different starting point

2011-03-14 Thread Jen
Hi all, I have a question about the optimisation methods used in nonlinear regression. I have some data that I would like to fit a tobit regression model to (see code below). It seems that the solution is very sensitive to the initial condition that I give it - is there any option to use a differen

Re: [R] tobit regression model

2011-03-11 Thread Jen
H Zeileis, This helped out a lot - thanks!! Jen -- View this message in context: http://r.789695.n4.nabble.com/tobit-regression-model-tp3345789p3347936.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] tobit regression model

2011-03-10 Thread Jen
Hi, I'm trying to fit a tobit regression model to some data. When fitting the exact same data in Stata, I have no problems at all, however R won't converge. Its not a maxiters thing, since I've tried increasing this already. I need to be able to fit the model in R since there are users of the code

[R] How to display full name for the coefficients/factors in summary()?

2009-11-03 Thread Jen-Chien Chang
Hi, I am wondering if there is a way to display the full anme of the regression coeffients/factors in the summary? Suppose I have a bogus data set using weekday as factor which has 7 levels such as: mydata <- sample(364) wk <- rep(1:7, 52) weekday <- factor(wk,1:7,c("Mon","Tue","Wed","Thu"

[R] how to print the full name of the factors in summary?

2009-11-02 Thread Jen-Chien Chang
Hi, I am wondering if there is a simple way to fix the problem I am having. For unknown reason, I could not get the full name of the factors to be printed in the summary. I have tried to used summary.lm as well but the problem still persists. SJ$Weekday <- factor(SJ$Weekday,1:7,c("Mon","Tue

[R] R package for visualizing/analyzing accelerometry data?

2009-09-29 Thread Jen Maresh
might be useful for this? Thank you in advance, Jen ~ Jennifer Maresh, PhD Student Center for Ocean Health, Long Marine Lab 100 Shaffer Rd. University of California Santa Cruz, CA 95060 mar...@biology.ucsc.edu __ R-help@r-project.org

[R] invalid type (list) for variable

2009-09-14 Thread Jen Maresh
Hello - I am attempting to add interaction terms to a model using the gamm function in the mgcv package. I stripped it down to only two terms to simplify it. I have no trouble with individual terms, continuous or factors, nor with interacting factor terms; I cannot, however, figure out how to add