phenoscape / rphenoscape

R package to make phenotypic traits from the Phenoscape Knowledgebase available from within R.
https://rphenoscape.phenoscape.org/
Other
5 stars 5 forks source link

Replace for loops with apply #179

Closed johnbradley closed 3 years ago

johnbradley commented 3 years ago

Replace for loops with an appropriate apply function that is more expressive.

johnbradley commented 3 years ago

Places current using for loops to review: https://github.com/phenoscape/rphenoscape/blob/b367c4416af4cc6fa45a00765ce45a8d412b5c22/R/KBinfo.R#L15-L17

https://github.com/phenoscape/rphenoscape/blob/b367c4416af4cc6fa45a00765ce45a8d412b5c22/R/nexml.R#L96-L103

https://github.com/phenoscape/rphenoscape/blob/b367c4416af4cc6fa45a00765ce45a8d412b5c22/R/nexml.R#L114-L119

https://github.com/phenoscape/rphenoscape/blob/b367c4416af4cc6fa45a00765ce45a8d412b5c22/R/pk_get_xml.R#L129-L134

https://github.com/phenoscape/rphenoscape/blob/b367c4416af4cc6fa45a00765ce45a8d412b5c22/R/pk_study.R#L138-L142

https://github.com/phenoscape/rphenoscape/blob/b367c4416af4cc6fa45a00765ce45a8d412b5c22/R/pk_study.R#L163-L167

hlapp commented 3 years ago

Interesting. I don't think any one of them presents a good candidate for reaping some performance benefit. Maybe we should just drop this?

johnbradley commented 3 years ago

Interesting. I don't think any one of them presents a good candidate for reaping some performance benefit. Maybe we should just drop this?

Sounds good. Closing this issue.