Displaying 20 results from an estimated 11000 matches similar to: "relist, an inverse operator to unlist"
2008 Aug 16
0
relist.Rd patch
There are a few typos in the documentation for relist(). I've also
made a few other changes to the file which I believe are
improvements. I've attached a patch against the version under the
'trunk' branch on the svn server checked out today. It was produced by
diff -u /usr/local/src/R/R-svn-trunk/src/library/utils/man/relist.Rd ~/relist-new.Rd
I'd also suggest identical()
2013 Jun 07
1
relist() is broken when the skeleton is a list with empty list elements
Hi,
relist() is broken when the skeleton is a list with empty list elements:
> x <- list(1:3, integer(0), 11:14)
> relist(unlist(x), x)
[[1]]
[1] 1 2 3
[[2]]
[1] 11 3
[[3]]
[1] 11 12 13 14
Hard to believe that such a bug has been around for 6 years (i.e. since
the introduction of relist()) without ever being noticed.
Cheers,
H.
> sessionInfo()
R
2008 Aug 17
2
Optim stripping attributes from relistable objects
Dear all,
The following code is inspired by the help file for the relist()
function (see?relist), which explicitly details how you can use a
relistable object in conjunction with optim to pass and reconstruct
complex parameter structures/groupings. The idea is that the optim()
function can only work with vectors, but in many cases you would like
to use a complex structure inside the objective
2009 Jan 19
0
optim() example in relist() help page
I think the optim() example in the Details section of relist()'s help
page is not totally correct. In particular, in the current form it is
not taken into account that vcov should be a symmetric matrix and only
the parameters in the lower (or upper) triangular part should be optimized.
A possible fix is:
ipar <- list(mean = c(0, 1), vcov = c(1, 1, 0))
initial.param <-
2011 Apr 14
1
Possible bug in 'relist()' and/or 'as.relistable()'
Dear list,
I think I just stumbled across a bug in either 'relist()' and/or
'as.relistable()'. It seems that 'pairlists' can only be un- and relisted as
long as they're not nested:
Good:
a <- as.relistable(as.pairlist(list(a=1, b=2)))
a <- unlist(a)
relist(a)# Works
Bad:
a <- as.relistable(as.pairlist(list(a=1, b=2, c=list(c.1=1, c.2=2))))
a <- unlist(a)
2011 Oct 14
1
Creating a package skeleton with no flesh
Hi,
Wouldn't it be awesome if package.skeleton() could be used to
produce, well... a package skeleton? In a fresh R session:
> package.skeleton("mypkg")
Error in !have : invalid argument type
This (not very informative) error message seems to occur because
I'm trying to create a skeleton with no flesh on it:
> foo <- function() {}
>
2009 Jul 04
2
Skeleton Package to Flesh Out?
By any chance is there a skeleton package to use as a template to develop an R package?
I downloaded "Writing R Extensions", which was evidently updated pretty recently, but I did not see any references (and of course I may have totally missed it) to a package template to use as a go by.
Does such a skeleton package exist?
Thanks again for all your help, as I've got the code,
2011 Aug 24
1
Passing a large amount of parameters to a function
Hello,
I have a function with a long list of parameters (of different types,
numeric and string)
myFunc <-function(p1, p2, p3, p4, p5...etc)
{
do.something(p1,p2,....)
}
I want to loop over this to provide a different set of parameters to the
list every time.
for (ii in 1:N)
{
myFunc(p1(ii), p2(ii),....etc)
}
I would like to simplify the notation and use some kind of structure, maybe
2019 Feb 19
1
mle (stat4) crashing due to singular Hessian in covariance matrix calculation
Hi, R developers.
when running mle inside a loop I found a nasty behavior. From time to
time, my model had a degenerate minimum and the loop just crashed. I
tracked it down to "vcov <- if (length(coef)) solve(oout$hessian)" line,
being the hessian singular.
Note that the minimum reached was good, it just did not make sense to
calculate the covariance matrix as the inverse of a
2004 Oct 26
2
vcov method for 'coxph' objects
Dear all,
The help file for the generic function vcov states
"Classes with methods for this function include: 'lm', 'glm', 'nls', 'lme',
'gls', 'coxph' and 'survreg' (the last two in package 'survival')."
Since, I am not able to use vcov.coxph(), I am wondering whether I am
missing something (as I suspect..)
regards,
vito
2011 May 18
1
strucchange package Linux help
When I run the code below on Macintosh and Windows, the plot comes out
fine. However, on Linux, the png generated is invalid from R console,
and loading strucchange crashes rkward. Is this a known issue on Linux
and, if so, is there a workaround? Many thanks!
require(strucchange)
data("RealInt")
bp.ri <- breakpoints(RealInt~1, h=15)
summary(bp.ri)
fac.ri <- breakfactor(bp.ri,
2004 Oct 06
4
R2.0.0 bug in function vcov in library survival (PR#7266)
Full_Name: Sven Sandin
Version: 2.0.0
OS: SuSE Linux 9.0
Submission from: (NULL) (81.227.17.135)
Have just compiled and installed R-2.0.0.tar.gz running SuSE9.0.
The function vcov do not accept "coxph" object as input any longer.
The same R-program running R1.9.1 do work. R-program attached below.
Exporting the coxph object from R2.0.0 to R1.9.1 I get vcov ouput in R1.9.1.
Exporting
2010 Mar 24
1
vcov.nlminb
Hello all,
I am trying to get the variance-covariance (VCOV) matrix of the
parameter estimates produced from the nlminb minimizing function, using
vcov.nlminb, but it seems to have been expunged from the MASS library.
The hessian from nlminb is also producing NaNs, although the estimates
seems to be right, so I can't VCOV that way either. I also tried using
the vcov function after minimizing
2008 Feb 12
1
Namespace/method oddity
I stumbled on the following:
> library(stats4)
> example(mle)
> confint.default(fit2)
Error in UseMethod("vcov") : no applicable method for "vcov"
In addition: Warning message:
In object$coefficients :
$ operator not defined for this S4 class, returning NULL
> vcov(fit2)
lymax lxhalf
lymax 0.02857612 -0.04870231
lxhalf -0.04870231 0.11457338
2017 Nov 02
2
vcov and survival
>>>>> Fox, John <jfox at mcmaster.ca>
>>>>> on Thu, 14 Sep 2017 13:46:44 +0000 writes:
> Dear Martin, I made three points which likely got lost
> because of the way I presented them:
> (1) Singularity is an unusual situation and should be made
> more prominent. It typically reflects a problem with the
> data or the
2017 Sep 13
3
vcov and survival
Dear Terry,
Even the behaviour of lm() and glm() isn't entirely consistent. In both cases, singularity results in NA coefficients by default, and these are reported in the model summary and coefficient vector, but not in the coefficient covariance matrix:
----------------
> mod.lm <- lm(Employed ~ GNP + Population + I(GNP + Population),
+ data=longley)
>
Error with regsubset in leaps package - vcov and all.best option (plus calculating VIFs for subsets)
2009 May 20
1
Error with regsubset in leaps package - vcov and all.best option (plus calculating VIFs for subsets)
Hi all
I am hoping this is just a minor problem, I am trying to implement a best subsets regression procedure on some ecological datasets using the regsubsets function in the leaps package. The dataset contains 43 predictor variables plus the response (logcount) all in a dataframe called environment. I am implementing it as follows:
library(leaps)
2013 Mar 18
1
try/tryCatch
Hi All,
I have tried every fix on my try or tryCatch that I have found on the
internet, but so far have not been able to get my R code to continue with
the "for loop" after the lmer model results in an error.
Here is two attemps of my code, the input is a 3D array file, but really
any function would do....
metatrialstry<-function(mydata){
a<-matrix(data=NA, nrow=dim(mydata)[3],
2004 Nov 19
2
function 'vcov' for coxph in R 2.0.0
Hi there,
After I fitted a cox model, I used vcov to obtain the
variance of the parameter estimate. It worked correctly in
R 1.9.1. But it failed in R 2.0.0 and the error message is
Error in vcov(cox.1) : no applicable method for "vcov"
I don't know if it is a bug or there is some update on
this function. Thanks!
Lei Liu
Assistant Professor
Division of Biostatistics and
2017 Sep 14
6
vcov and survival
>>>>> Martin Maechler <maechler at stat.math.ethz.ch>
>>>>> on Thu, 14 Sep 2017 10:13:02 +0200 writes:
>>>>> Fox, John <jfox at mcmaster.ca>
>>>>> on Wed, 13 Sep 2017 22:45:07 +0000 writes:
>> Dear Terry,
>> Even the behaviour of lm() and glm() isn't entirely consistent. In both cases,