Skip to content

Commit

Permalink
[upd] changed condition for generic neurolist to df assignement
Browse files Browse the repository at this point in the history
  • Loading branch information
dokato committed Jun 11, 2021
1 parent c25a142 commit aa47423
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/neuronlist.R
Expand Up @@ -296,11 +296,13 @@ as.data.frame.neuronlist<-function(x, row.names = names(x), optional = FALSE, ..
return(x)
}
nn=names(x)
if (all(rownames(value) == as.character(1:nrow(value)))) {
matching_rows=intersect(nn, rownames(value))
if (length(matching_rows)!=length(nn) &
all(rownames(value) == as.character(1:nrow(value)))) {
warning("Generic rownames detected, using first column for matching rows.")
rownames(value) <- value[,1]
matching_rows=intersect(nn, rownames(value))
}
matching_rows=intersect(nn, rownames(value))
if(length(matching_rows)){
missing_rows=setdiff(nn, matching_rows)
if(length(missing_rows))
Expand Down

0 comments on commit aa47423

Please sign in to comment.