what exactly do you expect pmf$Y to return?

Code:

```
b <- matrix(1:6,nrow=2,dimnames=list(c("X1","X2"),c("Y1","Y2","Y3")))
b
b$X1
```

Code:

```
pmf <- array(c(2/15,1/15,4/15,1/15,3/15,4/15),dim=c(2,3),
dimnames=list(X=1:2,Y=1:3))
seq_along(pmf$Y)
Error in pmf$Y : $ operator is invalid for atomic vectors
```

Last edited:

In any case, LISTS data structures in R can use the "$" operator. That is built into R. It is NOT available for vector data structure. You have to use dimension indexing with square brackets. The brackets are more general and apply to data.frames because frames are intended to be "like" matrix in form (tabular/columnar). However, underneath, a frame is still just a special kind of lists. Lists can use the "$" operator because it is expected to be a

Therefore, your trying to access named dimensions of vectors, matrices, or arrays using the "$" operator will fail. A vector is