[ESS] Roxygen Update is "off by one" in function

2019-02-05 Thread Paul Johnson via ESS-help
confidence interval bound ##' @param arrow.width Arrowhead length must be specified in inches. See ?arrows ##' @param width Thickness of shaded column ##' @param col Color for a bar ##' @param opacity 120 is default, that's partial see through. ##' @return NONE ##' @export ##' @author Paul Johnson

Re: [ESS] Run roxygen examples: how now?

2019-02-04 Thread Paul Johnson via ESS-help
On Mon, Feb 4, 2019 at 9:22 AM Alex Branham wrote: > > > In my init file I have S-RET as the replacement for C-RET, but I've > tested > > this both ways and get same behavior. After removing the init file, > when I > > do C-RET, then the one line I'm on will run, but the focus jumps over the >

Re: [ESS] Run roxygen examples: how now?

2019-02-04 Thread Paul Johnson via ESS-help
On Wed, Jan 30, 2019 at 4:37 PM Alex Branham wrote: > > On Wed 30 Jan 2019 at 12:34, Paul Johnson via ESS-help < > ess-help@r-project.org> wrote: > > > In functions with roxygen examples, until very recently I could run the > > examples even thoug

[ESS] Run roxygen examples: how now?

2019-01-30 Thread Paul Johnson via ESS-help
In functions with roxygen examples, until very recently I could run the examples even though they had the roxygen comment "##'" at the beginning. Emacs/ESS would, literally, let me do "next" over and over again to run example code. Today I realize that does not happen anymore, Emacs/ESS is

[R] lm equivalent of Welch-corrected t-test?

2018-11-13 Thread Paul Johnson
Long ago, when R's t.test had var.equal=TRUE by default, I wrote some class notes showing that the result was equivalent to a one predictor regression model. Because t.test does not default to var.equal=TRUE these days, I'm curious to know if there is a way to specify weights in an lm to obtain

Re: [ESS] re-mapping C-RET in 18.10, avoiding conflict with CUA mode

2018-10-25 Thread Paul Johnson via ESS-help
till discussing the change. For now > just replace "ess-mode" with "ess" and it should be fine. The change to > *-visibility-* is needed. > > In the future release both ess-mode and ess will work. > > > Vitalie > > >> On Wed, Oct 24 2018 14

[ESS] re-mapping C-RET in 18.10, avoiding conflict with CUA mode

2018-10-24 Thread Paul Johnson via ESS-help
I'm running Ubuntu-18.10 and the new packaging for elpa-ess provides ESS 18.10. I still like CUA mode rectangles and so I want to remap C-RET to S-RET. 5 years ago Vitalie S told me how to do that. The stanza in init.el was: ;; Change shortcut "run this line" to use Shift-Return ;; Suggested by

Re: [R] ANOVA in R

2018-10-10 Thread Paul Johnson
t post hoc comparisons. In car package, Anova function will help. I may teach Anova soon, we'll see if I have better answer then. Paul Johnson University of Kansas On Wed, Oct 10, 2018, 1:14 AM Thanh Tran wrote: > Hi eveyone, > I'm studying about variance (ANOVA) in R and have some questio

Re: [R] Problems to obtain standardized betas in multiply-imputed data

2018-10-05 Thread Paul Johnson
lm.beta, it actually standardizes variables and runs regression. lm.beta resales coefficients instead. Paul Johnson University of Kansas On Wed, Sep 26, 2018, 5:03 AM CHATTON Anne via R-help wrote: > Dear all, > > I am having problems in obtaining standardized betas on a multiply-imput

[R] looking for formula parser that allows coefficients

2018-08-21 Thread Paul Johnson
Can you point me at any packages that allow users to write a formula with coefficients? I want to write a data simulator that has a matrix X with lots of columns, and then users can generate predictive models by entering a formula that uses some of the variables, allowing interactions, like y ~

Re: [R] Transforming data for nice output table

2018-08-21 Thread Paul Johnson
On Mon, Aug 20, 2018 at 2:17 PM David Doyle wrote: > > Hello everyone, > > I'm trying to generate tables of my data out of R for my report. > > My data is setup in the format as follows and the example can be found at: > http://doylesdartden.com/R/ExampleData.csv > > LocationDate

Re: [ESS] polymode indents everything when editing Rmd file?

2018-02-06 Thread Paul Johnson
t a polymode problem. I just don't like markdown-mode so much. If anybody has tips for working with Rmd files, I'm all ears at this point. Best pj > Best, > Ista > > On Tue, Feb 6, 2018 at 11:24 AM, Paul Johnson <pauljoh...@gmail.com> wrote: >> I wonder if I've got polymod

[ESS] polymode indents everything when editing Rmd file?

2018-02-06 Thread Paul Johnson
I wonder if I've got polymode set up correctly. I have Ubuntu 17.10 Emacs 25.2 Ess 17.11, it works well to edit R files. Today I installed polymode from melpa, When I open an Rmd file, I can visually see a difference. The code chunks are likely shaded areas. Also, some keywords within the R

Re: [ESS] [R] M-x R gives no choice of starting dir

2017-12-13 Thread Paul Johnson
If Emacs is not asking for starting directory, it is very likely your init file has this somewhere: (setq ess-ask-for-ess-directory nil) On Mon, Sep 11, 2017 at 3:23 PM, Enrico Schumann wrote: > On Mon, 11 Sep 2017, Christian writes: > >> Hi, >> >> I experienced a

Re: [R] [ESS] M-x R gives no choice of starting dir

2017-12-13 Thread Paul Johnson
If Emacs is not asking for starting directory, it is very likely your init file has this somewhere: (setq ess-ask-for-ess-directory nil) On Mon, Sep 11, 2017 at 3:23 PM, Enrico Schumann wrote: > On Mon, 11 Sep 2017, Christian writes: > >> Hi, >> >> I experienced a

Re: [ESS] starting directory not detected correctly anymore

2017-12-04 Thread Paul Johnson
sets the default >> directory to the package directory. It looks like it treats your tmp >> directory >> as a package. @Lionel? >> >> Vitalie >> >>>> On Thu, Nov 30 2017 18:59, Paul Johnson wrote: >> >>> Greetings. >> >>> I

[ESS] starting directory not detected correctly anymore

2017-11-30 Thread Paul Johnson
Greetings. I want to have ESS know the working directory from shell pwd, I don't want it to ask me. I have a setting in my init.el that used to work that way: ;; start R in current working directory, don't let R ask user: (setq ess-ask-for-ess-directory nil) Recently, it has stopped working.

[R] function pointers?

2017-11-22 Thread Paul Johnson
We have a project that calls for the creation of a list of many distribution objects. Distributions can be of various types, with various parameters, but we ran into some problems. I started testing on a simple list of rnorm-based objects. I was a little surprised at the RAM storage

Re: [R] Install package "diagram"

2017-08-17 Thread Paul Johnson
On Wednesday, August 16, 2017, AbouEl-Makarim Aboueissa < abouelmakarim1...@gmail.com> wrote: > Dear All: > > I am trying to install the package "diagram". It is in the list. But when I > selected the package to install it, it says: > > Question: "would you like to use a personal library

[R] workaround for "package building problem Centos 7 & R 3.4.1"

