Re: [R] bgroup not rendering properly

2022-12-13 Thread Derek Ogle
Jinsong Zhao wrote: > > > On 2022/12/13 18:02, Martin Maechler wrote: > >>>>>> Jinsong Zhao > >>>>>> on Tue, 13 Dec 2022 17:07:00 +0800 writes: > > > I don > > > > > On 2022/12/13 10:13, Derek Ogle wrote

[R] bgroup not rendering properly

2022-12-12 Thread Derek Ogle
bgroup() from plotmath does not render properly for me. For example plot(0,xlim=c(0,1),ylim=c(0,1)) text(0.3,0.5,expression(bgroup('(',atop(x,y),')'))) text(0.7,0.5,expression(group('(',atop(x,y),')'))) and library(ggplot2) ggplot(mtcars, aes(wt, mpg)) + annotate("text", x=2.5, y=25, label="bg

Re: [R] Inappropriate color name

2020-11-17 Thread Derek Ogle
I agree with, support, and appreciate this message. Thank you Ryan for the courage to write this, and Lainey for your courage to persist with your question. -Original Message- From: R-help On Behalf Of Ryan Novosielski Sent: Tuesday, November 17, 2020 9:40 AM To: r-help mailing list Cc

[R] limit windows() rescale/resize options

2018-07-03 Thread Derek Ogle
I am developing an application that opens an image in a new window using, at times, windows(). I don't want the user to be able to resize the window (and distort the image). The new window contains a menu item called "resize" that contains three options - "R mode", "Fit to window", and "Fixed si

Re: [R] Graph digitisation / tracing

2012-01-28 Thread Derek Ogle
I have successfully used the digitize package for this purpose ... http://cran.r-project.org/web/packages/digitize/index.html wrote: > > I want to take some published graphs and digitise them to allow me to > run some analysis on them. > Is this possible using any of R's > plugins. I don't thi

[R] Finding Imported Packages

2011-03-20 Thread Derek Ogle
Is there a function similar to pkgDepends() that returns the packages that a particular package imports or imports from? I believe I can get this information from the matrix returned from installed.packages() but something like pkgDepends() would be more convenient. I did not find anything use

Re: [R] fitting model to resampled data

2010-09-29 Thread Derek Ogle
Mike, Without completely knowing your end game with these questions and this procedure it does seem like you are "re-inventing the wheel" here. If that is true and given the nls() fit that you are using I would suggest that you look at boot.case() in the alr3 package or nlsBoot() in the nlstoo

Re: [R] Repeating values in a list

2010-09-18 Thread Derek Ogle
e,c(1,1,2)) $a [1] 7 $b [1] 3 $c [1] 1 1 From: Dennis Murphy [mailto:djmu...@gmail.com] Sent: Saturday, September 18, 2010 8:25 PM To: Derek Ogle Cc: R (r-help@R-project.org) Subject: Re: [R] Repeating values in a list Hi: How about > have <- list(a=7,b=3,c=1) > lapply(have, rep, 2

[R] Repeating values in a list

2010-09-18 Thread Derek Ogle
I have a list that looks like this ... > have <- list(a=7,b=3,c=1) > have $a [1] 7 $b [1] 3 $c [1] 1 and I want to have a simple way to change it to the following without re-typing the values ... > desire <- list(a=c(7,7),b=c(3,3),c=c(1,1)) > desire $a [1] 7 7 $b [1] 3 3 $c [1] 1 1 In othe

Re: [R] Equality of Vectors

2010-08-13 Thread Derek Ogle
Patrick, See all(). For example, > all(c(1,2,3)==c(1,2,3)) [1] TRUE > all(c(1,2,3)==c(2,1,3)) [1] FALSE > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Downey, Patrick > Sent: Friday, August 13, 2010 1:49 PM > To: r-help@r

Re: [R] Linear regression on several groups

2010-08-13 Thread Derek Ogle
Have a look at lmList() in the nlme package. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of JesperHybel > Sent: Friday, August 13, 2010 7:56 AM > To: r-help@r-project.org > Subject: Re: [R] Linear regression on several groups

Re: [R] Function to Define a Function

2010-08-10 Thread Derek Ogle
Gabor ... that worked perfectly. Thank you. > -Original Message- > From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] > Sent: Monday, August 09, 2010 10:20 PM > To: Derek Ogle > Cc: R (r-help@R-project.org) > Subject: Re: [R] Function to Define a Function >

[R] Function to Define a Function

2010-08-09 Thread Derek Ogle
I am trying to define a general R function that has a function as the output that depends on the user's input arguments (this may make more sense by looking at the toy example below). My real use for this type of code is to allow a user to choose from many parameterizations of the same general

Re: [R] when all I have is a contingency table....

2010-07-07 Thread Derek Ogle
A.Z., You could recreate the data (I assumed that the values are discrete integers and not a bin for a continuous variable) ... value <- 1:6 count <- c(10,8,12,9,14,7) d <- rep(value,count) table(d) ... and then do what you want with the data in the d vector ... summary(d) hist(d) > On 07-J

Re: [R] optim() not finding optimal values

2010-06-27 Thread Derek Ogle
11:52 PM > To: Ravi Varadhan > Cc: Derek Ogle; R (r-help@R-project.org) > Subject: Re: [R] optim() not finding optimal values > > A slightly better scaling is the following: > > par.scale <- c(1.e06, 1.e06, 1.e-05, 1) # "q" is scaled differently > > >

[R] optim() not finding optimal values

2010-06-26 Thread Derek Ogle
I am trying to use optim() to minimize a sum-of-squared deviations function based upon four parameters. The basic function is defined as ... SPsse <- function(par,B,CPE,SSE.only=TRUE) { n <- length(B) # get number of years of data B0 <- par["B0"]

Re: [R] piecewise nls?

2010-04-18 Thread Derek Ogle
n Ritz [mailto:r...@life.ku.dk] > Sent: Saturday, April 17, 2010 2:45 PM > To: Derek Ogle > Cc: r-help@r-project.org > Subject: Re: [R] piecewise nls? > > Hi Derek, > > have a look at the following made-up example: > > f1 <- function(x){2*x} > f2 <- function(x

[R] piecewise nls?

2010-04-16 Thread Derek Ogle
I am looking into fitting a so-called double von Bertalanffy function to fish length-at-age data. Attempting to simplify the situation, the model looks like this ... Y ~ f(X; a,b,c) if x < Z Y ~ g(X; a,d,e) if x >= Z where * f and g are non-linear functions (the "traditional" "single" von Be

[R] Suppress getOptions() in Stangle

2010-01-06 Thread Derek Ogle
Hello, I am creating PDF handouts using Sweave for a beginner's R workshop. I want to include the R code for the handout in an appendix as described (using the listings LaTeX package) as described in ... http://n4.nabble.com/including-Sweave-tangled-code-in-Rnw-document-tp875112p875112.html W

[R] Citing R/Packages Question

2009-05-08 Thread Derek Ogle
I used R and the quantreg package in a manuscript that is currently in the proofs stage. I cited both R and quantreg as suggested by citation() and noted the version of R and quantreg that I used in the main text as "All tests were computed with the R v2.9.0 statistical programming language

[R] RweaveHTML (R2HTML) Help

2009-04-28 Thread Derek Ogle
I have found Sweave() to be great for producing PDF documents. I have been experimenting with RweaveHTML (from the R2HTML) package and have had moderate success. My main issue has been that I simply want the R output to be shown verbatim in the HTML document but RweaveHTML tends to convert most o

Re: [R] Buglet in plotCI

2009-04-20 Thread Derek Ogle
Jim and Dieter, Thank you for the quick reply and precise fix. My plot now works as expected. Thanks again. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Jim Lemon > Sent: Monday, April 20, 2009 4:21 AM > To: dieter.me..

[R] plotCI (plotrix) problem

2009-04-19 Thread Derek Ogle
I am attempting to create a plot with intervals "stretched" in the x-direction using plotCI() in the plotrix package. The same data provides an appropriate set of intervals when "stretched" in the y-direction but I only get a lower interval when "stretched" in the x-direction. The data are as

[R] help with formula and data= argument

2009-04-04 Thread Derek Ogle
Sorry for posting this twice, but I still have not solved this problem and am hoping for some assistance. I am attempting to write a function that is flexible enough to respond to the user providing a formula (with a data= argument) or not (similar to plot(x,y) versus plot(y~x,data=data)). I h

Re: [R] Table Modification

2009-01-23 Thread Derek Ogle
and accurate answer. -Original Message- From: r...@quantide.com [mailto:r...@quantide.com] Sent: Friday, January 23, 2009 9:25 AM To: Derek Ogle Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] Table Modification If I understood propelly > tapply(fact3, list(fact1, fact2) , pa

[R] Table Modification

2009-01-23 Thread Derek Ogle
I am trying to construct a two-way table where, instead of printing the two-way frequencies in the table, I would like to print the values of a third variable that correspond to the frequencies. For example, the following is easily constructed in R > fact1 <- factor(sample(LETTERS[1:3],10,r

Re: [R] Help with shading a polygon below a segment of a curve (normaldistribution)

2008-08-28 Thread Derek Ogle
Bertolt, The points you send to polygon() do not fully enclose the area you desire. Try adding one more point as such xt <- c(x[(length(x)-cutpoint):length(x)],linepos) yt <- c(y[(length(y)-cutpoint):length(y)],0) polygon(xt, yt, density = 10 ) -Original Message- From: [EMAIL PROTECTE

[R] R-Forge vs. RForge

2008-04-22 Thread Derek Ogle
I have two packages that I use locally and have been curious about moving them to "R Forge" to take advantage of SVN, builds, etc. In looking into this I stumbled across two different sites. The apparent official "R Forge" site at http://r-forge.r-project.org/ and a seemingly "unofficial" sit

[R] Distribution Graph Idea/Help

2008-04-18 Thread Derek Ogle
For pedagogical reasons (i.e., moving a way from tables of distributions) I want to plot a probability density or distribution function with a shaded area corresponding to the calculated value or user input. For example, I want a plot to visually demonstrate the result of pnorm(1.3) I have

[R] NLS -- multiplicative errors and group comparison

2008-02-26 Thread Derek Ogle
Hello, I am attempting to fit a non-linear model (Von Bertalanffy growth model) to fish length-at-age data with the purpose of determining if any of the three parameters differ between male and female fish. I believe that I can successfully accomplish this goal assuming an additive error struc

[R] seq() question

2007-09-28 Thread Derek Ogle
Hello all, I am attempting to use the seq() function to define breaks for the cut() function but am finding performance that I do not understand. The root of my problem appears to be contained in the following simple example. > brks <- seq(0.8,1.2,0.1) > brks [1] 0.8 0.9 1.0 1.1 1.2 > brks==1.