Skip to content
Prev 264146 / 398502 Next

BY GROUP IN GEV

Dennis:
It walks for small datset.

?Peter Maclean
Department of Economics
UDSM 



----- Original Message ----
From: Dennis Murphy <djmuser at gmail.com>
To: Peter Maclean <pmaclean2011 at yahoo.com>
Cc: r-help at r-project.org
Sent: Mon, June 27, 2011 8:37:00 PM
Subject: Re: [R] BY GROUP IN GEV

HI:

Since you didn't provide a reproducible example (in particular, what
does str(MA) return?), it's hard to verify what specifically causes
the error, but a look at the gev() function's help page indicates that
the first argument is supposed to be a (numeric) vector, apparently
atomic.

One problem with this code,
CP? <- lapply(MAS, function(x){gev(MAS$CP1, 100, method = "BFGS", control =
list(maxit = 500))})

is that there is no 'x' in the body of the function. Perhaps you need
to generate a numeric vector for CP1 before feeding it to gev(), but
without a reproducible example this is nothing more than speculation.
Perhaps something like:

CP? <- lapply(MAS, function(x){
? ? ? ? ? ? y <- as.numeric(x$CP1)
? ? ? ? ? ? gev(y, 100, method = "BFGS", control = list(maxit = 500))
? ? ? ? })

Obviously untested for the reason stated above. A perusal of the
Posting Guide might be beneficial.

Dennis
On Mon, Jun 27, 2011 at 3:19 PM, Peter Maclean <pmaclean2011 at yahoo.com> wrote:
use