2017-08-14 Thread Paul Johnson
This is for the problem I posted about last Friday. First, the happy part, a workaround: $ cd ~/R/x86_64-redhat-linux-gnu-library/3.4 $ ln -sf /usr/share/R/library/* . After that, all of the packages are found by R CMD check. R CMD check looks in the ~/R/x86_64-redhat-linux-gnu-library/3.4

Re: [R] Plotting log transformed predicted values from lme

2017-08-12 Thread Paul Johnson
In the rockchalk package, I have a function called newdata that will help with this. Plenty of examples. Probably my predictOmatic function will just work. Motivation is in the vignette. Paul Johnson University of Kansas On Aug 9, 2017 11:23 AM, "Alina Vodonos Zilberg" <alina.vodo

Re: [R] package building problem Centos 7 & R 3.4.1

2017-08-12 Thread Paul Johnson
On Aug 12, 2017 11:58 AM, "José Abílio Matos" <jaoma...@gmail.com> wrote: On Friday, 11 August 2017 22.51.12 WEST Paul Johnson wrote: > Dear everybody: > > Packages that DO pass the package check on my Ubuntu 17.04 laptop with > R 3.4.1 and Mac OSX do not build o

[R] package building problem Centos 7 & R 3.4.1

2017-08-11 Thread Paul Johnson
Dear everybody: Packages that DO pass the package check on my Ubuntu 17.04 laptop with R 3.4.1 and Mac OSX do not build on Centos 7 with R 3.4.1. I'm pretty sure I have an environment defect, but cannot find it. I find posts from various people about this problem since 2012. But I've checked

[ESS] working directory lost when R session closes

2017-07-14 Thread Paul Johnson
Do you notice this: cd into a folder, say "~/tmp/project/R" and start emacs with a file in there. The working directory correctly shows "~/tmp/project/R". Then launch an R session. When you quit the R session, and start a new R session, the working directory changed, it becomes "~/tmp/project".

Re: [ESS] Ever consider changing indentation on #?

2017-05-04 Thread Paul Johnson
of the markdown-style commentary? > > Here is an R file that has "Rstudio sections" that begin with #. I just tested with their gui and the magic recipe for howto is written below. It is something like Emacs org mode, I suppose. Code folding. This is an example of a file that

Re: [R] Interesting quirk with fractions and rounding

2017-04-22 Thread Paul Johnson
rt is right. I have to read more books. I studied Golub and van Loan and came away with healthy fear of matrix inversion. But when you look at user contributed regression packages, what do you find? Matrix inversion and lots of X'X. Paul Johnson University of Kansask The key (in your example)

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread Paul Johnson
ting floats. I wonder now if all uses of > or < with numeric variables are suspect. Oh well. If everybody posts their advice, I will write a summary. Paul Johnson University of Kansas On Apr 21, 2017 12:02 AM, "PIKAL Petr" <petr.pi...@precheza.cz> wrote: > Hi &g

Re: [R] Peformance question

2017-04-21 Thread Paul Johnson
I dont understand your code. But I do have suggestion. Run the functions in the profiler, maybe differences will point at the enemy. Know what I mean? Rprof('check.out') #run code Rprof(NULL) summaryRprof('check.out') Do that for each method. That may be uninformative. I wondered if you tried

Re: [R] Prediction plots

2017-04-21 Thread Paul Johnson
I have done this a lot. Would you mind installing my pkg rockchalk and then run example(plotSlope) and example(plotCurve)? If the output is close to what you want, you can adjust my code. The vignette explains. 1. Create newdata object 2. Run that through predict 3. Make plot None of this is

[R] Interesting quirk with fractions and rounding

2017-04-20 Thread Paul Johnson
Hello, R friends My student unearthed this quirk that might interest you. I wondered if this might be a bug in the R interpreter. If not a bug, it certainly stands as a good example of the dangers of floating point numbers in computing. What do you think? > 100*(23/40) [1] 57.5 > (100*23)/40

[R] xvfb? cron job updates R packages, fails on some requiring X11

2017-01-19 Thread Paul Johnson
In Centos 7 systems, I wrote a script that runs on the cron and I notice some package updates and installs fail like this: Error : .onLoad failed in loadNamespace() for 'iplots', details: call: .jnew("org/rosuda/iplots/Framework") error: java.awt.HeadlessException: No X11 DISPLAY variable

Re: [ESS] how to edit openbugs model file?

2016-12-05 Thread Paul Johnson
Thanks, everybody. I'm taking the suggestion Martin offered, since this thing is required to be named *.txt in the current OpenBUGS. Solution Put this at the end of the *.txt file: # Local Variables: # mode: R # End: That works. This question was raised by an interesting problem. This might

Re: [R] Error installing packages

2016-10-20 Thread Paul Johnson
On Wed, Oct 19, 2016 at 10:31 AM, David Winsemius wrote: > >> On Oct 19, 2016, at 4:54 AM, Kevin E. Thorpe >> wrote: >> >> Hello. >> >> I am posting this on behalf of one of my students who is getting error >> messages when installing some

[R] Ask if an object will respond to a function or method

2016-03-31 Thread Paul Johnson
In the rockchalk package, I want to provide functions for regression objects that are "well behaved." If an object responds to the methods that lm or glm objects can handle, like coef(), nobs(), and summary(), I want to be able to handle the same thing. It is more difficult than expected to ask a

[R] premature evaluation of symbols. Is that the way to describe this problem?

2014-04-10 Thread Paul Johnson
words here. I've built a toy example that will illustrate the problem, you tell me the words for it. ## Paul Johnson 2014-04-10 dat - data.frame(x = rnorm(50),y = rnorm(50)) m1 - lm(y ~ x, dat) myRegFit - function(model, nd) predict(model, nd) mySpecialFeature - function(model, ci){ pargs

[R] [R-pkgs] update: rockchalk 1.8.0

2013-07-30 Thread Paul Johnson
This will appear on CRAN mirrors soon. It's my update for Spring, 2013. I keep track of R problems that arise in the regression course and try to facilitate them. There are functions for describing data, presenting regression plots and tables, some regression diagnostics. Most of the usages are

Re: [R] 2SLS / TSLS / SEM non-linear

2013-06-29 Thread Paul Johnson
Please consider using the R package systemfit. It has existed for about 10 years, I've used it many times happily :) I've not used gmm package, I'm not criticizing it. But I have good results from systemfit. It has good documentation. This package contains functions for fitting simultaneous

[R] Windows R_LIBS_USER confusion under R-3.0.1

2013-06-12 Thread Paul Johnson
I would appreciate ideas about MS Windows install issues. I'm at our stats summer camp and have been looking at a lot of Windows R installs and there are some wrinkles about R_LIBS_USER. On a clean Win7 or Win8 system, with R-3.0.1, we see the user library for packages defaulting to

Re: [R] recode: how to avoid nested ifelse

2013-06-10 Thread Paul Johnson
(factor(x, levels = c(000, 100, 110, 111), labels = c(none, es,hs, cg))) none es hs cg 4112 Cheers, Josh *Drawn from comments by Judea Pearl one lively session. On Fri, Jun 7, 2013 at 6:13 PM, Paul Johnson pauljoh...@gmail.com wrote: In our

[R] recode: how to avoid nested ifelse

2013-06-07 Thread Paul Johnson
this if the example became any more complicated. I'm unable to remember a less error prone method :). But I expect you might. Here's my working example code ## Paul Johnson pauljohn at ku.edu ## 2013-06-07 ## We need to create an ordinal factor from these indicators ## completed elementary school es - c(0

Re: [R] inverse for formula transformations on LHS

2013-05-21 Thread Paul Johnson
On Sat, May 18, 2013 at 7:05 AM, Stephen Milborrow mi...@sonic.net wrote: Paul Johnson pauljoh...@gmail.com wrote: m1 - lm(log(y) ~ log(x), data = dat) termplot shows log(y) on the vertical. What if I want y on the vertical? plotmo in the plotmo package has an inverse.func argument, so

[R] inverse for formula transformations on LHS

2013-05-17 Thread Paul Johnson
This is an R formula handling question. It arose in class. We were working on the Animals data in the MASS package. In order to see a relationship, you need to log brain and body weight. It's a fun one for teaching regression, if you did not try it yet. There are outliers too! Students wanted

[R] Automatic way to embed fonts into all pdf output?

2013-05-10 Thread Paul Johnson
This is a feature request. Or else a howto request. Can there be some simple, automatic way to make fonts embed into pdf output? Could this be in options() or par()? Why? I recently wanted to create a paper for a conference in a format called AAAI (which I had never heard of before because I

Re: [R] R installation error

2013-05-10 Thread Paul Johnson
Meenu: You have an elementary Linux setup and configuration problem to understand first, before you worry about configuring and compiling your own R. I agree strongly that this is something that all linux users should learn to do, but compiling R itself is like climbing Mt Everest as your first

[R] Trouble with methods() after loading gdata package.

2013-04-30 Thread Paul Johnson
Greetings to r-help land. I've run into some program crashes and I've traced them back to methods() behavior after the package gdata is loaded. I provide now a minimal re-producible example. This seems bugish to me. How about you? dat - data.frame(x = rnorm(100), y = rnorm(100)) lm1 - lm(y ~ x,

Re: [R] significantly different from one (not zero) using lm

2013-04-30 Thread Paul Johnson
It is easy to construct your own test. I test against null of 0 first so I can be sure I match the right result from summary.lm. ## get the standard error seofb - sqrt(diag(vcov(lm1))) ## calculate t. Replace 0 by your null myt - (coef(lm1) - 0)/seofb mypval - 2*pt(abs(myt), lower.tail = FALSE,

Re: [R] pglm package: fitted values and residuals

2013-04-25 Thread Paul Johnson
On Wed, Apr 24, 2013 at 4:37 PM, Achim Zeileis achim.zeil...@uibk.ac.at wrote: On Wed, 24 Apr 2013, Paul Johnson wrote: On Wed, Apr 24, 2013 at 3:11 AM, alfonso.carf...@uniparthenope.it wrote: I'm using the package pglm and I'have estimated a random probit model. I need to save in a vector

Re: [R] pglm package: fitted values and residuals

2013-04-24 Thread Paul Johnson
On Wed, Apr 24, 2013 at 3:11 AM, alfonso.carf...@uniparthenope.it wrote: I'm using the package pglm and I'have estimated a random probit model. I need to save in a vector the fitted values and the residuals of the model but I can not do it. I tried with the command fitted.values using the

[R] Needed: Beta Testers and Summer Camp Students

2013-04-23 Thread Paul Johnson
Greetings. I'm teaching linear regression this semester and that means I write more functions for my regression support package rockchalk. I'm at a point now were some fresh eyes would help, so if you are a student in a course on regression, please consider looking over my package overview

Re: [R] Make barplot with error bars, anova out of a table

2013-04-11 Thread Paul Johnson
Hi On Thu, Apr 11, 2013 at 6:43 AM, Simza alex_steckba...@gmx.at wrote: Helo everybody, I'm new to R and have some issues with my data in R. My raw data look like that: ID Day size 1 1 7 1 1 7.2 1 1 7.1 2 1 7.3 2 1 7.4 2 1 7.2 3 1 7 3 1 7.1 3 1 7.5 4 1 7.3 4 1 7.2 4 1 7.6 1 2 7 1 2 7.2 1 2

Re: [R] Superscript

2013-04-04 Thread Paul Johnson
On Thu, Apr 4, 2013 at 4:39 AM, Shane Carey careys...@gmail.com wrote: Hi William, for (i in one:length(DATA_names)) if ((grepl(_,DATA_names[i]))==TRUE) DATA_names[i]-f(DATA_names[i])) I keep getting an error saying: incompatible types (from symbol to character) in subassignment

Re: [R] DUD (Does not Use Derivatives) for nonlinear regression in R?

2013-04-02 Thread Paul Johnson
On Apr 1, 2013 1:10 AM, qi A send2...@gmail.com wrote: Hi, All SAS has DUD (Does not Use Derivatives)/Secant Method for nonlinear regression, does R offer this option for nonlinear regression? I have read the helpfile for nls() and could not find such option, any suggestion? nelder-mead

[R] example to demonstrate benefits of poly in regression?

2013-04-01 Thread Paul Johnson
Here's my little discussion example for a quadratic regression: http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R Students press me to know the benefits of poly() over the more obvious regression formulas. I think I understand the theory on why poly() should be more

Re: [R] example to demonstrate benefits of poly in regression?

2013-04-01 Thread Paul Johnson
On Mon, Apr 1, 2013 at 12:42 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Mon, Apr 1, 2013 at 1:20 PM, Paul Johnson pauljoh...@gmail.com wrote: Here's my little discussion example for a quadratic regression: http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R

[R] good documentation on use of Rscript. where to find?

2012-10-18 Thread Paul Johnson
What is the correct format for the shebang line and what options are allowed or necessary along with this? I find plenty of blogs and opinions, but few authoritative answers. I want an R script to run and update packages periodically, with a cron job that launches it. What is necessary to put in

[R] shade overlapping portions of circles (or other shapes)

2012-08-15 Thread Paul Johnson
I'm making some illustrations and it would be convenient to automatically shade the overlapping portions of circles. These illustrations are for Social Choice theory, a field in political science and economics. I've wrestled together some examples so you can see what I mean, but have not

[R] device mismatch, coordinates trouble with X11 and pdf devices

2012-08-10 Thread Paul Johnson
packages: [1] stats graphics grDevices utils datasets methods base ## Paul Johnson paulj...@ku.edu ## 2012-08-10 ## ## I've got trouble with a mis-match between screen and pdf devices. ## Please run this and tell me if the point z's marker is on the ## intersection of the 2 circles for you

Re: [R] complexity of operations in R

2012-07-19 Thread Paul Johnson
On Thu, Jul 19, 2012 at 11:11 AM, Bert Gunter gunter.ber...@gene.com wrote: Hadley et. al: Indeed. And using a loop is a poor way to do it anyway. v - as.list(rep(FALSE,dotot)) is way faster. -- Bert Its not entirely clear to me what we are supposed to conclude about this. I can

Re: [R] EM algorithm to find MLE of coeff in mixed effects model

2012-07-03 Thread Paul Johnson
On Tue, Jul 3, 2012 at 12:41 PM, jimmycloud jimmycl...@gmail.com wrote: I have a general question about coefficients estimation of the mixed model. I have 2 ideas for you. 1. Fit with lme4 package, using the lmer function. That's what it is for. 2. If you really want to write your own EM

[R] non ascill characters in plots. no alternative but plotmath?

2012-06-06 Thread Paul Johnson
A student entered some data with text characters like epsilon and alpha. On her Windows system, the Greek letters did not display properly in a plot. There were some ordinary ASCII instead. I asked her to send me the code so I could test. For me, the plot looks ok on the screen. Format1 -

[R] memory usage benefit from anonymous variable constructions.

2012-06-03 Thread Paul Johnson
This is an I was just wondering question. When the package dataframe was announced, the author claimed to reduce the number of times a data frame was copied, I started to wonder if I should care about this in my projects. Has anybody written a general guide for how to write R code that doesn't

Re: [R] Partial R-square in multiple linear regression

2012-06-03 Thread Paul Johnson
On Fri, Jun 1, 2012 at 2:05 PM, Jin Choi oohps...@gmail.com wrote: Hello, I am trying to obtain the partial r-square values (r^2 or R2) for individual predictors of an outcome variable in multiple linear regression. I am using the 'lm' function to calculate the beta coefficients, however, I

[R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread Paul Johnson
Greetings I want to take a fitted regression and replace all uses of a variable in a formula. For example, I'd like to take m1 - lm(y ~ x1, data=dat) and replace x1 with something else, say x1c, so the formula would become m1 - lm(y ~ x1c, data=dat) I have working code to finish that part of

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread Paul Johnson
Try substitute: do.call(substitute, list(newFmla, setNames(list(as.name(x1c)), x1))) y ~ log(x1c) + x2 * x3 Damn. That's pretty. I'd say setNames a magic bullet too. Thanks very much. The approach suggested by Michael and Bert has the little shortcoming that grepping for x1 also picks up

[R] Build error on RedHat EL 5.5: byte-compiling package 'compiler'

2012-05-22 Thread Paul Johnson
Greetings R-help! In case anybody has worked on an old Redhat system lately, can you remember what is the cause of this problem? I don't think this is a fatal problem, because I can get around it by uninstalling all of the R RPM packages and re-running the build. But if R is installed, the build

Re: [R] R Memory Issues

2012-05-22 Thread Paul Johnson
Dear Emiliano: When they say to read the posting guide, mostly they mean read the posting guide. But I'll tell you the short version. 1. Include a full runable R program that causes the trouble you are concerned about. Include the data or a link to the data, usually the smallest possible

Re: [R] Names of Greek letters stored as character strings; plotmath.

2012-05-19 Thread Paul Johnson
On Sat, May 19, 2012 at 11:07 AM, William Dunlap wdun...@tibco.com wrote: parse(text=paste(...)) works in simple cases but not in others.  The fortune about it is there because it is tempting to use but if you bury it in a general purpose function it will cause problems when people start using

[R] Windows Task Scheduler and R updates. Need basic tips

2012-05-17 Thread Paul Johnson
This is a basic Windows system administrator problem, asked by a Linux guy who is helping out in a Windows lab. I want to keep R packages up to date on MS Windows 7 with a job in the Task Scheduler. I have an R program that I can run (as administrator) that updates the existing packages and then

Re: [R] glmmADMB

2012-05-09 Thread Paul Johnson
On Tue, May 8, 2012 at 9:06 PM, rbuxton moy...@hotmail.com wrote: Update! I changed the site categories. I noticed that I had coded them as North, South, East, West on different islands, which may have caused confusion in the model. [...] mod - glmmadmb(LESP.CHUCKLE~ 1+(1|ISLAND),

[R] what folder to run write_PACKAGES in?

2012-05-08 Thread Paul Johnson
I set up a local repo for testing packages. My packages are not showing up from the repository when viewed by Linux clients. I suspect this is a web administrator/firewall issue, but it could be I created the repo wrongly. I am supposed to run write_PACKAGES separately in each R-version folder.

Re: [R] glmmADMB

2012-05-08 Thread Paul Johnson
On Tue, May 8, 2012 at 5:16 PM, rbuxton moy...@hotmail.com wrote: http://r.789695.n4.nabble.com/file/n4618871/Data_for_list_serve.csv Data_for_list_serve.csv Here is my data, hope this helps. The LESP CHUCKLE , FTSP FLIGHT, and ANMU CHIRRUP are the dependent variables, I want to run one

Re: [R] low R square value from ANCOVA model

2012-05-08 Thread Paul Johnson
On Tue, May 8, 2012 at 3:45 PM, array chip arrayprof...@yahoo.com wrote: Thanks again Peter. What about the argument that because low R square (e.g. R^2=0.2) indicated the model variance was not sufficiently explained by the factors in the model, there might be additional factors that should

[R] predictOMatic for regression. Please try and advise me

2012-04-20 Thread Paul Johnson
and let me know how its use could be enhanced, or what other features you might want. I know folks are busy, so to save you the trouble of actually running the code, I also paste in a session demonstrating one run through. Here's the code: ##Paul Johnson ## 2012-04-20 ## Facilitate creation

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-20 Thread Paul Johnson
On Fri, Apr 20, 2012 at 2:18 PM, Jonathan Greenberg j...@illinois.edu wrote: Ok, I figured out a solution and I'd like to get some feedback on this from the R-helpers as to how I could modify the following to be package friendly -- the main thing I'm worried about is how to dynamically set the

[R] [R-pkgs] rockchalk_1.5.4 posted

2012-04-10 Thread Paul Johnson
Greetings: rockchalk is a collection of functions to facilitate presentation of regression models. It includes some functions that I have been circulating for quite some time (such as outreg) as well as several others. The main aim is to allow people who do not understand very much R to survive

Re: [R] simulate an gradually increase of the number of subjects based on two variables

2012-03-13 Thread Paul Johnson
Suggestion below: On Tue, Mar 13, 2012 at 1:24 PM, guillaume chaumet guillaumechau...@gmail.com wrote: I omit to precise that I already try to generate data based on the mean and sd of two variables. x=rnorm(20,1,5)+1:20 y=rnorm(20,1,7)+41:60 simu-function(x,y,n) {    

Re: [R] beginner's loop issue

2012-03-13 Thread Paul Johnson
On Tue, Mar 13, 2012 at 11:27 AM, aledanda danda.ga...@gmail.com wrote: Dear All, I hope you don't mind helping me with this small issue. I haven't been using R in years and I'm trying to fill in a matrix with the output of a function (I'm probably using the Matlab logic here and it's not

[R] multi-platform equivalent of x11() ?

2012-03-06 Thread Paul Johnson
I want to write an R help example that throws up 2 graphs in separate windows, for comparison. In Linux I plot one, then run x11() to spawn a new on-screen device. Is there some generic equivalent so I can write an example that will work for Windows and Mac users as well? If there is none,

Re: [R] question on model.matrix

2012-01-30 Thread Paul Johnson
Greetings On Sat, Jan 28, 2012 at 2:43 PM, Daniel Negusse daniel.negu...@my.mcphs.edu wrote: while reading some tutorials, i came across this and i am stuck. i want to understand it and would appreciate if anyone can tell me. design - model.matrix(~ -1+factor(c(1,1,2,2,3,3))) can

[R] replacing characters in matrix. substitute, delayedAssign, huh?

2012-01-30 Thread Paul Johnson
A user question today has me stumped. Can you advise me, please? User wants a matrix that has some numbers, some variables, possibly even some function names. So that has to be a character matrix. Consider: BM - matrix(0.1, 5, 5) Use data.entry(BM) or similar to set some to more abstract

Re: [R] replacing characters in matrix. substitute, delayedAssign, huh?

2012-01-30 Thread Paul Johnson
Henrik's proposal works well, so far. Thanks very much. I could not have figured that out (without much more suffering). Here's the working example in case future googlers find their way to this thread. ## Paul Johnson paulj...@ku.edu ## 2012-01-30 ## Special thanks to r-help email list

[R] fix and edit don't work: unable to open X Input Method-segfault

2012-01-08 Thread Paul Johnson
I can't run fix() or edit() anymore. Did I break my system? I'm running Debian Linux with R-2.14.1. As far as I can tell, the R packages came from Debian's testing wheezy repository. I would like to know if users on other types of systems see the same problem. If no, then, obviously, it is a

[R] How to properly re-set a saved seed? I've got the answer, but no explanation

2012-01-06 Thread Paul Johnson
L'Ecuyer streams. The puzzle is this comment in ?Random: ‘set.seed’ is the recommended way to specify seeds. What I did not understand before, and can't make sense of now, is that set.seed does not re-set a saved seed. Here's my working example: ## Paul Johnson ## April 20, 2011 ## If you've never

[R] 3d plotting alternatives. I like persp, but regret the lack of plotmath.

2011-12-29 Thread Paul Johnson
I have been making simple functions to display regressions in a new package called rockchalk. For 3d illustrations, my functions use persp, and I've grown to like working with it. As an example of the kind of things I like to do, you might consult my lecture on multicollinearity, which is by far

[R] pls help to print out first row of terms(model) output in example program

2011-12-19 Thread Paul Johnson
] log(10 + x1) poly(x2, 2) [snip] In my working example code below , I need the help where I have ##fix me fix me## ##Paul Johnson ## 2011-12-19 ## mcDiagnose.R lmAuxiliary - function(model){ dat - as.data.frame(model.matrix(model)) ## ivnames - attr(delete.response(terms(model)), term.labels

[R] fundamental guide to use of numerical optimizers?

2011-12-15 Thread Paul Johnson
I was in a presentation of optimizations fitted with both MPlus and SAS yesterday. In a batch of 1000 bootstrap samples, between 300 and 400 of the estimations did not converge. The authors spoke as if this were the ordinary cost of doing business, and pointed to some publications in which the

[R] how big (in RAM and/or disk storage) is each of these objects in a list?

2011-11-26 Thread Paul Johnson
Greetings, friends (and others :) ) We generated a bunch of results and saved them in an RData file. We can open, use, all is well, except that the size of the saved file is quite a bit larger than we expected. I suspect there's something floating about in there that one of the packages we are

Re: [R] Models with ordered and unordered factors

2011-11-15 Thread Paul Johnson
On Tue, Nov 15, 2011 at 9:00 AM, Catarina Miranda catarina.mira...@gmail.com wrote: Hello; I am having a problems with the interpretation of models using ordered or unordered predictors. I am running models in lmer but I will try to give a simplified example data set using lm. Both in the

Re: [R] Running a GMM Estimation on dynamic Panel Model using plm-Package

2011-10-05 Thread Paul Johnson
On Sun, Jun 12, 2011 at 2:43 PM, bstudent marc.ruet...@gmx.de wrote: Hello, although I searched for a solution related to my problem I didn´t find one, yet. My skills in R aren´t very large, however. For my Diploma thesis I need to run a GMM estimation on a dynamic panel model using the pgmm

Re: [R] Tinn-R

2011-10-05 Thread Paul Johnson
On Tue, Oct 4, 2011 at 1:25 PM, Charles McClure cmccl...@atrcorp.com wrote: I am new to R and have recently tried Tinn-R with very mixed and unexpected results.  Can you point me to a Tinn-R tutorial on the web or a decent reference book? In my experience, TINN-R does not work so well, and

Re: [R] Testing for arguments in a function

2011-09-30 Thread Paul Johnson
Just for the record, following Bill Dunlap's advice, I think this is the best answer to the question as originally posed is. myfun - function(vec, i=stop('i' must be supplied)){ vec[i] } myfun(1:40,10) [1] 10 myfun(1:10) Error in myfun(1:10) : 'i' must be supplied -- Paul E. Johnson

Re: [R] Testing for arguments in a function

2011-09-28 Thread Paul Johnson
On Mon, Sep 26, 2011 at 2:39 PM, Gene Leynes gley...@gmail.com wrote: I don't understand how this function can subset by i when i is missing ## My function: myfun = function(vec, i){    ret = vec[i]    ret } ## My data: i = 10 vec = 1:100 ## Expected input and behavior:

Re: [R] fit.mult.impute() in Hmisc

2011-08-13 Thread Paul Johnson
On Thu, Mar 31, 2011 at 2:56 PM, Yuelin Li li...@mskcc.org wrote: I tried multiple imputation with aregImpute() and fit.mult.impute() in Hmisc 3.8-3 (June 2010) and R-2.12.1. The warning message below suggests that summary(f) of fit.mult.impute() would only use the last imputed data set.

[R] seeking advice about rounding error and %%

2011-08-13 Thread Paul Johnson
A client came into our consulting center with some data that had been damaged by somebody who opened it in MS Excel. The columns were supposed to be integer valued, 0 through 5, but some of the values were mysteriously damaged. There were scores like 1.18329322 and such in there. Until he tracks

[R] Question re the plotrix package

2011-07-27 Thread Paul Johnson
Dear list, I am using the  clock24.plot command in this excellent package to plot animal activity data. Does anyone know if both symbols and a line can be plotted on the same plot to show both raw data (symbols) and a line (describing a statistical model of the pattern) ? Or if more than

Re: [R] graphics: 3D regression plane

2011-04-27 Thread Paul Johnson
Hi. Comments below On Wed, Apr 27, 2011 at 2:32 AM, agent dunham crossp...@hotmail.com wrote: Hi, thanks, I think I've changed the previous as you told me but I'm having this error, what does it mean? model- lm(log(v1)~log(v2)+v3, data=dat) newax- expand.grid(    v2 =

Re: [R] very basic HLM question

2011-02-05 Thread Paul Johnson
2011/2/5 Sebastián Daza sebastian.d...@gmail.com: Hi everyone, I need to get a between-component variance (e.g. random effects Anova), but using lmer I don't get the same results (variance component) than using random effects Anova. I am using a database of students, clustered on schools

Re: [R] different results in MASS's mca and SAS's corresp

2011-02-05 Thread Paul Johnson
On Sat, Feb 5, 2011 at 9:19 AM, David Winsemius dwinsem...@comcast.net wrote: On Feb 4, 2011, at 7:06 PM, Gong-Yi Liao wrote: Dear list:  I have tried MASS's mca function and SAS's PROC corresp on the  farms data (included in MASS, also used as mca's example), the  results are different:

Re: [R] boostrap an nls regression

2011-02-05 Thread Paul Johnson
Hello! On Thu, Feb 3, 2011 at 6:27 AM, m234 mhairialexan...@gmail.com wrote: II functional response for 2 data sets: nls(eaten~(a*suppl)/(1+a*h*suppl) where eaten is the number of prey eaten by a predator and suppl is the number of prey initially supplied to the same predator. I have

Re: [R] Problems with pdf device using plot glht function on multcomp library.

2010-09-18 Thread Paul Johnson
Hi, Kenneth It is not clear if you mean that your pdf output usually works, but it does not in this special case, or that this is a first effort with pdf. The answer might depend on which is the case case. If you are just getting started, can I refer you to some lecture notes I made about

  1   2   >