The data for my code is
payments <- read.csv("payments.csv", header = TRUE)
The data file payments.csv was used which I uploaded here:
https://github.com/Bheal/Board-Q-A
I am learning R and wanted to accomplish the same this ggplot(payments, aes( x = Average.Total.Payments, y = Average.Covered.Charges)) + geom_point() + facet_grid(DRG.Definition ~ Provider.State)
in base plotting, so I tried this:
par(mfrow = c(6,6))
for(state in unique(payments$Provider.City)) {
for(condition in unique(payments$DRG.Definition)) {
data.sub <- subset(payments, Provider.State == state & DRG.Definition == condition)
with(data.sub, plot(Average.Total.Payments ~ Average.Covered.Charges))
}
}
I am getting the following error:
Error in plot.new() : figure margins too large
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
I believe that first I have to to experiment on par()
settings. And maybe my intended 6x6 panel will show, but don't know where to start and while I search the web, wanted to post this here for relevant critique and advise. Thanks.