The associated production of a W boson with a jet originating from either a light parton or heavy-flavor quark is studied in the forward region using proton-proton collisions. The analysis uses data corresponding to integrated luminosities of 1.0 and 2.0fb-1 collected with the LHCb detector at center-of-mass energies of 7 and 8 TeV, respectively. The W bosons are reconstructed using the W→μν decay and muons with a transverse momentum, pT, larger than 20 GeV in the pseudorapidity range 2.0<η<4.5. The partons are reconstructed as jets with pT>20GeV and 2.2<η<4.2. The sum of the muon and jet momenta must satisfy pT>20GeV. The fraction of W+jet events that originate from beauty and charm quarks is measured, along with the charge asymmetries of the W+b and W+c production cross sections. The ratio of the W+jet to Z+jet production cross sections is also measured using the Z→μμ decay. All results are in agreement with Standard Model predictions.