[R] Return filematrix column by column names instead of column index?
drj|m|emon @end|ng |rom gm@||@com
Wed Sep 9 02:00:10 CEST 2020
As I don't have the filematrix package this is really an "any suggestion":
FM[,which(colnames(FM) %in% c("one","three"))]
On Tue, Sep 8, 2020 at 9:43 PM nevil amos <nevil.amos using gmail.com> wrote:
> Is there a way to get columns out of a filematrix using the column name
> directly in the same way that you can with a regular matrix?
> colnames(M)<-c("one","two", "three")
> #Extract column
> FM<-fm.create.from.matrix(filenamebase = "test",mat = M)
> #extract by column by name does not work
> #workaround using grep
> #is there a more direct way of doing this to retrieve more than one column?
> many thanks for any suggestions
> Nevil Amos
> [[alternative HTML version deleted]]
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help