You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use spaces for better readability. For example, combineDist <- function(dist.dat) should be combineDist <- function(dist.dat).
Always use <- for variable assignment. Sometimes you use <- and sometimes =. Of course, you should continue to use = for default values of function parameters, such as function(cv.fit, kk = NULL, cvr = 50).
Use consistent capitalisation. Instead of functions combineDist, getstats, plotstats have combineDist, getStats, plotStats.
Use informative variable names. For example, dd, kk are too short and not informative names.
Use lapply or mapply instead of for loops wherever possible. For instance, the code
centroids<-list()
for (iin1:cv.rounds)
{
centroids[[i]]<-get.centroid(cmd.mat, fit[[i]]$cv.labels,i)
}
All exported functions should be documented. In the previous point, I didn't know what the purpose of f is for get.centroid. get.centroid is exported because all of the functions of your package which don't begin with a dot are because of exportPattern("^[[:alpha:]]+") in NAMESPACE. But, I see no Rd file for get.centroid and using a variable name like f isn't intuitive for guessing its purpose, either. So, I didn't know how to adapt the above example to include f, so it was ignored.
Name the variables to indicate whether it contains one value or more. I would use fits or modelFits instead of fit above.
VIgnette not available. It should show the reader what functions they should use and in which order. Right now, the user has no guidance about which function they should use first, which function they should use second and how to interpret the output of each function. There should be a data directory in your package which stores one example data set which your vignette uses to demonstrate the package's features. See Data in Packages section of Writing R Extensions for more details.
The text was updated successfully, but these errors were encountered:
combineDist <- function(dist.dat)
should becombineDist <- function(dist.dat)
.<-
for variable assignment. Sometimes you use<-
and sometimes=
. Of course, you should continue to use=
for default values of function parameters, such asfunction(cv.fit, kk = NULL, cvr = 50)
.combineDist
,getstats
,plotstats
havecombineDist
,getStats
,plotStats
.dd
,kk
are too short and not informative names.lapply
ormapply
instead offor
loops wherever possible. For instance, the codeCould possibly be more concisely replaced by
f
is forget.centroid
.get.centroid
is exported because all of the functions of your package which don't begin with a dot are because ofexportPattern("^[[:alpha:]]+")
in NAMESPACE. But, I see no Rd file forget.centroid
and using a variable name likef
isn't intuitive for guessing its purpose, either. So, I didn't know how to adapt the above example to includef
, so it was ignored.fits
ormodelFits
instead offit
above.data
directory in your package which stores one example data set which your vignette uses to demonstrate the package's features. See Data in Packages section of Writing R Extensions for more details.The text was updated successfully, but these errors were encountered: