average_weighted_by_user: For getting average by user.

Description Usage Arguments Value

View source: R/functions.R

Description

Some users give more than one rating. This gloms all ratings by a given user (determined by Email) together and then gives the average fraction of users who have rated positively in at least one rating.

Usage

1
2
average_weighted_by_user(df, pcol, per_options = "Yes",
  ignore_options = "Decline to state", dropNA = TRUE)

Arguments

df

dataframe, data of interest

pcol

numeric, the number of df's column containing the question of interest.

per_options

vector, all the strings in df[[pcol]] that are counted when the percentage is calculated.

ignore_options

string (or vector of strings), the factors to ignore during calculations.

dropNA

logical, if TRUE, applies tidyr::drop_na(df, pcol).

Value

A numeric value, the fraction of users who have given positive responses.


IskanderBlue/morseldash documentation built on Oct. 30, 2019, 7:24 p.m.