Displaying 1 result from an estimated 1 matches for "dimenensionless".
Did you mean:
dimensionless
2012 Jan 31
1
dimensions dropped on assignment
Hi there,
This is a problem I've run into and do not know how to avoid. It
happens when I make an assignment using the dimension names as the
subscript of the array. The end result is a dimenensionless array
(i.e. a vector) which I don't want. See:
> out <- array(0, 5, list(1:5))
> dim(out)
[1] 5
> out[names(out)] <- 1
> dim(out)
NULL
I tried to include a 'drop' argument into the index but it doesn't
seem to work:
> out[names(out), drop=FALSE] <- 1
Error...