  The $p_{\rm T}$-differential production cross section of prompt $\Lambda_{\rm
c}^+$ charmed baryons was measured with the ALICE detector at the Large Hadron
Collider (LHC) in pp collisions at $\sqrt{s} = 7$ TeV and in p-Pb collisions at
$\sqrt{s_{\rm NN}} = 5.02$ TeV at midrapidity. The $\Lambda_{\rm c}^+$ and
${\overline{\Lambda}}_{\rm c}^-$ were reconstructed in the hadronic decay modes
$\Lambda_{\rm c}^+\rightarrow {\rm p}{\rm K^-}\pi^+$, $\Lambda_{\rm
c}^+\rightarrow {\rm p}{\rm K_{\rm S}^0}$ and in the semileptonic channel
$\Lambda_{\rm c}^+\rightarrow {\rm e^+}\nu_{\rm e}\Lambda$ (and charge
conjugates). The measured values of the $\Lambda_{\rm c}^+/{\rm D_0}$ ratio,
which is sensitive to the c-quark hadronisation mechanism, and in particular to
the production of baryons, are presented and are larger than those measured
previously in different colliding systems, centre-of-mass energies, rapidity
and $p_{\rm T}$ intervals, where the $\Lambda_{\rm c}^+$ production process may
differ. The results are compared with the expectations obtained from
perturbative Quantum Chromodynamics calculations and Monte Carlo event
generators. Neither perturbative QCD calculations nor Monte Carlo models
reproduce the data, indicating that the fragmentation of heavy-flavour baryons
is not well understood. The first measurement at the LHC of the $\Lambda_{\rm
c}^+$ nuclear modification factor, $R_{\rm pPb}$, is also presented. The
$R_{\rm pPb}$ is found to be consistent with unity and with that of D mesons
within the uncertainties, and consistent with a theoretical calculation that
includes cold nuclear matter effects and a calculation that includes charm
quark interactions with a deconfined medium.
