This class is a very basic example of the features of the rJava maven plugin.

Version: 1.1.0

Generated: 2024-05-16T16:22:15.444089981

Details

The class is annotated with an @RClass to identify it as part of the R API.

Methods

Constructors

Class methods


Constructor new()

the default no-args constructor

Usage


J = testRapi::JavaApi$get()
instance = J$MinimalExample$new();
        

Arguments

  • none

Returns

the new R6 MinimalExample object


Method demo()

Documentation of the method can be done in JavaDoc and these will be present in the R documentation

Usage


J = testRapi::JavaApi$get()
instance = J$MinimalExample$new();
instance$demo(dataframe, message)
        

Arguments

dataframe - a dataframe with an arbitrary number of columns

- (java expects a RDataframe)

message - a message

- (java expects a String)

Returns

RDataframe: the dataframe unchanged

Examples


J = JavaApi$get()
minExample = J$MinimalExample$new()
minExample$demo(dataframe=tibble::tibble(input=c(1,
2,3)), message='Hello world')
      

Examples

## -----------------------------------
## Construct new instance of MinimalExample
## -----------------------------------
if (FALSE) {
J = testRapi::JavaApi$get()
# appropriate parameter values must be provided
instance = J$MinimalExample$new()
}

## -----------------------------------
## Method `MinimalExample$demo(dataframe, message)`
## -----------------------------------
J = JavaApi$get()
minExample = J$MinimalExample$new()
minExample$demo(dataframe=tibble::tibble(input=c(1,
2,3)), message='Hello world')
#> this dataframe has nrow=3
#> Hello world
#> # A tibble: 3 × 1
#>   input
#>   <dbl>
#> 1     1
#> 2     2
#> 3     3