Browse Source

Simplify some functions

master
Maxime Wack 3 years ago
parent
commit
175935ac56
1 changed files with 5 additions and 10 deletions
  1. +5
    -10
      functions.Rmd

+ 5
- 10
functions.Rmd View File

@@ -16,9 +16,7 @@ Get an object from its full qualifying name (*fullname*).
##' @param fullname A string with the fullname of an object
##' @return The object
get_object <- function(fullname)
{
eval(parse(text = fullname))
}
```

## Get name
@@ -81,9 +79,10 @@ Get the type / class / mode of an object given its fullname.
##' @param fullname A string with the fullname of an object
##' @return The type of the object
get_type <- function(fullname)
{
class(get_object(fullname))[[1]]
}
class(get_object(fullname))[[1]] # Get the first class of the
# object. This works for matrices, but
# not for tibbles…

```

## Get size
@@ -137,11 +136,7 @@ Print a package:
##' @param pkg The package to print
##' @return The line to print to the buffer
print_package <- function(pkg)
{
paste0(pkg,
"|pkg| ",
pkg)
}
paste0(pkg, "|pkg| ", pkg)
```

## searchlist


Loading…
Cancel
Save