# How to draw multiple linear plot

http://www.sthda.com/english/wiki/a-complete-guide-to-3d-visualization-device-system-in-r-r-software-and-data-visualization

https://rpubs.com/FelipeRego/MultipleLinearRegressionInRFirstSteps

# R how to do a multi-linear regression

https://www.r-bloggers.com/r-tutorial-series-multiple-linear-regression/

https://www.statmethods.net/stats/regression.html

https://rcompanion.org/rcompanion/e_05.html

# R reading html table from a web page

library(XML)
theurl <- "http://finance.yahoo.com" tables <- readHTMLTable(theurl) n.rows <- unlist(lapply(tables, function(t) dim(t)[1])) the picked table is the longest one on the page lstRes <- tables[[which.max(n.rows)]] as.data.frame(lstRes)

# R how to skip first two rows

DFcars[-(1:2),]
mtcars[-(1:2)]
use “-” negate the rows

# R how to connect to mysql database

First install the MySQL packcages

now, run the connection command to connect MySQL db on localhost

show the tables and show selected table fields

# Getting the data into mysql db

book1:page 26:
URL http://www2.census.gov/acs2011_1yr/pums/csv_pus.zip
URL http://www2.census.gov/acs2011_1yr/pums/csv_hus.zip

data was not properly loaded, no delimiter specified in the load data infile command when we run.

need to fix this:

First truncate the table, then modify the load data infile command add Fields terminated by “,” in the loading command. Check and see the data load correctly, do the same for Hus_b, pus_a, pus_b;

back to OS to compare the lines in files

table rows are exactly one less than the lines in files for each, yeeeeeeeeeee.

install.packages(“RMySQL”)
library(RMySQL)
Connecting to MySQL:
Once the RMySQL library is installed create a database connection object.

Listing Tables and Fields:
Now that a connection has been made we list the tables and fields in the database we connected to.

dbListTables(mydb)

This will return a list of the tables in our connection.

dbListFields(mydb, ‘some_table’)

# R – ggplot’s qplot executed but no graph showing up on sourcing

R – ggplot’s qplot executed but no graph showing up on sourcing

need to Call print explicitly

#code snippet
p <-ggplot(df, aes(x = dt, y = y)) + geom_point() + geom_point(data = ds, aes(y = mean), colour = 'red', size = 3) print(p)

# R Studio how to clean console screen?

R Studio how to clean console screen?

CTL^ + E THEN L