friendly / matlib

Matrix Functions for Teaching and Learning Linear Algebra and Multivariate Statistics
http://friendly.github.io/matlib/
65 stars 16 forks source link

util.R functions undocumented #15

Closed friendly closed 8 years ago

friendly commented 8 years ago

Moving printMatrix and formatNumbers to util.R now generates a warning,

checking for missing documentation entries ... WARNING
Undocumented code objects:
  'formatNumbers' 'printMatrix'

This is because NAMESPACE contains exportPattern("^[[:alpha:]]+"). If they are generally useful enough to be exported, they should be documented.

philchalmers commented 8 years ago

Hmm, one of three things should happen here

1) Change to a different regex to avoid matching these functions 2) Remove exportPattern so that @export can be added to functions that should be exported explicitly, or 3) Document these functions for front-end users (FEUs)

I like 2) the most, it's probably the most general compared to 1). And 3) doesn't seem too useful to FEUs, because why would they ever want a printMatrix or formatNumbers function?

john-d-fox commented 8 years ago

-----Original Message----- From: Phil Chalmers [mailto:notifications@github.com] Sent: Thursday, October 13, 2016 10:57 AM To: friendly/matlib matlib@noreply.github.com Subject: Re: [friendly/matlib] util.R functions undocumented (#15)

Hmm, one of three things should happen here

1) Changed to a different regex to avoid matching these functions 2) Removed exportPattern so that @export can be added to functions that should be exported explicitly, or 3) Document these functions for front-end users (FEUs)

I like 2) the most, it's probably the most general compared to 1). And

I also prefer 2).

3) doesn't seem too useful to FEUs, because why would they ever want a printMatrix or formatNumbers function?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/friendly/matlib/issues/15#issuecomment-253538222 , or mute the thread https://github.com/notifications/unsubscribe- auth/ANcgQsepL7M15vBsZZbgz4leGxmqPoVoks5qzka_gaJpZM4KV_AQ . https://github.com/notifications/beacon/ANcgQkZ_Fl0JiUaWDJ1FedIavJiz8KG nks5qzka_gaJpZM4KV_AQ.gif

friendly commented 8 years ago

exportPattern was probably a holdover from the initial version. Let's remove it, but make sure that @export is used in all functions we intend to export. e.g., I just fixed that for Solve().

friendly commented 8 years ago

Good job. Now checks w/o warnings.

philchalmers commented 8 years ago

Thanks. I also checked the rendered HTML docs with the following makefile and the functions all look to be exported correctly.

PKGNAME := $(shell sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION)

knitdocs:
    rm -rf html/
    Rscript -e "library('knitr',quietly=TRUE);knit_rd('$(PKGNAME)')"
    mkdir html
    mv *.html html/
    rm R.css
    git checkout -- .

I wouldn't generally use this though as rgl objects don't get embedded in the output (I asked whether this is possible on SO a while back, but it doesn't look to be).