as.plantuml: Convert an R object to a Class uml object

View source: R/as.plantuml.R

as.plantumlR Documentation

Convert an R object to a Class uml object

Description

Generic function to convert an R object to a plantuml Class object. See details for the individual functions

Usage

as.plantuml(x, ...)

## S3 method for class 'character'
as.plantuml(x, complete = FALSE, nm = NULL, ...)

## S3 method for class 'complex'
as.plantuml(x, complete = FALSE, nm = NULL, ...)

## S3 method for class 'data.frame'
as.plantuml(x, complete = FALSE, nm = NULL, ...)

## Default S3 method:
as.plantuml(x, complete = FALSE, nm = NULL, ...)

## S3 method for class 'factor'
as.plantuml(x, complete = FALSE, nm = NULL, ...)

## S3 method for class 'integer'
as.plantuml(x, complete = FALSE, nm = NULL, ...)

## S3 method for class 'list'
as.plantuml(x, complete = FALSE, nm = NULL, ...)

## S3 method for class 'logical'
as.plantuml(x, complete = FALSE, nm = NULL, ...)

## S3 method for class 'numeric'
as.plantuml(x, complete = FALSE, nm = NULL, ...)

Arguments

x

R object to be converted

...

other argunents passed on to generic functions

Value

object of class plantuml which can be plotted.

Examples

## Not run: 
x <- list(
  a = 1:10,
  b = letters[1:4],
  c = data.frame(
    x = 1:10,
    y = c(TRUE, FALSE)
  )
)
x <- plantuml(x)
plot( x )

## End(Not run)

## Not run: 
 x <- LETTERS
 x <- as.plantuml(x)
 plot(x)
 
## End(Not run)

## Not run: 
 x <- factor(LETTERS)
 x <- as.plantuml(x)
 plot(x)
 
## End(Not run)

## Not run: 
 x <- 1L:10L
 names(x) <- letters[1:10]
 x <- as.plantuml(x)
 plot(x)
 
## End(Not run)

## Not run: 
 x <- list(
   num = 1:10,
   let = letters[1:20]
 )
 x$list <- list(x, x)
 x <- as.plantuml(x)
 plot(x)
 
## End(Not run)

## Not run: 
 x <- 1/(-10:10)
 x <- as.plantuml(x)
 plot(x)

 x <- matrix(1:21, nrow = 7, ncol = 3)
 x <- as.plantuml(x)
 plot(x)
 
## End(Not run)


rkrug/plantuml documentation built on June 3, 2023, 6:24 a.m.