+## domain pageviews unique.pageviews
+## 542 dpdwinw101.ad.seattle.gov/ 52 25
+## 678 murray.seattle.gov/ 41246 35629
+## 776 consultants.seattle.gov/ 2790 2203
+## 808 perspectives.seattle.gov/ 46 44
+## 644 NA NA
+## average.time.on.page bounce.rate exit.percent month
+## 542 125.76 0.0 11.54 07/01/2015 12:00:00 AM
+## 678 0:02:38 0.8 0.69 09/01/2015 12:00:00 AM
+## 776 0:01:10 5446.0 3391.00 10/01/2015 12:00:00 AM
+## 808 0:02:17 8667.0 4130.00 10/01/2015 12:00:00 AM
+## 644 NA NA</code></pre>
+<p>I can check for missing values and summarize the different columns using <code>lapply</code>:</p>
+<pre class="r"><code>lapply(total, summary)</code></pre>
+<pre><code>## $domain
+##
+## 34
+## 2035.seattle.gov/
+## 15
+## artbeat.seattle.gov/
+## 15
+## atyourservice.seattle.gov/
+## 15
+## bagshaw.seattle.gov/
+## 15
+## bottomline.seattle.gov/
+## 15
+## brainstorm.seattle.gov/
+## 15
+## buildingconnections.seattle.gov/
+## 15
+## centerspotlight.seattle.gov/
+## 15
+## cityclerk.seattle.gov/
+## 15
+## clark.seattle.gov/
+## 15
+## clerk.seattle.gov/
+## 15
+## climatechange.seattle.gov/
+## 15
+## conlin.seattle.gov/
+## 15
+## consultants.seattle.gov/
+## 15
+## council.seattle.gov/
+## 15
+## find.seattle.gov/
+## 15
+## fireline.seattle.gov/
+## 15
+## frontporch.seattle.gov/
+## 15
+## godden.seattle.gov/
+## 15
+## grantsandfunding.seattle.gov/
+## 15
+## greenspace.seattle.gov/
+## 15
+## hackthecommute.seattle.gov/
+## 15
+## humaninterests.seattle.gov/
+## 15
+## licata.seattle.gov/
+## 15
+## married.seattle.gov/
+## 15
+## mayormcginn.seattle.gov/
+## 15
+## m.seattle.gov/
+## 15
+## news.seattle.gov/
+## 15
+## obrien.seattle.gov/
+## 15
+## onthemove.seattle.gov/
+## 15
+## parkways.seattle.gov/
+## 15
+## perspectives.seattle.gov/
+## 15
+## powerlines.seattle.gov/
+## 15
+## rasmussen.seattle.gov/
+## 15
+## rectech.seattle.gov/
+## 15
+## sawant.seattle.gov/
+## 15
+## sdotblog.seattle.gov/
+## 15
+## sdotperformance.seattle.gov/
+## 15
+## seattlerdy.seattle.gov/
+## 15
+## spdblotter.seattle.gov/
+## 15
+## techtalk.seattle.gov/
+## 15
+## thebuyline.seattle.gov/
+## 15
+## thescoop.seattle.gov/
+## 15
+## web6.seattle.gov/
+## 15
+## www2.seattle.gov/
+## 15
+## www.clerk.seattle.gov/
+## 15
+## wwwqa.seattle.gov/
+## 15
+## cmstrn.seattle.gov/
+## 14
+## cms8.seattle.gov/
+## 13
+## igxqa8.seattle.gov/
+## 13
+## seattle.gov/
+## 13
+## cttab.seattle.gov/
+## 12
+## okamoto.seattle.gov/
+## 12
+## web5.seattle.gov/
+## 12
+## web7.seattle.gov/
+## 12
+## education.seattle.gov/
+## 11
+## web1.seattle.gov/
+## 11
+## webqa7.seattle.gov/
+## 11
+## www4.seattle.gov/
+## 11
+## alert.seattle.gov/
+## 10
+## alerts.seattle.gov/
+## 10
+## data.seattle.gov/
+## 10
+## seattle-govstat.demo.socrata.com/
+## 10
+## connect.seattle.gov/
+## 9
+## igx8.seattle.gov/
+## 9
+## murray.seattle.gov/
+## 9
+## webqa6.seattle.gov/
+## 9
+## www.seattle.gov/
+## 9
+## www.seattle.gov.googleweblight.com/
+## 9
+## alphaqa.seattle.gov/
+## 8
+## cmsdev8.seattle.gov/
+## 8
+## dpdwinw101.ad.seattle.gov/
+## 8
+## web6.seattle.gov.googleweblight.com/
+## 8
+## cms.seattle.gov/
+## 7
+## ctab.seattle.gov/
+## 7
+## www.citylink.seattle.gov/
+## 7
+## aboveandbeyond.seattle.gov/
+## 6
+## citylink.seattle.gov/
+## 6
+## langstoninstitute.org/
+## 6
+## mayormurray.seattle.gov/
+## 6
+## take21.seattlechannel.org/
+## 6
+## web8.seattle.gov/
+## 6
+## wwwdev.seattle.gov/
+## 6
+## www.evergreenapps.org/
+## 6
+## www.safeyouthseattle.org/
+## 6
+## cityofseattle.gov/
+## 5
+## councilconnection.seattle.gov/
+## 5
+## filmandmusic.seattle.gov/
+## 5
+## gonzalez.seattle.gov/
+## 5
+## homebase.seattle.gov/
+## 5
+## igxdev8.seattle.gov/
+## 5
+## www.mayor.seattle.gov/
+## 5
+## www.seattle.gov.offcampus.lib.washington.edu/
+## 5
+## capitalprojects.seattle.gov/
+## 4
+## dpdwina307.ad.seattle.gov/
+## 4
+## herbold.seattle.gov/
+## 4
+## johnson.seattle.gov/
+## 4
+## juarez.seattle.gov/
+## 4
+## (Other)
+## 97
+##
+## $pageviews
+## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
+## 1 24 402 66417 2752 4172985 34
+##
+## $unique.pageviews
+## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
+## 1 17 285 28515 2204 3213093 34
+##
+## $average.time.on.page
+## 0:00:00 0:01:11 0:01:18 0.00 0:01:12 0:01:13 0:01:14 0:01:20
+## 134 34 17 17 16 15 13 13 12
+## 0:01:53 0:01:09 0:01:17 0:01:23 0:01:32 0:01:05 0:01:24 0:01:29 0:01:36
+## 12 11 11 11 11 10 10 10 10
+## 0:01:51 0:01:54 0:01:58 0:00:55 0:01:01 0:01:06 0:01:08 0:01:10 0:01:16
+## 10 10 10 9 9 9 9 9 9
+## 0:01:22 0:01:25 0:01:30 0:01:35 0:01:37 0:01:56 0:00:39 0:00:53 0:00:56
+## 9 9 9 9 9 9 8 8 8
+## 0:00:57 0:01:03 0:01:27 0:01:31 0:01:38 0:01:43 0:01:47 0:00:42 0:00:48
+## 8 8 8 8 8 8 8 7 7
+## 0:01:07 0:01:19 0:01:40 0:01:41 0:01:42 0:01:45 0:01:50 0:01:52 0:02:00
+## 7 7 7 7 7 7 7 7 7
+## 0:02:04 0:02:31 0:00:31 0:00:54 0:00:59 0:01:21 0:01:26 0:01:44 0:01:48
+## 7 7 6 6 6 6 6 6 6
+## 0:01:59 0:02:06 0:02:07 0:02:23 0:02:35 0:00:08 0:00:38 0:01:00 0:01:02
+## 6 6 6 6 6 5 5 5 5
+## 0:01:04 0:01:33 0:01:34 0:01:39 0:01:46 0:02:09 0:02:12 0:02:19 0:02:21
+## 5 5 5 5 5 5 5 5 5
+## 0:02:27 0:02:29 0:02:42 0:02:47 0:02:51 0:02:54 0:03:03 0:00:11 0:00:12
+## 5 5 5 5 5 5 5 4 4
+## 0:00:20 0:00:27 0:00:33 0:00:41 0:00:49 0:00:50 0:00:58 0:01:15 0:01:28
+## 4 4 4 4 4 4 4 4 4
+## (Other)
+## 350
+##
+## $bounce.rate
+## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
+## 0.00 24.89 65.75 430.47 79.32 10000.00 34
+##
+## $exit.percent
+## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
+## 0.00 17.67 42.09 347.91 62.37 10000.00 34
+##
+## $month
+## 01/01/2015 12:00:00 AM 01/01/2016 12:00:00 AM
+## 34 84 84
+## 02/01/2015 12:00:00 AM 02/01/2016 12:00:00 AM 03/01/2015 12:00:00 AM
+## 78 79 80
+## 03/01/2016 12:00:00 AM 04/01/2015 12:00:00 AM 04/01/2016 12:00:00 AM
+## 88 83 87
+## 05/01/2015 12:00:00 AM 06/01/2015 12:00:00 AM 07/01/2015 12:00:00 AM
+## 75 84 85
+## 08/01/2015 12:00:00 AM 09/01/2015 12:00:00 AM 10/01/2015 12:00:00 AM
+## 70 84 77
+## 12/01/2015 12:00:00 AM
+## 70</code></pre>
+<pre class="r"><code>lapply(mobile, summary)</code></pre>
+<pre><code>## $Operating_System
+## Android Bada BlackBerry
+## 34 17 4 17
+## Firefox OS iOS LG LGE
+## 5 10 12 1
+## MOT Nintendo 3DS Nokia (not set)
+## 1 7 16 17
+## Playstation Vita Samsung Series40 SymbianOS
+## 12 17 10 17
+## Windows Windows Phone
+## 17 17
+##
+## $Sessions
+## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
+## 6 16 217 38469 10718 519563 34
+##
+## $New_Sessions
+## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
+## 0.44 45.53 84.62 72.65 100.00 100.00 34
+##
+## $New_Users
+## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
+## 6 13 124 17575 4853 236550 34
+##
+## $Bounce_Rate
+## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
+## 0.00 53.85 62.98 66.21 84.62 100.00 34
+##
+## $PagesPerSession
+## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
+## 1.000 1.210 1.860 2.082 2.500 9.000 34
+##
+## $AvgSessionDuration
+## 0:00:00 0:00:06 0:00:41 0:01:06 0:01:21 0:01:45 0:01:50 0:02:00
+## 46 34 3 3 3 3 3 3 3
+## 0:00:04 0:00:09 0:00:25 0:00:42 0:01:01 0:01:05 0:01:07 0:01:09 0:01:20
+## 2 2 2 2 2 2 2 2 2
+## 0:01:46 0:01:56 0:02:02 0:02:06 0:02:40 0:02:49 0:03:01 0:03:05 0:03:53
+## 2 2 2 2 2 2 2 2 2
+## 0:00:02 0:00:14 0:00:17 0:00:20 0:00:21 0:00:24 0:00:26 0:00:29 0:00:32
+## 1 1 1 1 1 1 1 1 1
+## 0:00:34 0:00:38 0:00:40 0:00:43 0:00:44 0:00:46 0:00:48 0:00:49 0:00:50
+## 1 1 1 1 1 1 1 1 1
+## 0:00:52 0:00:55 0:00:56 0:01:03 0:01:08 0:01:12 0:01:14 0:01:16 0:01:19
+## 1 1 1 1 1 1 1 1 1
+## 0:01:24 0:01:25 0:01:26 0:01:28 0:01:29 0:01:33 0:01:34 0:01:35 0:01:37
+## 1 1 1 1 1 1 1 1 1
+## 0:01:41 0:01:42 0:01:51 0:01:52 0:01:54 0:02:01 0:02:03 0:02:05 0:02:08
+## 1 1 1 1 1 1 1 1 1
+## 0:02:09 0:02:10 0:02:11 0:02:13 0:02:14 0:02:15 0:02:17 0:02:18 0:02:19
+## 1 1 1 1 1 1 1 1 1
+## 0:02:24 0:02:26 0:02:34 0:02:39 0:02:47 0:02:48 0:02:52 0:02:56 0:02:57
+## 1 1 1 1 1 1 1 1 1
+## 0:03:04 0:03:07 0:03:14 0:03:18 0:03:21 0:03:25 0:03:26 0:03:29 0:03:36
+## 1 1 1 1 1 1 1 1 1
+## (Other)
+## 22
+##
+## $Month
+## 01/01/2015 12:00:00 AM 01/01/2016 12:00:00 AM
+## 34 15 9
+## 02/01/2015 12:00:00 AM 02/01/2016 12:00:00 AM 03/01/2015 12:00:00 AM
+## 13 11 15
+## 03/01/2016 12:00:00 AM 04/01/2015 12:00:00 AM 04/01/2016 12:00:00 AM
+## 9 12 10
+## 05/01/2015 12:00:00 AM 06/01/2015 12:00:00 AM 07/01/2015 12:00:00 AM
+## 11 14 12
+## 07/01/2016 12:00:00 AM 08/01/2015 12:00:00 AM 08/01/2016 12:00:00 AM
+## 9 14 10
+## 09/01/2015 12:00:00 AM 10/01/2015 12:00:00 AM 12/01/2015 12:00:00 AM
+## 10 12 11</code></pre>
+</div>
+<div id="pc3" class="section level2">
+<h2>PC3</h2>
+<p>First let’s create a table/array using <code>tapply</code> that sums pageviews per month across all the sites:</p>
+<pre class="r"><code>total.views.bymonth.tbl <- tapply(total$pageviews, total$month, sum)