In this work, we study the thermodynamic topology of a static, a charged static and a charged, rotating black hole in f(R) gravity. For charged static black holes, we work in two different ensembles: fixed charge(q) ensemble and fixed potential(φ) ensemble. For charged, rotating black hole, four different types of ensembles are considered: fixed (q, J), fixed (φ, J), fixed (q, Ω) and fixed (φ, Ω) ensemble, where J and Ω denotes the angular momentum and the angular frequency respectively. Using the generalized off-shell free energy method, where the black holes are treated as topological defects in their thermodynamic spaces, we investigate the local and global topology of these black holes via the computation of winding numbers at these defects. For static black hole we work in three model. We find that the topological charge for a static black hole is always −1 regardless of the values of the thermodynamic parameters and the choice of f(R) model. For a charged static black hole, in the fixed charge ensemble, the topological charge is found to be zero. Contrastingly, in the fixed φ ensemble, the topological charge is found to be −1. For charged static black holes, in both the ensembles, the topological charge is observed to be independent of the thermodynamic parameters. For charged, rotating black hole, in fixed (q, J) ensemble, the topological charge is found to be 1. In (φ, J) ensemble, we find the topological charge to be 1. In case of fixed (q, Ω) ensemble, the topological charge is 1 or 0 depending on the value of the scalar curvature(R). In fixed (Ω, φ) ensemble, the topological charge is −1, 0 or 1 depending on the values of R, Ω and φ. Therefore, we conclude that the thermodynamic topologies of the charged static black hole and charged rotating black hole are influenced by the choice of ensemble. In addition, the thermodynamic topology of the charged rotating black hole also depends on the thermodynamic parameters.