[R] Help with marmap package

2017-02-15 Thread Jake William Andrae
Hello, I'm using the 'Marmap' R package to create ocean bathymetry maps. I've managed quite well, but I'm having a little difficulty with setting my x-axis (longitude) limits. When I run the code, the map is projected with large white bands on either side of the desired longitude limits. I've

Re: [R] New R user- Simple optimization problem

2017-02-15 Thread Bert Gunter
Please cc the list. It's too much trouble for me, but maybe not for someone else. Bert On Feb 15, 2017 6:02 PM, "Brady Richter" wrote: > Bert, > > > > I’m 46- I don’t get homework. Just looking for a bit of help getting > started organizing the loop structure, but since it seems to be too much

Re: [R] New R user- Simple optimization problem

2017-02-15 Thread Bert Gunter
Homework? If so, we don't do hw here. Otherwise, we usually ask people to show us their failed coding efforts rather than expecting us to do the problem for them. Please read and follow the posting guide. Cheers, Bert On Feb 15, 2017 10:25 AM, "Brady Richter" wrote: Hi I am learning R curren

[R] Validating Minitab's "Expanded Gage R&R Study" using R and lme4

2017-02-15 Thread Matt Jacob
I'm trying to validate the results of an "Expanded Gage R&R Study" in Minitab using R and lme4, but I can't get the numbers to match up in certain situations. I can't tell whether my model is wrong, my data is bad, or something else is going on. For instance, here's some data for which the results

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-15 Thread Hervé Pagès
You could also call this "interesting example" a bug. Clearly not enough code reuse in the implementation of tapply(). Instead of the current 25 lines of code, it could be a simple wrapper around split() and sapply() e.g.. something like: tapply2 <- function(X, INDEX, FUN=NULL, ..., simplify=T

Re: [R] non-linear optimisation ODE models

2017-02-15 Thread Jim Lemon
Hi Malgorzata, The function "rxnrate" seems to want three values in a list with the names "k1", "k2" and "k3". If you are passing something with different names, it is probably going to complain, so the names "A", "B" and "C" may be your problem. I can't run the example, so this is a guess. Jim

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-15 Thread Hadley Wickham
It seems like this should be consistent with split(), since that's what actually powers the behaviour. Reading the description for split leads to this rather interesting example: tapply(mtcars, 1:11, I) Hadley On Tue, Feb 14, 2017 at 7:10 PM, Hervé Pagès wrote: > Hi, > > tapply() will work on

[R] New R user- Simple optimization problem

2017-02-15 Thread Brady Richter
Hi I am learning R currently and I having trouble structuring a program. Data consists of 1 data frame with a day of the week, a class list, and a utility score. Date Class Utility Monday Chem 85 Monday Phys

Re: [R] Works outside but not inside!

2017-02-15 Thread Sarah Goslee
Well, what happens? "Doesn't work" covers a lot of ground, and you don't provide a reproducible example. Also, why all the > at the beginning PDF lines? Your R prompts shouldn't look like that when entering a function, and they make it impossible to just cut and paste the code. Not that we have an

[R] Works outside but not inside!

2017-02-15 Thread Keith S Weintraub
Folks, The following function works like a charm! > #Amortization for multiple rows > createAmorts<-function(ams, numPer, term) { > fctrs<-rep(1:term, each = numPer) > > oneRow<-function(am, fac){ > tdf<-data.frame(ams = c(am), yrs=fac) > agg<-aggregate(ams ~ yrs, data

Re: [R] non-linear optimisation ODE models

2017-02-15 Thread Berend Hasselman
> On 15 Feb 2017, at 11:32, Malgorzata Wieteska via R-help > wrote: > > Hello, > I'm new to R, so sorry for this question. I found a piece of code on stack > overflow community, title: r-parameter and initial conditions fitting ODE > models with nls.lm. > I've tried to implement a change sugg

[R] non-linear optimisation ODE models

2017-02-15 Thread Malgorzata Wieteska via R-help
Hello, I'm new to R, so sorry for this question. I found a piece of code on stack overflow community, title: r-parameter and initial conditions fitting ODE models with nls.lm. I've tried to implement a change suggested, but I get an error: Error in unname(myparms[4], B = 0, C = 0) :   unused arg

Re: [R] Create gif from series of png files

2017-02-15 Thread Shane Carey
For those interested, I figured out a way using "convert" on the linux command line. Thanks On Tue, Feb 14, 2017 at 6:02 PM, Bert Gunter wrote: > Ulrik: > > Sheepishly Nitpicking (only because you are a regular and wise R-help > contibutor): > > gganimate is not a library, it's a package. > > N

Re: [R] coeftest() R squared

2017-02-15 Thread Achim Zeileis
On Wed, 15 Feb 2017, T.Riedle wrote: Dear all, I want to run a regression using lm() with Newey West corrected standard errors. This is the code Reg<-lm(g~sent + liquidity + Cape, data=dataUsa) CoefNW<-coeftest(Reg, vcov.=NeweyWest) CoefNW In contrast to summary(Reg) the output of CoefNW nei