You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is dedicated to gathering ideas for the implementation of [[ method in 'annmatrix'.
'annmatrix' tries to behave just as a regular matrix across every possible method. Therefore it has little wiggle-room for adding new functionality. Few of such freebies were @ and $ methods. 'annmatrix' was able to use them because in R neither @ nor $ do anything when called on a regular matrix.
Double bracket subsetting [[ is another such method. Currently in R for a regular matrix [[ only works when selecting single elements by passing a single index as an input. If this method is to be rewritten 'annmatrix' must preserve this functionality. However all the cases where the input is not a single number can be adjusted.
One idea about possible use case for [[ is "internal" subsetting. Instead of writing:
X<-X[X@chr=="chr1", X$diagnosis=="case"]
It would allow to safely write:
X<-X[[chr=="chr1", diagnosis=="case"]]
Might be useful, specially in cases with long annmatrix variable names.
The text was updated successfully, but these errors were encountered:
This issue is dedicated to gathering ideas for the implementation of
[[
method in 'annmatrix'.'annmatrix' tries to behave just as a regular matrix across every possible method. Therefore it has little wiggle-room for adding new functionality. Few of such freebies were
@
and$
methods. 'annmatrix' was able to use them because in R neither@
nor$
do anything when called on a regular matrix.Double bracket subsetting
[[
is another such method. Currently in R for a regular matrix[[
only works when selecting single elements by passing a single index as an input. If this method is to be rewritten 'annmatrix' must preserve this functionality. However all the cases where the input is not a single number can be adjusted.One idea about possible use case for
[[
is "internal" subsetting. Instead of writing:It would allow to safely write:
Might be useful, specially in cases with long
annmatrix
variable names.The text was updated successfully, but these errors were encountered: