Rare-earth nickelates possess intrinsic charge order, orbital order, and electron-lattice coupling, which make them very interesting for applications in oxide-based electronic devices. In this study, we grew NdNiO3-δ (NNO) films with oxygen pressures changing from 27 to 10-5 Pa. With decreasing oxygen pressure, the antiferromagnetic state of the NNO film becomes a ferromagnetic state, and the resistance increases significantly. According to combined X-ray absorption spectroscopy and X-ray linear dichroism measurements, the ratio of Ni2+-ions increases with decreasing oxygen-pressure, and the preferred orbital occupation changes from x2-y2 to 3z2-r2. In addition, using the ionic-liquid gating method to control the migration of oxygen vacancies, both the magnetic properties and resistance of NNO films can be modulated reversibly. The oxygen vacancy induces a valence in the Ni ions and the orbital occupation changes, which alters the magnetic properties and the electronic transport in these NNO films. This study describes a novel tunable method for electronic devices that use NdNiO3-δfilms, and opens new doors for future improvements and functionalities.