Note

  1. Install R-3.5.1-win.exe on Windows 10.
  2. Click the shortcut R x64 3.5.1 on Desktop.
  3. Type command in RGui:
    us <- read.DIF("clipboard",transpose=TRUE)
    
  4. Open nst-est2017-01.xlsx. You can download this file from State Population Totals and Components of Change: 2010-2017. Click the linke Annual Estimates of the Resident Population for the United States, Regions, States, and Puerto Rico: April 1, 2010 to July 1, 2017 (NST-EST2017-01) to download it.
  5. Select 50 states Select 50 states
  6. Copy data to clipboard with Ctrl+C
  7. Press Enter key to execute the read command in RGui.
  8. Now we can check data via type the variable name. r-console-check-50states
  9. Try commands:
    mean(us$V2)
    median(us$V2)
    mode(us$V2)
    sd(us$V2)
    var(us$V2)
    
  10. Show hist diagram. It will show 10 bars:
    hist(us)
    

    hist

  11. Show hist with breaks parameter. It will show 20 bars:
    hist(us,breaks=20)
    

    hist-breaks

  12. Draw normal distribution histgram. Usage:rnorm(n,mean,sd)
    hist(rnorm(50,500.7451,283.2001))
    

    hist-rnorm