myDF = read.delim("http://www.kktg.net/R/Chapter2Data.txt",
header = TRUE, # Data has headers for var names
colClasses = c("character", # Set storage modes of variables
"numeric", "numeric", "numeric", # This is just a convenience and
"numeric", "factor", "numeric")) # could be adjusted afterwards
# Once more, with a log transformation -----------------------------------------
png(filename = "illustrations/fig-2-4-femlife log GDPc plot.png",
units = "in", # Set measurements in inches
res = 1200, # Set resolution at 1200dpi
width = 6, # Width at 6 inches
height = 4) # Height at 4 inches
par(mai = c(1, 1, .25, .25)) # Set margins - no Title
plot(log(myDF$GDPc), myDF$FemLife) # Plot: femlife by ln of GDPc
dev.off() # Output png file
Figure 2-4: A Default Scatterplot
Portfolio Categories: All Graphics and SGR Book Graphics.