Making Data Analytics Simpler: SQL Server and R

After my recent post on Simple-talk.com Making Data Analytics Simpler: SQL Server and R, there was a reader’s question which seems quite interesting: “… Still i am trying to understand how R benefits SQL Server…”.

I answered the question in the comments section of the article, however today I got another interesting discussion with a friend and it lead

Continue reading […] Making Data Analytics Simpler: SQL Server and R […]

 

How to get events per month barplot in R

# generate some random data

dat = data.frame(timestamp = Sys.time() + sort(round(runif(1000, (24*3600), (2*365*24*3600)))))

# create new columns to identify the month and year
dat$month = strftime(dat$time, “%b”)
dat$year = strftime(dat$time, “%Y”)

# count the timestamps per month for each year
library(plyr)
timestamps_month = count(dat, vars = c(“month”,”year”))

# create the plot graph
library(ggplot2)
ggplot(data = timestamps_month) + geom_bar(aes(x = month, y = freq, fill

Continue reading […] How to get events per month barplot […]

 

How to remove (almost) everything from the work environment

rm(list=ls())

This command will clear the variables and the loaded libraries. Almost.

If we run ?rm we get the following info:

## remove (almost) everything in the working environment.
## You will get no warning, so don’t do this unless you are really sure.
rm(list = ls())