Learn R Programming

rvkstat (version 3.2.0)

vkGetGroupStatGenderAge: Statistics on Age Groups And Gender of The 'VKontakte' Community.

Description

Provide to load to download statistics on the sex and age group of community visitors by date.

Usage

vkGetGroupStatGenderAge(
  date_from    = Sys.Date() - 7, 
  date_to      = Sys.Date(), 
  group_id     = NULL, 
  interval     = "day",
  intervals_count = NULL,
  filters      = NULL,
  stats_groups = c("visitors", "reach", "activity"),
  username     = getOption("rvkstat.username"),
  api_version  = getOption("rvkstat.api_version"),
  token_path   = vkTokenPath(),
  access_token = getOption("rvkstat.access_token")
)

Arguments

date_from

The starting date of the displayed statistics in the format YYYY-MM-DD.

date_to

The end date of the displayed statistics in the format YYYY-MM-DD.

group_id

Community ID.

interval

Time intervals. Possible values: day, week, month, year, all.

intervals_count

Number of time intervals.

filters

A list of words separated by commas

stats_groups

Filter for getting data on a specific block of community statistics. Possible values: visitors, reach, activity.

username

Your vkontakte login.

api_version

Vkontakte API version.

token_path

Path to dir with credentials

access_token

API access tokens obtained using vkAuth or vkGetToken functions

Value

Date frame with statistics on community visitors with the following values:

1. Date

the date for which statistics are given.

2. Visitors

number of unique visitors.

3. Gender

gender ("m" is male, "f" is female).

4. AgeGroup

age interval.

References

Documentation for API method stats.get: https://vk.com/dev/stats.get

Examples

Run this code
# NOT RUN {
## Loading data by users by gender and age group
communityDataGenderAge <- vkGetGroupStatGenderAge(
                            date_from = "2016-01-01",
                            date_to = "2016-04-01",
                            group_id = 1,
                            access_token = my_tok$access_token)
# }

Run the code above in your browser using DataLab