- How do I make a *relative* frequency histogram?
As you know hist(x) makes a frequency histogram for x. What hist() does is also to return a number of other things. The way to find out everything that it returns is names():
a = hist(x)
names(a)
The actual frequencies and the mid-points of the blocks are returned as a$mids and a$counts. So, another way to do a frequency histogram is to say
plot(a$mids,a$counts,type="h",lwd=4) .
The "lwd" specifies the width of the bars. I set it to whatever makes the plots look good. Finally, then, one way to do *relative* histograms is with
plot(a$mids,a$counts/length(x),type="h",lwd=4) .
To do a density histogram, you don't need any of this, because R already provides for that option:
hist(x,freq=F)

- How do I enter a bunch of data into R, not from a data file?
E.g. x <- c(13,2,25,6)

- How do I get R-squared from lm()?
lm.1 <- lm()
summary(lm.1)