Title: | Tutorials for Joho-shori-enshu Class at Chiba University |
---|---|
Description: | Provides {learnr} tutorials as homework assignments for the Joho-shori-enshu Class at Chiba University, Japan. |
Authors: | Joel H. Nitta [aut, cre] |
Maintainer: | Joel H. Nitta <[email protected]> |
License: | CC BY 4.0 |
Version: | 0.0.0.9000 |
Built: | 2024-11-19 03:35:10 UTC |
Source: | https://github.com/joelnitta/joholearnr |
Get last call in user code, excluding comments
last_user_code_call(.user_code)
last_user_code_call(.user_code)
.user_code |
User-provided code in a learnr tutorial |
The last string provided by the user in their code
Lists all tutorials (Rmd files) in joholearnr
list_tutorials()
list_tutorials()
Character vector
list_tutorials()
list_tutorials()
Create an renv.lock file for each tutorial
snapshot_tutorials(dir = "./inst/tutorials")
snapshot_tutorials(dir = "./inst/tutorials")
dir |
Directory containing the tutorials. Each should be in its own
subdirectory; see |
Nothing. Externally, the renv files will be written to disk.
if (interactive()) { tutorials_folder <- system.file("tutorials", package = "joholearnr") temp_tutorials_folder <- fs::path(tempdir(), "tutorials") fs::dir_copy(tutorials_folder, temp_tutorials_folder, overwrite = TRUE) snapshot_tutorials(temp_tutorials_folder) fs::dir_delete(temp_tutorials_folder) }
if (interactive()) { tutorials_folder <- system.file("tutorials", package = "joholearnr") temp_tutorials_folder <- fs::path(tempdir(), "tutorials") fs::dir_copy(tutorials_folder, temp_tutorials_folder, overwrite = TRUE) snapshot_tutorials(temp_tutorials_folder) fs::dir_delete(temp_tutorials_folder) }
This is provided only for practicing using the tab key to autocomplete a long name
this_is_a_really_long_name
this_is_a_really_long_name
An object of class numeric
of length 1.
Write out all tutorial files (Rmd) file to disk
write_all_tutorials(dir = ".", delete_html = TRUE)
write_all_tutorials(dir = ".", delete_html = TRUE)
dir |
Directory to write the files. |
delete_html |
Logical; should HTML files in the tutorials directory be deleted after copying? |
Nothing. Externally, the file will be written to disk. (Subfolders may be used)
target_dir <- fs::path(tempdir(), "tutorials") write_all_tutorials(target_dir) fs::dir_ls(target_dir) fs::dir_delete(target_dir)
target_dir <- fs::path(tempdir(), "tutorials") write_all_tutorials(target_dir) fs::dir_ls(target_dir) fs::dir_delete(target_dir)
Write out a tutorial (Rmd) file to disk
write_tutorial(tutorial, dir = ".")
write_tutorial(tutorial, dir = ".")
tutorial |
Name of the tutorial file. The .Rmd extension may be omitted. |
dir |
Directory to write the file. |
Nothing. Externally, the file will be written to disk.
write_tutorial("00-learnr", tempdir()) list.files(tempdir())
write_tutorial("00-learnr", tempdir()) list.files(tempdir())