Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should the neuprint_search type column be a factor? #47

Closed
jefferis opened this issue Jan 28, 2020 · 1 comment
Closed

should the neuprint_search type column be a factor? #47

jefferis opened this issue Jan 28, 2020 · 1 comment

Comments

@jefferis
Copy link
Contributor

In one sense, it makes sense to have it as a factor (you will often have tables where multiple neurons have the same type). However, factors unless for very well defined sets of levels (think male / female) can trip people up. Specifically @alexanderbates has some code here that is broken

opn.info = neuprint_search(".*mPN1.*")
opn.info[!is.na(opn.info$type),"type"] = opn.info[!is.na(opn.info$type),"name"]

because he is trying to add new levels to a factor. It would work as is if type were a character vector. Thoughts also @romainFr?

@jefferis
Copy link
Contributor Author

I have decided that neuprint_list2df will have stringsAsFactors=FALSE as a default i.e. always character vector rather than factor. Then you can choose to make a factor explicitly if you want. I think that in the above example type (and name) should not be factors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant