The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Vignette For ggplotcli

Claas Heuer

2024-04-23

Using ggplotcli with ggplot2

library(plotcli)  
#> Loading required package: R6
#> Loading required package: ggplot2
#> plotcli loaded. Use plotcli_options() to set global options.

mtcars$cf = as.character(mtcars$cyl)

mtcars_ggplot <- ggplot(mtcars, aes(x = mpg, y = wt)) +  
  geom_point() +  
  geom_smooth(method = "lm", color = "red") +
  labs(title = "Mtcars Dataset with Regression Line",  
       x = "Miles per Gallon",  
       y = "Weight")  
  
pp = ggplotcli(mtcars_ggplot, braille = FALSE)  
#> `geom_smooth()` using formula = 'y ~ x'
pp$print_plot()  
#> 
#>                                                                                                         
#>                                        Mtcars Dataset with Regression Line                              
#>                 ┌────────────────────────────────────────────────────────────────────────────────┐      
#>             5.4 │*              *                                                                │      
#>                 │*                                                                               │      
#>                 │                                                                                │      
#>                 │                                                                                │      
#>                 │                                                                                │      
#>                 │                                                                                │      
#>                 │                                                                                │      
#>                 │*                                                                               │      
#>                 │ ***                                                                            │      
#>                 │    **                                                                          │      
#>             4.4 │      ***                                                                       │      
#>                 │         **                                                                     │      
#>                 │           ***      *                                                           │      
#>                 │              **                                                                │      
#>                 │          *     ***           *                                                 │      
#>                 │                *  **  *                                                        │      
#>                 │                     ***                                                        │      
#>                 │             *  **      **                                                      │      
#>                 │                *        **** *                                                 │   _1  
#>   Weight    3.3 │                             **                                                 │   _2  
#>                 │                               ***   *                                          │      
#>                 │                  *               **      *     *                               │      
#>                 │                                    ***                                         │      
#>                 │                                       ***                                      │      
#>                 │                                    **    ***                                   │      
#>                 │                                *            **                                 │      
#>                 │                                    *          ***                              │      
#>                 │                                                  **                            │      
#>                 │                                      *             **                          │      
#>             2.3 │                                          *           ***                       │      
#>                 │                                                         **                *    │      
#>                 │                                                     *     ***                  │      
#>                 │                                                              **                │      
#>                 │                                                          *     ***             │      
#>                 │                                                                   **          *│      
#>                 │                                                                     ***        │      
#>                 │                                                                    *   **      │      
#>                 │                                                                    *     ***   │      
#>                 │                                                                             ** │      
#>             1.3 │                                                                               *│      
#>                 └────────────────────────────────────────────────────────────────────────────────┘      
#>                                                                                                         
#>                  10.4               16.3               22.1                28.0              33.9       
#>                                                                                                         
#>                                                 Miles per Gallon                                        
#> 

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.