I don't know what is wrong with my code. but i get this error:
> Visitas_Por_Fuente %>% ggvis(~Campanas1, ~sessions) %>% layer_bars()
Error in .subset2(x, i, exact = exact) : subscript out of bounds
I just want to create a bar graphic, that shows how many sessions by source do we have.
I use this code (but 'im not seeing the graph):
i've a data.frame that contains the following types of data:
Visitas_Por_Fuente %>% ggvis(~Campanas1, ~sessions) %>% layer_bars()
And this is the output for the str() function on my data.frame:
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 4177 obs. of 8 variables:
$ date : Date, format: "2014-09-01" "2014-09-01" "2014-09-01" ...
$ dayOfWeekName: chr "Monday" "Monday" "Monday" "Monday" ...
$ userType : chr "New Visitor" "New Visitor" "New Visitor" "New Visitor" ...
$ source : chr "(direct)" "amazon.es" "bing" "col128.mail.live.com" ...
$ Medium : chr "(none)" "referral" "organic" "referral" ...
$ campaign : chr "(not set)" "(not set)" "(not set)" "(not set)" ...
$ sessions : num 97 1 2 1 5 2 124 1 35 1 ...
$ Campanas1 : Factor w/ 7 levels "Adwords","Campañas",..: 3 5 6 4 5 7 6 7 5 5 ...
head(Visitas_Por_Fuente)
Source: local data frame [6 x 8]
date dayOfWeekName userType source Medium campaign sessions Campanas1
1 2014-09-01 Monday New Visitor (direct) (none) (not set) 97 Directo
2 2014-09-01 Monday New Visitor amazon.es referral (not set) 1 Referencias
3 2014-09-01 Monday New Visitor bing organic (not set) 2 SEO
4 2014-09-01 Monday New Visitor col128.mail.live.com referral (not set) 1 Email
5 2014-09-01 Monday New Visitor eloi.go.com referral (not set) 5 Referencias
6 2014-09-01 Monday New Visitor facebook.com referral (not set) 2 Social Media