Displaying 5 results from an estimated 5 matches for "newdim".
Did you mean:
newdir
2011 Apr 03
1
setCoefTemplate
...bind(Admitted,Rejected)~Gender+Dept,data=berkeley,family="binomial")
setCoefTemplate(est.se=c(est = "($est:#)($se:#)"))
mtable(berk0,berk1,berk2,
+ coef.style="est.se",
+ summary.stats=c("Deviance","AIC","N"))
Error in dim(ans) <- newdims :
dims [product 1] do not match the length of object [2]
Thank you in advance.
--
Sebasti?n Daza
sebastian.daza at gmail.com
2011 Apr 03
1
style question
...d,Rejected)~Gender+Dept,data=berkeley,family="binomial")
setCoefTemplate(est.se=c(est = "($est:#)($se:#)"))
mtable(berk0,berk1,berk2,
+ coef.style="est.se",
+ summary.stats=c("Deviance","AIC","N"))
Error in dim(ans) <- newdims :
dims [product 1] do not match the length of object [2]
Thank you in advance.
--
Sebasti?n Daza
sebastian.daza at gmail.com
2012 Mar 10
1
Subsetting a data.frame -> Read in with FWF format from .DAT file
...ire data set, but
only have PRVDR_NUM == 050108. This is where I'm having trouble.
I've tried code like this:
newinpatient <- subset(oldinpatient, oldinpatient$PRVDR_NUM == 050108)
#OR
newinpatient <- oldinpatient[oldinpatient$PRVDR_NUM == 050108, ]
#OR
providernum <- data.frame(newdim(PRVDR_NUM = c(050108))
newinpatient <- merge(providernum, oldinpatient)
With checking "class" at one point, I gathered that R interprets PRVDR_NUM
as a factor, not a number .. so I've understood a potential reason why I
would have errors (with code above). So, I then tried someth...
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
??
> z <- array(1:24,dim=2:4)
> all.equal(f(z,3),f2(z,3))
[1] "Attributes: < Component ?dim?: Mean relative difference: 0.4444444 >"
[2] "Mean relative difference: 0.6109091"
In fact,
> dim(f(z,3))
[1] 2 3 4
> dim(f2(z,3))
[1] 3 4 2
Have I made some sort of stupid error here? Or have I misunderstood
what was wanted?
Cheers,
Bert
Bert Gunter
2017 Jun 01
3
Reversing one dimension of an array, in a generalized case
Here is an alternative approach using apply(). Note that with apply() you are reversing rows or columns not indices of rows or columns so apply(junk, 2, rev) reverses the values in each column not the column indices. We actually need to use rev() on everything but the index we are interested in reversing:
f2 <- function(a, wh) {
dims <- seq_len(length(dim(a)))
dims <-