gravatar

thaufas

Thaufas

Recently Published

Reddit Question: Creating a Frequency Table
A Reddit user asked for help creating a frequency table with some numeric data. This post shows two methods for creating such a table. The first uses only base R functions, while the second uses tidyverse::readr and tidyverse::dplyr.
Reddit Question: Aggregating Data Tables and Plotting the Results
This example illustrates the following two concepts. 1) Using the "tidyverse::dplyr' package to generate an aggregate summary of a data table, including building up a data processing pipeline that is useful in data science. 2) Using the "tidyverse::ggplot2' package to plot a summary of the aggregate data. 3) Performing the operations in the prior steps without needed to create or save a new data set.
Using plotmath expressions in ggplot2 labels
This document illustrates how to use plotmath expressions in ggplot2 labels, which enables creation of rich mathematical expressions.
Reddit Question: Plotting multiple colors and shapes
https://www.reddit.com/r/Rlanguage/comments/kmdwv1/how_to_group_by_and_use_ggplot2_for_funnel_plot/
Reddit Question about ggplot2 and color aesthetics
How do we draw scatter plot for two columns for the said a & b? Beginner on R studio pls help out anyone experienced with R? have 5 similar questions just want to know how to do one so I can learn to do the rest https://www.reddit.com/r/RStudio/comments/gqv9hu/how_do_we_draw_scatter_plot_for_two_columns_for/
Using a Banner Image with RMarkdown Documents
A succinct example of how to use banner images with RMarkdown documents.
Reddit Question - Help with Creating Highlighted Regions for a Barplot with 30 Factors
I have the following code, with help from https://stackoverflow.com/questions/58866575/how-to-highlight-a-column-in-ggplot2 . But when I apply to my actual test data, where there’re about 30 columns to be highlighted, there are diagonal lines (between) connecting the highlighted columns (ie., ideally it should be empty in those columns). And my y-axis also increase a lots (not the data value, just the axis.) Any idea? Thank you !!!
Rotating Axis Tick Labels With ggplot2
Reddit Question: https://www.reddit.com/r/rprogramming/comments/cxoyt4/axis_labeks_in_hist_plot/
Creating a Multi-Plot Layout with ggplot2
Contains working code for creating a multi-plot layout with ggplot2 and gridExtra.
Plotting data for an agricultural treatment experiment.
A Reddit user wanted some ideas for plots for agricultural treatment data. This post illustrates using ggplot2 for plotting, tidyr for reshaping data, and dplyr for summarizing data.
Plotting Cell Culture Results with Multiple Attributes
A Reddit user had cell culture data (OD values) with multiple factors (4) and levels (6 x 2 x 9 x 8). The factors were Isolate Number, Origin (rich or minimal media), Growth Conditions (9 different additives), and Time Point (8 different time points). The data was restructured using the tidyr and dplyr packages and then plotted using ggplot2. This example used ggplot2's geom_line() to plot different time series and facet_grid() functions to layout the plots by various experimental factors.
Using Code Chunks with RMarkdown
When used properly, code chunks give RMarkdown tremendous flexibility. In this example, code chunks located in an external file are used with features of knitr to control how the source code and code output are displayed. Specifically, text output is suppressed and figures from plots are not shown until the code chunk has fully executed.
Reddit Post - 2018-10-27
Sub-sampling a data frame
Reddit Question - Merging Data Sets, Grouping Output, and Reporting Multiple Values in a Single Field
A Reddit user wanted to merge multiple data sets, results by a customer ID, then, for each customer ID, add a new field and print all of the events that the customer had attended. Concepts Illustrated 1) Merging multiple data frames with the rbind() function. 2) Using dplyr to group related entries. 3) Adding a new column with multiple values condensed in a single row.
Reddit Question: Selecting a subset of columns by name
A user asked for an easy way to select a subset of columns by name range, where the column names where year values (e.g. 2000, 2001, 2002, 2003, etc). The selection is rather easy, but the user's bigger problem was using variable values for column names instead of using a tidy data format.
Sample - ATF Export Data