Skip to content

Commit b6e65c1

Browse files
committed
Disk info addin and function
1 parent 8623a3e commit b6e65c1

File tree

17 files changed

+63
-1
lines changed

17 files changed

+63
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: BioDataScience
22
Type: Package
3-
Version: 2023.0.1
3+
Version: 2023.1.0
44
Title: Configuration for Biological Data Science Course
55
Description: User sign in and sign out for the Biological Data Science courses
66
at the University of Mons, Belgium.

LICENSE

100644100755
File mode changed.

LICENSE.md

100644100755
File mode changed.

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by roxygen2: do not edit by hand
22

33
export(config)
4+
export(disk_info)
45
export(obfuscator)
56
export(sdd_info)
67
export(sdd_repo_issue)

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# BioDataScience 2023.1.0
2+
3+
- An RStudio addin to check disk space used in `/home/jovyan` is added (useful for SaturnCloud). The corresponding function is `disk_info()`, which allows for testing other disks than the one corresponding to `/home/jovyan` (or all disks with `path = ""`).
4+
15
# BioDataScience 2023.0.1
26

37
- Small correction in `biometrie`: "circomférence du poignet" (typo), but corrected anyway into "tour de poignet", and no unit for "année de la mesure" (idem in `biometry`).

R/addins.R

100644100755
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
sdd_repo_issue_addin <- function()
44
sdd_repo_issue()
55

6+
disk_info_addin <- function()
7+
disk_info()
8+
69
sdd_info_addin <- function()
710
sdd_info()
811

R/config.R

100644100755
File mode changed.

R/disk_info.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#' Show disk information
2+
#'
3+
#' @description
4+
#' Calculate disk size total, used and free for a path (or for all disks if
5+
#' `path = ""`) using the `df` unix command.
6+
#'
7+
#' @param path The path to look for.
8+
#' @param intern If `TRUE`, the output is returned as a character vector,
9+
#' otherwise the output is directly printed at the console.
10+
#'
11+
#' @return With `intern = TRUE`, a character vector with the output of the
12+
#' command. Otherwise, the function is used for its side effect of printing the
13+
#' information at the console.
14+
#'
15+
#' @export
16+
#'
17+
#' @examples
18+
#' disk_info()
19+
#' disk_info("")
20+
disk_info <- function(path = "/home/jovyan", intern = FALSE) {
21+
system(paste("df -h", path), intern = intern)
22+
}

R/sdd_info.R

100644100755
File mode changed.

R/sdd_repo_issue.R

100644100755
File mode changed.

0 commit comments

Comments
 (0)