## Not run:
# library(dplyr)
# # Connection basics ---------------------------------------------------------
# # To connect to TEST database, assumed to be specified in your ~/sql.yaml
# # file (see \code{\link{have_test_server}}), first create a src:
# my_src <- src_sqlserver("TEST")
# # Then reference a tbl within that src
# my_tbl <- tbl(my_src, "my_table")
# # Methods -------------------------------------------------------------------
# # You can then inspect table and perform actions on it
# dim(my_tbl)
# colnames(my_tbl)
# head(my_tbl)
# # Data manipulation verbs ---------------------------------------------------
# filter(my_tbl, this.field == "that.value")
# select(my_tbl, from.this.field:to.that.field)
# arrange(my_tbl, this.field)
# mutate(my_tbl, squared.field = field ^ 2)
# # Group by operations -------------------------------------------------------
# by_field <- group_by(my_tbl, field)
# group_size(by_field)
# by_field %>% summarise(ave = mean(numeric.field))
# # See dplyr documentation for further information on data operations
# ## End(Not run)
Run the code above in your browser using DataLab