ggfigdone
Manage & Modify {ggplot2} Figures Using {ggfigdone}
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.8%) to scientific vocabulary
Keywords
Repository
Manage & Modify {ggplot2} Figures Using {ggfigdone}
Basic Info
- Host: GitHub
- Owner: wenjie1991
- License: other
- Language: R
- Default Branch: devel
- Homepage: https://wenjie1991.github.io/ggfigdone/
- Size: 567 KB
Statistics
- Stars: 32
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 3
Topics
Metadata Files
README.md
ggfigdone: Manage ggplot figures using ggfigdone
Description
When you prepare a presentation or a report, you often need to manage a large number of ggplot figures. You need to change the figure size, modify the title, label, themes, etc. It is inconvinient to go back to the original code to make these changes. This package provides a simple way to manage ggplot figures.
Features
Manage figures
You can easily add the figure to the database and manage it later using CLI (command line interface) or GUI (graphical user interface).
https://github.com/user-attachments/assets/7bcccfdd-e48d-49c7-9c18-ec0c41ee0481
Update figures by LLM
Utilizing the LLM to convert your idea in natural language into {ggplot2} code.
https://github.com/user-attachments/assets/524a6d44-012d-4a55-8a5a-83b44f1ffadd
Installation
Install the stable version from CRAN:
r
install.packages("ggfigdone")
Install the development version from GitHub:
```r
install.packages("remotes")
remotes::install_github("wenjie1991/ggfigdone") ```
Demo
Initialize the database
First, you need to initialize the database and add figures to it.
Next time, you only need to load the database to add more figures or update the existing figures.
```r library(ggfigdone) library(ggplot2)
Initial ggfigdone database using fd_init
The database location is ./fd_dir
Load existing database using fd_load("./fd_dir")
fo = fdinit("./fddir")
Draw a ggplot figure
g = ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()
Add the figure to the database
The last plot is added to the last initialized/loaded database
fd_add(name = "fig1")
Add the same figure with a different name
You can specify the ggplot object and database name
fd_add(g = g, name = "fig2", fo)
The hard disk database is automatically updated, no need to save operations.
```
Manage the figures in browser
Then you can start the server and open the browser to manage the figures.
```r
To start the server, provide the database location
fdserver("./fddir")
Open the browser and go to http://localhost:8080/index.html
```
Configure LLM Service
LLM API key
OpenAI API
To get API key, you can visit the OpenAI website at https://openai.com/ and follow the instructions in the video. You may need to update your payment methods.
https://github.com/user-attachments/assets/e5fc4feb-5dc4-4473-826d-ec69b5c0d9a5
Free API key
You can find free LLM service at this link: https://github.com/cheahjs/free-llm-api-resources
The following video demonstrates how to apply the GroqCloud key for free.
Link: https://console.groq.com/login
https://github.com/user-attachments/assets/5624798a-1c86-4694-b7a0-69daaacf470f
Configure {ggfigdone}
Example: OpenAI service
The default configuration is the OpenAI service, where you only need to provide the OpenAI API key.
r
fd_server("./fd_dir",
llm_api_key = "sk-use_your_own_key_here")
)
Example: Groq service
To use Croq or any other service, you must configure the parameters llm_api_url, llm_api_key, and llm_model.
r
fd_server("./fd_dir",
llm_api_url = "https://api.groq.com/openai/v1/chat/completions",
llm_api_key = "gsk_use_your_own_key_here",
llm_model = "llama-3.3-70b-versatile"
)
Set default service
You can configure the default LLM service in .Rprofile using the following code.
r
options(
ggfigdone.llm_api_key = "gsk-use_your_own_key_here",
ggfigdone.llm_api_url = "https://api.groq.com/openai/v1/chat/completions",
ggfigdone.llm_model = "llama-3.3-70b-versatile",
ggfigdone.llm_temperature = "0.5",
ggfigdone.llm_max_tokens = 1000
)
Contribution
This package is being developed. Feel free to contribute to the package by sending pull requests or creating issues.
License
MIT
Owner
- Name: Wenjie Sun
- Login: wenjie1991
- Kind: user
- Location: Paris
- Website: https://www.sun-wenjie.site
- Repositories: 40
- Profile: https://github.com/wenjie1991
Passion about {How} and {Why} using R, C++, HTML, JavaScript, statistics, NGS, and Love.
GitHub Events
Total
- Release event: 1
- Watch event: 16
- Push event: 6
- Create event: 1
Last Year
- Release event: 1
- Watch event: 16
- Push event: 6
- Create event: 1
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: about 3 hours
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: about 3 hours
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- shoebridges (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 236 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
cran.r-project.org: ggfigdone
Manage & Modify 'ggplot' Figures using 'ggfigdone'
- Documentation: http://cran.r-project.org/web/packages/ggfigdone/ggfigdone.pdf
- License: GPL-3
-
Latest release: 0.1.2
published over 1 year ago
Rankings
Dependencies
- actions/checkout v3 composite
- r-lib/actions/setup-r f57f1301a053485946083d7a45022b278929a78a composite
- R >= 4.0.0 depends
- data.table * imports
- filelock * imports
- ggplot2 * imports
- httpuv * imports
- httr * imports
- jsonlite * imports
- readr * imports
- sysfonts * imports
- uuid * imports
- R.utils * suggests
- knitr * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests