I am not aware of any relevant sample code in R for IPUMS on this specific request and am not an R user. However, I am linking a page with information on calculating a weighted median in R. It looks to me like your code on this forum post restricts your data file to waitstaff and first a weighted average hourly wage, then determines the median for the weighted hourly wage.
For general R resources, you might be interested in the R data training exercises for IPUMS CPS, Quick-R (https://www.statmethods.net/), or R4DS.