Learn R Programming

⚠️There's a newer version (1.1.0) of this package.Take me there.

fplot is an R package made for the easy plotting of distributions.

The problem when it comes to distributions is that we often face a variety of data, each requiring a different type of layout: we don't represent the distribution of categorical variables similarly to continuous variables, and regarding the latter heavily skewed data may require a special treatment. The aim of fplot is to automatically make choices for the user in order to always display meaningful (and hopefully beautiful!) graphs.

This brief description shows a gallery of fplot possibilities. For a more detailed introduction, please see the walk-through.

The data sets used are us_pub_econ (from fplot) relating to publications in economics from US institutions, trade (from package fixest) relating to trade value between countries for some products in the European Union, and the iris data set (from base R).

One aim of fplotis to easily export graphs, it therefore includes a tool to relabel the variable names globally (once and for all). The following line is run before plotting the graphs:

setFplot_dict(c(Origin = "Exporting Country", Destination = "Importing Country", Euros = "Exports Value in €", 
                jnl_top_25p = "Pub. in Top 25% journal", jnl_top_5p = "Publications in Top 5% journal", 
                journal = "Journal", institution = "U.S. Institution", Petal.Length = "Petal Length"))

The code to run the plots are in the titles of the graphs. You'll notice that the same command line can result in a set of different graphs.

Copy Link

Version

Install

install.packages('fplot')

Monthly Downloads

298

Version

1.0.0

License

GPL-3

Maintainer

Laurent Berge

Last Published

May 8th, 2020

Functions in fplot (1.0.0)

setFplot_page

Sets the target page size for figure exporting
us_pub_econ

Publication data sample
plot_lines

Display means conditionnally on some other values
plot_distr

Plot distributions, possibly conditional
setFplot_distr

Sets the defaults of plot_distr
plot_box

Boxplots with possibly moderators
pdf_fit

PDF export with guaranteed text size
png_fit

PNG export with guaranteed text size
setFplot_dict

Sets/gets the dictionary used in fplot
fit.off

Closes the current plotting device and shows the result in the viewer
fplot-package

Aggregate/conditional graphs and automatic layout using formulas