I have a question regarding choosing a license for my R package. I started putting together some R functions that I wrote during my Master's thesis. One of the function I want to include is a modified version of a function from a GPL-3 licensed package, which differs from the original by only a few lines of code. My idea was to add the package as a public repository on my GitHub to allow people from my lab to install and access it easily. At first, I thought about a private repository, but since most of the people I worked with do not have a GitHub account, that is not a viable solution.
I have absolutely no experience with licensing and legal issues, but if I understand the copyleft concept underlying the GPL licenses correctly, I am allowed to share modified versions of other GPL-licensed packages as long as I also release them under the same GPL license and share the source code. Is my interpretation correct?