NCEAS / arcticdatautils

Utility functions in R for processing data for the Arctic Data Center
https://nceas.github.io/arcticdatautils/
Apache License 2.0
10 stars 20 forks source link

Set project helper #58

Closed emilyodean closed 6 years ago

emilyodean commented 6 years ago

@amoeba, here's the eml_project updates.

Feel free to kick this back with whatever it needs to be worthy of being in master. I have already moved on with what I need to do for SASAP specific project tasks so no worries on holding me up.

Lots of banging my head against things for very little added functionality, but at least I now understand EML a lot better!

amoeba commented 6 years ago

Thanks @emilyodean! This looks great. Thanks in particular for copying my style to make your code/docs fit in. I really appreciate it!

but at least I now understand EML a lot better!

That's great. That's also the process I went through. Feels like forever ago.

I started a review, so please see the comments there. One other thing:

emilyodean commented 6 years ago

@amoeba requested changes made!

amoeba commented 6 years ago

That's awesome, thanks @emilyodean 🎉 . And thanks for the quick response to my requested changes. 🍻

amoeba commented 6 years ago

That's awesome, thanks @emilyodean 🎉 . And thanks for the quick response to my requested changes. 🍻

ThomasThelen commented 6 years ago

Does R treat numbers greater than 0 as true?

In C++ you can do stuff like if (myVector.size()) { do something } instead of if (myVector.size() > 0)

In the first example you get a small performance boost by cutting out the call to the > operator. I saw some code which may fall under that same optimization.

stopifnot(is.character(title), nchar(title) > 0)

amoeba commented 6 years ago

Good point. R has the same semantics in this case, which are actually that any non-zero value is TRUE, FALSE otherwise. That said, I avoid the shorter syntax because the longer variant is more clear to me.

mbjones commented 6 years ago

I agree -- relying on side effects like that makes code harder to understand. Ideally the compiler/interpreter should take care of any performance differences there.