Low-dimensional quantum systems can host anyons, particles with exchange statistics that are neither bosonic nor fermionic. However, the physics of anyons in one dimension remains largely unexplored. In this work, we realize Abelian anyons in one dimension with arbitrary exchange statistics using ultracold atoms in an optical lattice, where we engineer the statistical phase through a density-dependent Peierls phase. We explore the dynamical behavior of two anyons undergoing quantum walks and observe the anyonic Hanbury Brown-Twiss effect as well as the formation of bound states without on-site interactions. Once interactions are introduced, we observe spatially asymmetric transport in contrast to the symmetric dynamics of bosons and fermions. Our work forms the foundation for exploring the many-body behavior of one-dimensional anyons.