Re: [R] seemingly unrelated regression

2009-04-09 Thread Ben Bolker
e useful), and most likely we can't help without a reproducible example ... Ben Bolker -- View this message in context: http://www.nabble.com/seemingly-unrelated-regression-tp22970572p22971060.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] pdftex treats R pdf figures incorrectly

2009-04-10 Thread Ben Bolker
Андрей Парамонов gmail.com> writes: > > Hello! > > I use R 2.8.1 under Debian GNU/Linux. I've run into a problem > including R pdf figures into LaTeX document. To reproduce: > [snip snip snip] I would suggest forwarding this request to the r-devel mailing list ...

Re: [R] Help with postscript (huge file size)

2009-04-11 Thread Ben Bolker
* create a bitmap (PNG) plot, then use image manipulation tools (ImageMagick etc.) to convert that back to a PostScript file * there was some discussion earlier about whether one could embed a bitmap of just the internals of the plot, leaving the axes, labels etc. in vector format, b

Re: [R] Help with postscript (huge file size)

2009-04-11 Thread Ben Bolker
out, I'm generating plots of > rgb images. > > Talita > > 2009/4/11 Ben Bolker mailto:bol...@ufl.edu>> > > > Talita Perciano wrote: >> Dear users, >> >> I'm generating some images in R to put into a document that I'm producing >&g

Re: [R] source code for prompt()

2009-04-17 Thread Ben Bolker
Markus Loecher-4 wrote: > > Dear R community, > pardon my ignorance but how would you get the source code for"non-visible > functions" ? > > For example, I would like to see and modify the source code for the > prompt() > function. > > prompt() is visible: > prompt function (object, filena

Re: [R] Loop question

2009-04-17 Thread Ben Bolker
Brendan Morse wrote: > > Hi everyone, I am trying to accomplish a small task that is giving me > quite a headache. I would like to automatically generate a series of > matrices and give them successive names. Here is what I thought at > first: > > t1<-matrix(0, nrow=250, ncol=1) > > for

Re: [R] Modelling an "incomplete Poisson" distribution ?

2009-04-18 Thread Ben Bolker
might break if there are no zeros at all (adding some zeros would be a pretty awful hack/workaround). If you defined a dtpoisson() for the distribution of the truncated Poisson model, you could probably also use bbmle with the formula interface and the "parameters" argument. The likelihood ra

Re: [R] AICs from lmer different with summary and anova

2009-04-19 Thread Ben Bolker
is typically being used to compare fixed effects) should make this assumption, but I'm not sure whether it's documented anywhere. Ben Bolker -- View this message in context: http://www.nabble.com/AICs-from-lmer-different-with-summary-and-anova-tp23061269p23125352.html Sent fr

Re: [R] Two or more dimensional root (Zero) finding

2009-04-20 Thread Ben Bolker
ifficult problem (see _Numerical Recipes_ for discussion). A reasonable approach is to search for the minimum of the square of the function (using optim(), nlmin(), etc.). Ben Bolker -- View this message in context: http://www.nabble.com/Two-or-more-dimensional-root-%28Zero%29-finding-tp23135160p23

Re: [R] problem with new version

2009-04-20 Thread Ben Bolker
Roslina Zakaria wrote: > > > Hi R-users, > > I just change to the new version of R.  I just wonder why everytime I run > my function I will get this message: > >> source(.trPaths[4], echo=TRUE, max.deparse.length=1) > > Are you by any chance using Tinn-R? Could be a glitch in the in

Re: [R] Two or more dimensional root (Zero) finding

2009-04-20 Thread Ben Bolker
Ravi Varadhan wrote: > That is not a good approach, i.e. finding the zero, x*, of F(x), such that > F(x*) = 0, as a minimum of ||F(x)|| is NOT a good approach. Any root of > F(x) is indeed a global minimum of ||F(x)||, or for that matter, the global > minimum of any f(F(x)), where f(.) is a mappi

Re: [R] doing zero inflated glmm for count data with fmr

2009-04-20 Thread Ben Bolker
l Builder (maybe?) or (b) WinBUGS ... I would strongly recommend that you forward further queries on this to the r-sig-mixed-models specialty list ... cheers Ben Bolker -- View this message in context: http://www.nabble.com/doing-zero-inflated-glmm-for-count-data-with-fmr-tp23136570p23138

Re: [R] automatic exploration of all possible loglinear models?

2009-04-21 Thread Ben Bolker
Dieter Menne wrote: > > Christopher W. Ryan binghamton.edu> writes: > >> >> Is there a way to automate fitting and assessing loglinear models for >> several nominal variables . . . something akin to step or drop1 or add1 >> for linear or logistic regression? > > Not strictly for loglinear,

Re: [R] plot with 2 y axes

2009-04-21 Thread Ben Bolker
Christophe Dutang1 wrote: > > I would like to know how to do a plot with 2 y axes in R. With google, > I found this topic has been discussed twice in the past: > - http://tolstoy.newcastle.edu.au/R/e2/help/06/11/6049.html > - https://stat.ethz.ch/pipermail/r-help/2000-September/008182.html >

Re: [R] lmer() function

2009-04-22 Thread Ben Bolker
Ali Mahani wrote: > > I'm trying to estimate a two-tier model with varying intercepts and slopes > across 20 groups, with each group having about 50 observations and with no > group predictor. I use the command lmer(y~x+(1+x | group)). But the result > is a constant intercept (zero standard dev

Re: [R] large factorials

2009-04-22 Thread Ben Bolker
i ... ???) All of this does suppose that you have a good answer to Murray Cooper's question of why you really *need* to evaluate factorials this large and can't get away with manipulating them on the log scale ... Ben Bolker -- View this message in context: http://www.nabble.com/larg

[R] ggplot2/aesthetic plotting advice

2009-04-22 Thread Ben Bolker
a bit ugly. (I was also hoping that ggplot had some magic to do this automatically, but position_dodge doesn't seem to work in this context ...) Ben Bolker library(ggplot2) nx <- 3 ngrp <- 5 nper <- 4 x <- rep(1:nx,ngrp*nper) y <- runif(nx*ngrp*nper) g <- factor(rep(1:ngrp

Re: [R] Two 3D cones in one graph

2009-04-23 Thread Ben Bolker
mo in the rgl package? Ben Bolker -- View this message in context: http://www.nabble.com/Two-3D-cones-in-one-graph-tp23195102p23196270.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.eth

Re: [R] deleting rows provisionally

2009-04-23 Thread Ben Bolker
onyourmark wrote: > > I have an object. I think it is a matrix, called 'answer2' > str(answer2) > int [1:1537, 1:2] 1 399 653 2 3 600 4 5 271 870 ... > - attr(*, "dimnames")=List of 2 > ..$ : chr [1:1537] "a4.1" "hirschsprung.399" "peritoneal.653" > "abdomen.2" ... > ..$ : chr [1:2] "row

Re: [R] Cannot clean infinite values

2009-04-26 Thread Ben Bolker
Nigel Birney wrote: > > Hello all, > > I have to import numeric data from file but found it contains Infinite > values which need to be eliminated. I tried to replace them in this way: > > data[which(data=="-Inf")] <- -0.3 > data[which(data=="+Inf")] <- 0.3 > > But, somehow, the

Re: [R] Memory issues in R

2009-04-26 Thread Ben Bolker
Neotropical bat risk assessments wrote: > > >How do people deal with R and memory issues? >I have tried using gc() to see how much memory is used at each step. >Scanned Crawley R-Book and all other R books I have available and the > FAQ >on-line but no help really found. >R

Re: [R] re fit with binomial model (lme4)

2009-04-28 Thread Ben Bolker
]) wts <- rowSums(newresp) newresp <- newresp[,1]/wts stopifnot(length(newresp) == obj...@dims["n"]) obj...@y <- newresp obj...@pwt <- wts lme4:::mer_finalize(object) }) Ben Bolker -- View this message in context: htt

Re: [R] Why there is no p-value from likelihood ratio test using anova in GAM model fitting?

2009-04-28 Thread Ben Bolker
2 194.2014226.042 -6.2342 -142.358 51.291 < 2.2e-16 *** Unless you can provide us with an example that _will not work_ when we run it, it will be hard for us to help you. Ben Bolker -- View this message in context: http://www.nabble.com/Why-there-is-no-

Re: [R] combining distributions

