DyfanJones/sagemaker-r-sdk

Add function parameter checks

DyfanJones opened this issue · 0 comments

To ensure all parameters are getting the correct data types, checks are required:

Possible solutions:

  • base R: stopifnot
    • Benefits:
      • no extra dependencies
      • straight forward to implement
  • checkmate (https://mllg.github.io/checkmate/):
    • Benefits:
      • Fast and versatile argument checks for R.
      • implementation similar to base R: stopifnot
  • typed (https://github.com/moodymudskipper/typed)
    • Benefits:
      • implements a type system for R, it has 3 main features
        • set variable types in a script or the body of a function, so they can’t be assigned illegal values
        • set argument types in a function definition
        • set return type of a function
      • similar to methods implemented in python sagemaker sdk