Relative Content

Tag Archive for rdplyrdata-wrangling

Add values across dataframe columns

I have a dataframe where missingness in indicated by “Z” (there may also be some “z” and NA entries present in the data), and values are entered as characters (“0”, “1”, etc). I need to create scores (“updrs1”, “updrs2″, updrs3”) that add up the non-missing values across columns selected by colname prefix (“NP1”, “NP2”, “NP3”).

R flag a change in column value

I have the following dataset with 20 million rows. It’s data on companies and user by month.
I have created first_app_company, which flags first appeareance of a company in the dataset. The code is as follows