2009-04-28 Thread Ben Bolker
Rachel Taylor-2 wrote: > > > Hi all, > > I am trying to generate a series of random numbers. What I want to do is > create n random Poisson numbers (easily done with the rpois function) and > then use those generated numbers as the number of genenerated from another > distribution (in this

Re: [R] AICc

2009-04-29 Thread Ben Bolker
Katie Stumpf wrote: > > I am fitting logistic regression models, by defining my own link > function, and would like to get AICc values. Using the glm command > gives a value for AIC, but I haven't been able to get R to convert > that to AICc. Is there a code that has already been writte

Re: [R] What is the R version of the S function fac.design?

2009-04-30 Thread Ben Bolker
753.html> where Martin Maechler describes writing plot.design() . There are other little bits (RSiteSearch("fac.design")) that get the FrF2 package, and the conf.design package. But it doesn't look like there is a drop-in replacement. Ben Bolker -- View this message in cont

Re: [R] normality test for large a large dataset ?

2009-05-04 Thread Ben Bolker
Martial Sankar wrote: > > Do you know a R implemented normality test like the shapiro test but more > suitable for large data set ? > Try installing the "nortest" package. -- View this message in context: http://www.nabble.com/normality-test-for-large-a-large-dataset---tp23364526p2336686

Re: [R] Plotting pairs of bars

2009-05-06 Thread Ben Bolker
Steve Murray-3 wrote: > > > Jim and all, > > Thanks for the suggestion, however, I get the following error: > >> barplot(t(combine86[,1:2], beside = TRUE, las = 1)) > Error in t(combine86[, 1:2], beside = TRUE, las = 1) : > unused argument(s) (beside = TRUE, las = 1) > > I've looked up ?

Re: [R] [R-sig-eco] How to create axes in arbitrary positions?

2010-01-03 Thread Ben Bolker
Zongshan Li To: Bolker,Benjamin Michael References: <831079.35547...@web114002.mail.gq1.yahoo.com> <4b3e3c40.9010...@ufl.edu> Dear Ben Bolker: I appeciate your introducing functions very much for my question, and I am glad that your kindly intention to give me furthe

Re: [R] glmer (lme4), glmmPQL (MASS) and xtmepoisson (Stata)

2010-01-04 Thread Ben Bolker
the r-sig-mixed-mod...@lists.r-project.org , which is specialized for this kind of question. 2. I don't think that a specific replacements for pdDiag/pdIdent are on their way any time soon, but you can get a diagonal structure for the random effects: see p. 16 of (broken URL so gmane do

Re: [R] 2 parameter exponential distribution

2010-01-11 Thread Ben Bolker
fy the > distribution with a shape parameter as well. > > thanks much, > > John > Do you mean a gamma distribution? I'm unfamiliar with any definition of the exponential distribution with more than one parameter. Can you point to

Re: [R] 2 parameter exponential distribution

2010-01-11 Thread Ben Bolker
meter in the original question). > > John Presumably P(x)=0 for x > On Mon, Jan 11, 2010 at 4:23 PM, Ben Bolker <mailto:bol...@ufl.edu>> wrote: > > John Westbury gmail.com <http://gmail.com>> writes: > > > > > Hello, >

Re: [R] advice/opinion on " < -" vs " =" in teaching R

2010-01-15 Thread Ben Bolker
ven actually came up in the course of a first-semester statistics/modeling R course. I just want to do what works best for the students -- the problem is deciding on the balance between short term benefit (<- is one more odd thing to get used to) and long term benefit (they will

Re: [R] function to set log(0)=0 not working on tables or vectors

2010-01-17 Thread Ben Bolker
David Winsemius comcast.net> writes: > > > On Jan 17, 2010, at 8:17 PM, maiya wrote: > > > > > There must be a very basic thing I am not getting... > > > > I'm working with some entropy functions and the convention is to use > > log(0)=0. > > > > I suppose the outcome of that effort may depen

Re: [R] Problem extracting from mer objects

2010-01-18 Thread Ben Bolker
Chris Ramsborg yahoo.com> writes: > I am having a problem extracting from "mer" objects.  >   > I have constructed my problem using existing datasets. >   > Using the following commands: >   > require(lme4) > fm1 <- lmer(Yield ~ 1 + (1 | Batch), Dyestuff) > fixef(fm1) > > I get the following er

Re: [R] A model-building strategy in mixed-effects modelling

2010-01-19 Thread Ben Bolker
t;fixed" and "pooled" are just two ends of a spectrum (variance of the priors of the effects fixed at infinity and zero, respectively), and it's just a practical question of estimation. Doing a lot of hypothesis testing to decide on the best model starts down the road of d

Re: [R] problem with the precision of numbers

2010-01-19 Thread Ben Bolker
, but perhaps it has a closed form solution, maybe as a special function? How much accuracy do you really need in the solution? Ben Bolker __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] R2WinBUGS/ trap

2010-01-25 Thread Ben Bolker
julien martin gmail.com> writes: > > I am generating 1000 replicate data sets in R, each data set is then > analyzed with WinBUGS in batch mode using R2WinBUGS. Unfortunately, > occasionally some data sets lead WinBUGS to open a "trap" window; and the > simulations are interrupted as result of t

Re: [R] R on Hard drive memory

2010-01-29 Thread Ben Bolker
prem_R gmail.com> writes: > > > I heard form my friend there is a way to run R in system hard disk space not > in the RAM .By that we may not run out of memory and have problem attached > with the same.Someone could help me in this.Thanks. Your question is posed extremely vaguely. It's conc

Re: [R] Help with multiple poisson regression with MLE2

2010-02-01 Thread Ben Bolker
elena daniela concepcion gmail.com> writes: > > Hi, I'm trying to make multiple poisson regressions with the MLE2 command. > I have used the following expression, but I receive an error message: > > poisfit <- mle2(y ~ dpois(exp(b0 + b1*x1 + b2*x2)), start=list(b0=1, b1=1, > b2=1), data=data1)

Re: [R] lme4 package and gamma family

2010-02-02 Thread Ben Bolker
cristina gmail.com> writes: > > > Hello, > > I am trying to use the lmer function from the lme4 package I have installed > today (lme4_0.999375-32.zip; R-2.10.1). According to the information, I > should be able to use a generalized linear mixed model. > However when I try to fit a model wit

Re: [R] Retrieve estimates from glmer()

2010-02-04 Thread Ben Bolker
tructure for random effects VarCorr(gm1)$herd ## extract first random effect c(VarCorr(gm1)$herd) ## drop attributes etc. questions like this are probably best asked on r-sig-mixed-mod...@r-project.org cheers Ben Bolker __ R-help@r-project.org mailin

Re: [R] The KJV

2010-02-06 Thread Ben Bolker
Jim Lemon bitwrit.com.au> writes: > > On 02/06/2010 06:57 PM, Charlotte Maia wrote: > > Hey all, > > > > Does anyone know if there are any R packages with a copy of the KJV? > > I'm guessing the answer is no... > > > > So the next question, and the more important one is: > > Does anyone think it

Re: [R] mle.stepwise

2010-02-08 Thread Ben Bolker
osed to work) I would suggest you contact the package author (see help(package="wle") ...) Ben Bolker __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/

Re: [R] col2rgb() function

2023-07-23 Thread Ben Bolker
Does adjustcolor() help? cb8<- c("#00", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2", "#D55E00", "#CC79A7") plot(0,0,xlim=c(1,8),ylim=c(0,1)) points(1:8,rep(0.5,8),col=cb8,pch=19,cex=2) points(1:8,rep(0.75,8),col=adjustcolor(cb8, alpha.f = 0.3), pch=19,cex=2) On 2023-07-23 2:15

Re: [R] col2rgb() function

2023-07-23 Thread Ben Bolker
vid K Stevens, PhD, PE, Professor Civil and Environmental Engineering Utah Water Research Laboratory Utah State University 8200 Old Main Hill Logan, UT 84322-8200 david.stev...@usu.edu (435) 797-3229 (office) On 7/23/2023 1:00 PM, Nick Wray wrote: Thanks That works nicely Nick On Sun, 23 Jul 20

Re: [R] Downloading a directory of text files into R

2023-07-25 Thread Ben Bolker
Where is readtext() from? Some combination of scraping http://home.brisnet.org.au/~bgreen/Data/Hanson1/ and http://home.brisnet.org.au/~bgreen/Data/Hanson2/ to recover the required file names: library(rvest) read_html("http://home.brisnet.org.au/~bgreen/Data/Hanson1/";) |> html_element(

Re: [R] Plotting Fitted vs Observed Values in Logistic Regression Model

2023-08-01 Thread Ben Bolker
logistic_regmod2 <- glm(formula = ratio~x, family = binomial(logit), data = random_mod12_data2, weights =n) plot(ratio ~ x, data = random_mod12_data2) pframe <- data.frame(x = sort(random_mod12_data2$x)) pframe$ratio <- predict(logistic_regmod2, newdata = pframe, type = "response") with(pframe

Re: [R] group consecutive dates in a row

2023-08-07 Thread Ben Bolker
rle(as.numeric(diff(mydf$data_POSIX))) should get you started, I think? On 2023-08-07 12:41 p.m., Stefano Sofia wrote: Dear R users, I have a data frame with a single column of POSIXct elements, like mydf <- data.frame(data_POSIX=as.POSIXct(c("2012-02-05", "2012-02-06", "2012-02-07", "2012-0

Re: [R] Noisy objective functions

2023-08-13 Thread Ben Bolker
This is a huge topic. Differential evolution (DEoptim package) would be one good starting point; there is a simulated annealing method built into optim() (method = "SANN") but it usually requires significant tuning. Also genetic algorithms. You could look at the NLopt list of algorit

Re: [R] X11 font

2023-08-16 Thread Ben Bolker
There's an ancient related question ... maybe it helps? https://stat.ethz.ch/pipermail/r-help//2016-October/442326.html sudo apt-get install xfonts-100dpi sudo-apt-get install xfonts-75dpi apt-cache search xfonts doesn't pull up anything else obvious (presumably you already have xfonts-base

Re: [R] MASS::mvrnorm() on MKL may produce different numbers even when the seed is the same?

2023-08-17 Thread Ben Bolker
> However, should the numbers > generated identical if the same seed is used? I don't see how using the same seed can overcome floating-point differences across platforms (compilers etc.) stemming from differences in an eigen() computation (based on arcane details like use of registers, co

Re: [R] MASS::mvrnorm() on MKL may produce different numbers even when the seed is the same?

2023-08-17 Thread Ben Bolker
Thanks, I was missing the point that this was *non-repeatability on the same platform*. On 2023-08-17 10:31 a.m., Bill Dunlap wrote: MKL's results can depend on the number of threads running and perhaps other things. They blame it on the non-associativity of floating point arithmetic. This

Re: [R] Determining Starting Values for Model Parameters in Nonlinear Regression

2023-08-19 Thread Ben Bolker
Adding one more method: glm(y~ x1 + x2 + x3 - 1, family = gaussian(link = "inverse"), data = mydata) will fit the exact model (including the desired error structure). The default GLM starting values usually work OK, but it is true that inverse-links can sometimes be more finicky than more

Re: [R] Issues when trying to fit a nonlinear regression model

2023-08-20 Thread Ben Bolker
My answer is WAY longer than Bert Gunter's but maybe useful nonetheless. (Q for John Nash: why does the coef() method for nlmrt objects return the coefficient vector **invisibly**? That seems confusing!) Here's what I did: * as a preliminary step, adjust the formula so that I don't ha

Re: [R] Issues when trying to fit a nonlinear regression model

2023-08-20 Thread Ben Bolker
I haven't looked to see whether you or Bert made an algebraic mistake in translating the parameters of the log-linear model to their equivalents for the nonlinear model, but nls() gives me the same answer as nls() in this case (I called my data 'dd2'): n1 <- nlxb(y~theta1 - theta2*exp(

Re: [R] Interpreting Results from LOF.test() from qpcR package

2023-08-20 Thread Ben Bolker
The p-values are non-significant by any standard cutoff (e.g. p<=0.05, p<=0.1) but note that this is a *lack-of-fit* test -- i.e., "does my function fit the data well enough?", **not** a "significant pattern" test (e.g., "does my function fit the data better than a reasonable null model?").

Re: [R] Query on finding root

2023-08-27 Thread Ben Bolker
This doesn't look like homework to me -- too specific. The posting guide says that the list is not intended for "Basic statistics and classroom homework" -- again, this doesn't seem to fall into that category. tl;dr, I think the difference b

Re: [R] Query on finding root

2023-08-28 Thread Ben Bolker
I would probably use the built in qdavies() function... On Mon, Aug 28, 2023, 7:48 AM Leonard Mada via R-help wrote: > Dear R-Users, > > Just out of curiosity: > Which of the 2 methods is the better one? > > The results seem to differ slightly. > > > fun = function(u){((26104.50*u^0.03399381)/((

Re: [R] Query on finding root

2023-08-28 Thread Ben Bolker
(I mean pdavies) On Mon, Aug 28, 2023, 7:52 AM Ben Bolker wrote: > I would probably use the built in qdavies() function... > > On Mon, Aug 28, 2023, 7:48 AM Leonard Mada via R-help < > r-help@r-project.org> wrote: > >> Dear R-Users, >> >> Just out of curi

Re: [R] graph in R with grouping letters from the turkey test with agricolae package

2023-09-13 Thread Ben Bolker
As a side note, I'm curious how often "Tukey test" is misspelled as "Turkey test". Googling '"turkey test" mean comparison' gives 36.1K results (vs 14.3M for '"tukey test" mean comparison" ... On 2023-09-13 10:02 a.m., Richard O'Keefe wrote: d <- read.table("data.txt", TRUE) cor(d[, 3:6

Re: [R] Theta from negative binomial regression and power_NegativeBinomiial from PASSED

2023-09-15 Thread Ben Bolker
Yes, theta is the 'size' or overdispersion parameter. Sometimes also denoted as k. Wikipedia discusses this parameterization in the paragraph starting "In negative binomial regression ..." (but they call this parameter r rather than theta or k). You can also see this in MASS on google bo

Re: [R] Odd result

2023-09-24 Thread Ben Bolker
For what it's worth the janitor::remove_empty() (which removes all-NA rows by default, can be set to remove columns instead) can be useful for this kind of cleanup. On 2023-09-24 5:58 a.m., Michael Dewey wrote: Dear David To get the first 46 rows just do KurtzData[1:43,] However really you

Re: [R] replace character by numeric value

2023-09-29 Thread Ben Bolker
The reason you're getting the result as character is that you have 'side' as your alternative result in the second ifelse(). If "BUY" and "SELL" are the only options you might try ifelse(side == 'BUY', 1, ifelse(side == 'SELL', -1, NA)) or c(1,-1)[match(side, c("BUY", "SELL"))] or

Re: [R] Question about R software and output

2023-10-03 Thread Ben Bolker
It's conceivable that functions in a contributed package would communicate/transmit or receive data from a remote server, but base R does nothing like that (unless you explicitly ask it to). cheers Ben Bolker On 2023-10-02 3:48 a.m., Ferguson Charity (CEMINFERGUSON) wrote: To wh

Re: [R] download.file strict certificate revocation check

2023-10-04 Thread Ben Bolker
51.0 4 2023-10-03 plotrix 3,082310 of 18,024 98.3 5 2023-10-03 prettyR90 1,954 of 18,024 89.1 It seems that at least plotrix and prettyR would be worth rescuing ... volunteers ... ? (prettyR has 1 strong reverse dep, plotrix has many ...) Ben Bolk

Re: [R] R issue / No buffer space available

2023-10-05 Thread Ben Bolker
This looks like an RStudio issue; it might be better to post the question on their forum On Thu, Oct 5, 2023, 7:43 AM Ohad Oren, MD wrote: > Hello, > > I keep getting the following message about 'no buffer space available'. I > am using R studio via connection to server. I verified that the conn

Re: [R] Linear discriminant analysis

2023-10-12 Thread Ben Bolker
It's possible that neither of these will help, but (1) you can look at the source code of the predict method (MASS:::predict.lda) (2) you can look at the source reference ("Modern Applied Statistics in S", Venables and Ripley) to see if it gives more information (although it might not); th

Re: [R] if-else that returns vector

2023-10-12 Thread Ben Bolker
how about if(T) c(1,2,3) else c(5,6) ? On 2023-10-12 4:22 p.m., Christofer Bogaso wrote: Hi, Following expression returns only the first element ifelse(T, c(1,2,3), c(5,6)) However I am looking for some one-liner expression like above which will return the entire vector. Is there any way

Re: [R] Best way to test for numeric digits?

2023-10-18 Thread Ben Bolker
There are some answers on Stack Overflow: https://stackoverflow.com/questions/14984989/how-to-avoid-warning-when-introducing-nas-by-coercion On 2023-10-18 10:59 a.m., Leonard Mada via R-help wrote: Dear List members, What is the best way to test for numeric digits? suppressWarnings(as.do

Re: [R] Yamamoto test in BreakPoints package

2023-10-19 Thread Ben Bolker
Maybe contact the package maintainer (maintainer("BreakPoints")) and ask? (Normally I avoid bugging package maintainers if I can, but it seems you've looked everywhere else you can ...) Ben Bolker On 2023-10-19 4:18 a.m., Richard O'Keefe wrote: Visit the page at

Re: [R] [Tagged] Re: Fwd: r-stats: Geometric Distribution

2023-10-19 Thread Ben Bolker
e of definition from yours. You can certainly write your code to do `dgeom(x-1, p)`: in fact, you could write a wrapper my_dgeom <- function(x, ...) dgeom(x-1, ...) so that you never have to think about it again ... cheers Ben Bolker On 2023-10-19 3:20 a.m., Jeff Newmiller via R

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-23 Thread Ben Bolker
For what it's worth it looks like spm2 is specifically for *spatial* predictive modeling; presumably its version of CV is doing something spatially aware. I agree that glmnet is old and reliable. One might want to use a tidymodels wrapper to create pipelines where you can more easily swit

Re: [R] Need help to resolve the Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Execution halted

2023-10-26 Thread Ben Bolker
Hmm, I can't replicate (i.e., it works fine for me). What are the results of your sessionInfo() (from a *clean* R session)? == R Under development (unstable) (2023-10-25 r85410) Platform: x86_64-pc-linux-gnu Running under: Pop!_OS 22.04 LTS Matrix products: default BLAS: /usr/local/lib/R/l

Re: [R] weights vs. offset (negative binomial regression)

2023-10-28 Thread Ben Bolker
general you should *not* check overdispersion of the raw data (i.e., the *marginal distribution* of the data, you should check overdispersion of a fitted (e.g. Poisson) model, as below. cheers Ben Bolker edata <- data.frame(Catch, Effort, xx1, xx2, xx3) ## graphical exploration libr

Re: [R] weights vs. offset (negative binomial regression)

2023-10-31 Thread Ben Bolker
e it gives me significant effects" is automatically suspicious.) This would be a good question for CrossValidated (https://stats.stackexchange.com), you could try posting it there (I would be interested in the answer!) cheers Ben Bolker On 2023-10-30 8:19 p.m., 유준택 wrote: Dear

Re: [R] How can I remove my packages from rdrr.io?

2023-11-01 Thread Ben Bolker
There is a github site with an issues list: https://github.com/rdrr-io/rdrr-issues/issues It looks like people have successfully requested removal in the past, e.g. https://github.com/rdrr-io/rdrr-issues/issues/113 On 2023-11-01 9:06 a.m., Kim Emilia wrote: Hello all, I would like to ta

Re: [R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-08 Thread Ben Bolker
Non-standard evaluation On 2023-11-08 10:56 a.m., Christopher W. Ryan via R-help wrote: Very helpful, Deepayan, and educational. Thank you. What does NSE stand for? Thanks, Chris Deepayan Sarkar wrote: --Chris Ryan __ R-help@r-project.org mail

Re: [R] Code editor for writing R code

2023-11-29 Thread Ben Bolker
Presumably there's nothing stopping you *writing* LaTeX in comments -- do you want a code editor that will render and display the LaTeX as you write? (Or am I misunderstanding something?) Does anyone do classic literate programming *sensu* Knuth any more? https://rpubs.com/bbolker/3153

Re: [R] Mann Kendall mutation package?

2023-12-01 Thread Ben Bolker
Have you looked at the Kendall package? https://stackoverflow.com/questions/62288340/mann-kendall-in-r (you've cross-posted a version of this question to SO as well: https://stackoverflow.com/questions/77587426/what-is-the-algorithm-for-the-mann-kendall-mutation-test ) Please don't cross-p

Re: [R] adding "Page X of XX" to PDFs

2023-12-02 Thread Ben Bolker
It's still not entirely clear to me what framework you're using to generate the PDF, but if it's rmarkdown/Rnw (Sweave)/Quarto-based, then as far as I know all of those frameworks use LaTeX as the last step in the script-to-PDF pipeline, and allow the inclusion of arbitrary LaTeX code, so the

Re: [R] adding "Page X of XX" to PDFs

2023-12-02 Thread Ben Bolker
., Jeff Newmiller via R-help wrote: He clearly stated he was using the pdf() graphics device. On December 2, 2023 10:36:44 AM PST, Ben Bolker wrote: It's still not entirely clear to me what framework you're using to generate the PDF, but if it's rmarkdown/Rnw (Sweave)/Quarto-bas

Re: [R] ggplot2: Get the regression line with 95% confidence bands

2023-12-11 Thread Ben Bolker
On 2023-12-11 5:27 p.m., Daniel Nordlund wrote: On 12/10/2023 2:50 PM, Rui Barradas wrote: Às 22:35 de 10/12/2023, varin sacha via R-help escreveu: Dear R-experts, Here below my R code, as my X-axis is "year", I must be missing one or more steps! I am trying to get the regression line wit

Re: [R] ggplot2: Get the regression line with 95% confidence bands

2023-12-12 Thread Ben Bolker
) + > scale_y_continuous(limits=c(470,500),oob=scales::squish) > # > > > > > > > > > > Le lundi 11 décembre 2023 à 23:38:06 UTC+1, Ben Bolker > a écrit : > > > > > > > > On 2023-12-11 5:27 p.m., Daniel Nordlund wrote: > >

Re: [R] Obtaining a value of pie in a zero inflated model (fm-zinb2)

2024-01-07 Thread Ben Bolker
e of a closed-form solution for zero-inflation models as long as the count and/or structural-zero components depend on covariates? In any case, looking inside zeroinfl() you can see that it calls optim() [using BFGS by default, see ?pscl::zeroinfl.control] cheers Ben Bolker On 2024-01-04

Re: [R] Strange results : bootrstrp CIs

2024-01-13 Thread Ben Bolker
It took me a little while to figure this out, but: the problem is that if your resampling leaves out any countries (which is very likely), your model applied to the bootstrapped data will have fewer coefficients than your original model. I tried this: cc <- unique(e$Country) func <- functio

Re: [R] Use of geometric mean for geochemical concentrations

2024-01-22 Thread Ben Bolker
I think https://stats.stackexchange.com would be best: r-sig-ecology is pretty quiet these days On 2024-01-22 11:05 a.m., Rich Shepard wrote: On Mon, 22 Jan 2024, Bert Gunter wrote: better posted on r-sig-ecology? -- or maybe even stack exchange? Bert, Okay. Regards, Rich

Re: [R] Help

2024-02-22 Thread Ben Bolker
I agree that the posting guide is due for updating. If the mailing list maintainers were willing I think r-consult might not be a terrible idea. I do think the center of gravity has moved to Cross Validated, and it might be minimally sufficient to point people there (or Math Overflow for p

Re: [R] Building Packages.

2024-03-20 Thread Ben Bolker
identical results. I thought at one point this might only refer to the GUI package-installation interface, but you seem to be saying it's the install.packages() function as well. Running an up-to-date RStudio on Linux, FWIW -- maybe weirdness only happens on other OSs? Ben Bolke

Re: [R] Building Packages.

2024-03-20 Thread Ben Bolker
Hmm, looks platform-specific. Under Linux both RStudio and external R console return a0b52513622c41c11e3ef57c7a485767 for digest::digest(install.packages) On 2024-03-20 1:20 p.m., Duncan Murdoch wrote: On 20/03/2024 1:07 p.m., Duncan Murdoch wrote: On 20/03/2024 12:37 p.m., Ben Bolker

Re: [R] Building Packages.

2024-03-21 Thread Ben Bolker
::disable() that you'll get back to the original-as-installed version. Even if you have RStudio installed you could change the association in your GUI file browser to open R files in emacs by default ... cheers Ben Bolker On 2024-03-21 4:40 a.m., Martin Maechler wrote: Ben Bolker o

Re: [R] Building Packages.

2024-03-21 Thread Ben Bolker
nal (namespace) version of the function. Duncan Murdoch On 21/03/2024 4:31 a.m., Martin Maechler wrote: "Duncan Murdoch on Wed, 20 Mar 2024 13:20:12 -0400 writes:   > On 20/03/2024 1:07 p.m., Duncan Murdoch wrote:   >> On 20/03/2024 12:37 p.m., Ben Bolker wrote:  

Re: [R] an issue about subsetting a vector

2024-03-24 Thread Ben Bolker
As with a lot of things in R, the behaviour is counterintuitive but (arguably) logical. The key (maybe) is that `a[-x]` does not mean "take all of the elements of a except those indicated by `x`, but rather, "negate x, then take all but the negative elements". In other words, -integer(0)

Re: [R] as.complex()

2024-03-25 Thread Ben Bolker
That's hard to define unambiguously at a mathematical level. What definition did you have in mind? Can you provide more context? (Maybe you want to compare Mod(x) to Mod(y) ?) On 2024-03-25 3:23 a.m., Thomas K wrote: Needing a < , > comparison for imaginary numbers __

Re: [R] Printout and saved results

2024-03-26 Thread Ben Bolker
Fragile and probably a bad idea, but: "%.%" <- function(x,y) { assign(deparse(substitute(x)), y, parent.frame()); print(y) } > a %.% "hello" [1] "hello" > a [1] "hello" Not sure how much value this has over other idioms such as wrapping the assignment in parentheses, which makes

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread Ben Bolker
https://cran.r-project.org/package=index0 On Sun, Apr 21, 2024, 3:56 AM Hans W wrote: > As we all know, in R indices for vectors start with 1, i.e, x[0] is not a > correct expression. Some algorithms, e.g. in graph theory or combinatorics, > are much easier to formulate and code if 0 is an allow

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread Ben Bolker
Also https://cran.r-project.org/package=Oarray (which is older and hence possibly more stable) On 2024-04-21 3:55 a.m., Hans W wrote: As we all know, in R indices for vectors start with 1, i.e, x[0] is not a correct expression. Some algorithms, e.g. in graph theory or combinatorics, are much

Re: [R] Get a copy of a matrix only for TRUE entries of a matching size boolean matrix?

2024-05-03 Thread Ben Bolker
In two steps: result <- matrix(NA_character_, nrow=nrow(mat_letters), ncol =ncol(mat_letters)) result[mat_bools] <- mat_letters[mat_bools] On 2024-05-03 8:47 a.m., DynV Montrealer wrote: Is there a way to get a copy of a matrix only for TRUE entries of a matching size boolean matrix? For *

Re: [R] Print date on y axis with month, day, and year

2024-05-09 Thread Ben Bolker
gg0 <- ggplot(data=yyy[1:30,],aes(as.Date(jdate,format="%m-%d-%Y"),Sum)) +geom_point() gg0 + scale_x_date(date_labels = "%m/%d/%Y") On 2024-05-09 7:58 p.m., Sorkin, John wrote: I am trying to use ggplot to plot the data, and R code, below. The dates (jdate) are printing as Mar 01, Mar 15, etc

Re: [R] Current version of R, 4.4.0 and patch to correct the bug fix related to the RStudio viewer pane on Windows systems

2024-05-16 Thread Ben Bolker
important issue, but I'm not optimistic about that ... Ben Bolker On 2024-05-16 1:38 p.m., CALUM POLWART wrote: Do you receive RDS objects from unknown (untrusted) sources? ?? If not - the security issue is a non-issue as I understand it. On Thu, 16 May 2024, 16:21 Vega, Ann (she/her/h

<    1   2   3   4   5   6   7   8   9   10   >