Fix TeamUNL

Errors and warnings in packages
Author

Yingchao Zhou

Published

March 30, 2023

Frontmatter check

Prompt:

Fix one of the problems in one of our community packages at https://github.com/Stat585-at-ISU/lab-3-all-all-for-one-and-one-for-all, and write about it.

Instructions:

What we want to know is the exact warning or error message of the item you fixed, and a description of what you did, also as specific as possible.

Describe your experience below. Push this blog post to your blog-9 repo. Make sure the front matter check passes.

Which error or warning did you fix? … and how?

Before the spring break, I fixed several things for TeamUNL:

  • By adding ^presslog.*\.pdf$ to the .RBuildignore file, the check function will ignore the pdf files in the R package folder.

  • I created a global.R file in the R folder inside the package, and write a line utils::globalVariables(c("presslog_ames")) to avoid the global variable binding problem. The package passed the check with no problems. In this blog, I switched to the method used in class, i.e., add presslog_ames <- NULL and data(presslog_ames, envir = enviroment()) to the function, and specify importFrom utils data.

  • Fix the dependencies by writing appropriate importFrom argument in front of the functions.

In this blog, when I try function call get_presslog ("2023-02-14", to = "2023-02-14"), I get error “character string is not in a standard unambiguous format”. The function get_presslog is written for presslog_ames.rda where the Call Received Date/Time is a date object. However, the Call Received Date/Time in the current file is character. So I updated the dataset.