You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally, there would be a test_base_plot() function that handled all the specific cases.
One complication is that formula syntax is not supported for all base plot types. For example, hist() doesn't allow this. So you'd need a completely separate test_base_hist().
It might be easier from a technical point of view if the plot was first converted to a grid plot, in order to have an object to test. You can do this using grid.echo() and grid.grab() from the gridGraphics package.
FYI For base plotting, the Data Visualization in R course has longer, messy SCTs for the different cases in Ch1 and Ch2 (I didn’t get round to doing them for the later chapters yet) https://github.com/datacamp/courses-data-vis-in-r
The text was updated successfully, but these errors were encountered:
You can write code to draw base plots in several ways. For example, the following are all equivalent.
Writing SCTs to check for all syntaxes is tricky. You have to do something like this:
Ideally, there would be a
test_base_plot()
function that handled all the specific cases.One complication is that formula syntax is not supported for all base plot types. For example,
hist()
doesn't allow this. So you'd need a completely separatetest_base_hist()
.It might be easier from a technical point of view if the plot was first converted to a grid plot, in order to have an object to test. You can do this using
grid.echo()
andgrid.grab()
from thegridGraphics
package.See https://journal.r-project.org/archive/2015-1/murrell.pdf
FYI For base plotting, the Data Visualization in R course has longer, messy SCTs for the different cases in Ch1 and Ch2 (I didn’t get round to doing them for the later chapters yet) https://github.com/datacamp/courses-data-vis-in-r
The text was updated successfully, but these errors were encountered: