# ggsurvplot: Round n.risk for weighted data

#### azalea

##### New Member
Hi all,

I'm creating Kaplan-Meier plots with ggsurvplot on weighted data. When I add the risk.table (showing the number at risk over time) I get long decimals because of the weighted data. Is there a way to round the number at risk in the risk.table? I've tried overriding the ggrisktable function, adding a line "survsummary$n.risk=round(survsummary$n.risk)", though that doesn't seem to change anything (I'm not sure whether it's possible to override this function, or how to properly do it).

Any help is greatly appreciated!

UPDATE: This has been resolved! I added "survsummary$n.risk=round(survsummary$n.risk)" to the ggrisktable function, and made sure to properly redefine it.

Last edited: