{"id":29628184,"url":"https://github.com/jinseob2kim/jskm","last_synced_at":"2026-03-17T07:17:54.364Z","repository":{"id":56934525,"uuid":"139862284","full_name":"jinseob2kim/jskm","owner":"jinseob2kim","description":"R package for Kaplan-Meier Plot: Modified ggkm","archived":false,"fork":false,"pushed_at":"2025-11-28T09:28:37.000Z","size":16934,"stargazers_count":29,"open_issues_count":3,"forks_count":22,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-23T05:18:56.011Z","etag":null,"topics":["kaplan-meier-plot","r","weighted-kaplan-meier-plot"],"latest_commit_sha":null,"homepage":"https://jinseob2kim.github.io/jskm/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jinseob2kim.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-07-05T14:38:14.000Z","updated_at":"2025-12-24T08:32:09.000Z","dependencies_parsed_at":"2023-02-18T17:45:53.473Z","dependency_job_id":"fbd7b481-d422-4694-9404-594a89b45e13","html_url":"https://github.com/jinseob2kim/jskm","commit_stats":{"total_commits":140,"total_committers":5,"mean_commits":28.0,"dds":0.07857142857142863,"last_synced_commit":"9bd86bb0b15c1b5d4f9aebf8e7a56046a4a8f66b"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/jinseob2kim/jskm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinseob2kim%2Fjskm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinseob2kim%2Fjskm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinseob2kim%2Fjskm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinseob2kim%2Fjskm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jinseob2kim","download_url":"https://codeload.github.com/jinseob2kim/jskm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinseob2kim%2Fjskm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29329766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kaplan-meier-plot","r","weighted-kaplan-meier-plot"],"created_at":"2025-07-21T08:35:17.175Z","updated_at":"2026-02-11T08:14:57.962Z","avatar_url":"https://github.com/jinseob2kim.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"jskm\"\noutput: github_document\neditor_options: \n  chunk_output_type: console\n---\n\nKaplan-Meier Plot with 'ggplot2': 'survfit' and 'svykm' objects from 'survival' and 'survey' packages.\n\n\u003c!-- badges: start --\u003e\n[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/jinseob2kim/jskm?branch=master\u0026svg=true)](https://ci.appveyor.com/project/jinseob2kim/jskm)\n[![Github action](https://github.com/jinseob2kim/jskm/workflows/R-CMD-check/badge.svg)](https://github.com/jinseob2kim/jskm/actions)\n[![CRAN\\_Status\\_Badge](https://www.r-pkg.org/badges/version/jskm)](https://cran.r-project.org/package=jskm)\n[![CRAN\\_Download\\_Badge](https://cranlogs.r-pkg.org/badges/jskm)](https://CRAN.R-project.org/package=jskm)\n[![codecov](https://codecov.io/github/jinseob2kim/jskm/branch/master/graphs/badge.svg)](https://app.codecov.io/github/jinseob2kim/jskm)\n[![GitHub issues](https://img.shields.io/github/issues/jinseob2kim/jskm.svg)](https://github.com/jinseob2kim/jskm/issues)\n[![GitHub stars](https://img.shields.io/github/stars/jinseob2kim/jskm.svg)](https://github.com/jinseob2kim/jskm/stargazers)\n[![GitHub license](https://img.shields.io/github/license/jinseob2kim/jskm.svg)](https://github.com/jinseob2kim/jskm/blob/master/LICENSE)\n\u003c!-- badges: end --\u003e\n\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE, message = F, warning = F, fig.path = \"man/figures/README-\")\n# library(jskm)\nlibrary(ggplot2)\nlibrary(survival)\nlibrary(ggpubr)\nlibrary(survey)\nlibrary(patchwork)\nlibrary(cmprsk)\nlibrary(ggsci)\nsource(\"R/jskm.R\")\nsource(\"R/svyjskm.R\")\nsource(\"R/adjustedLR.R\")\n```\n\n\n## Install\n```r\ninstall.packages(\"jskm\")\n\n## From github: latest version\ninstall.packages(\"remotes\")\nremotes::install_github(\"jinseob2kim/jskm\")\n\nlibrary(jskm)\n```\n\n\n## Example\n\n### Survival probability\n```{r}\n# Load dataset\nlibrary(survival)\ndata(colon)\nfit \u003c- survfit(Surv(time, status) ~ rx, data = colon)\n\n# Plot the data\njskm(fit)\njskm(fit,\n  table = T, pval = T, med = T, label.nrisk = \"No. at risk\", size.label.nrisk = 8,\n  xlabs = \"Time(Day)\", ylabs = \"Survival\", ystratalabs = c(\"Obs\", \"Lev\", \"Lev + 5FU\"), ystrataname = \"rx\",\n  marks = F, timeby = 365, xlims = c(0, 3000), ylims = c(0.25, 1), showpercent = T\n)\n```\n\n### Cumulative hazard: 1- Survival probability\n```{r}\njskm(fit, ci = T, cumhaz = T, marks = F, surv.scale = \"percent\", pval = T, pval.size = 6, pval.coord = c(300, 0.7))\n```\n\n### Landmark analysis \n\n```{r}\njskm(fit, marks = F, surv.scale = \"percent\", pval = T, table = T, cut.landmark = 500)\njskm(fit, marks = F, surv.scale = \"percent\", pval = T, table = T, cut.landmark = 500, showpercent = T)\n```\n\n### Competing risk analysis\n\n`status2` variable: 0 - censoring, 1 - event, 2 - competing risk\n```{r}\n## Make competing risk variable, Not real\ncolon$status2 \u003c- colon$status\ncolon$status2[1:400] \u003c- 2\ncolon$status2 \u003c- factor(colon$status2)\nfit2 \u003c- survfit(Surv(time, status2) ~ rx, data = colon)\njskm(fit2, marks = F, surv.scale = \"percent\", table = T, status.cmprsk = \"1\")\njskm(fit2, marks = F, surv.scale = \"percent\", table = T, status.cmprsk = \"1\", showpercent = T, cut.landmark = 500)\n```\n\n### Theme \n\n#### JAMA\n\n```{r}\njskm(fit, theme = \"jama\", cumhaz = T, table = T, marks = F, surv.scale = \"percent\", pval = T, pval.size = 6, pval.coord = c(300, 0.7))\n```\n\n#### NEJM\n\n```{r}\njskm(fit, theme = \"nejm\", nejm.infigure.ratiow = 0.7, nejm.infigure.ratioh = 0.4, nejm.infigure.ylim = c(0, 0.7), cumhaz = T, table = T, marks = F, surv.scale = \"percent\", pval = T, pval.size = 6, pval.coord = c(300, 0.7))\n```\n\n### Weighted Kaplan-Meier plot - `svykm.object` in **survey** package\n\n```{r}\nlibrary(survey)\ndata(pbc, package = \"survival\")\npbc$randomized \u003c- with(pbc, !is.na(trt) \u0026 trt \u003e 0)\nbiasmodel \u003c- glm(randomized ~ age * edema, data = pbc)\npbc$randprob \u003c- fitted(biasmodel)\n\ndpbc \u003c- svydesign(id = ~1, prob = ~randprob, strata = ~edema, data = subset(pbc, randomized))\n\ns1 \u003c- svykm(Surv(time, status \u003e 0) ~ 1, design = dpbc)\ns2 \u003c- svykm(Surv(time, status \u003e 0) ~ sex, design = dpbc)\n\nsvyjskm(s1)\nsvyjskm(s2, pval = T, table = T, design = dpbc)\nsvyjskm(s2, cumhaz = T, surv.scale = \"percent\", pval = T, design = dpbc, pval.coord = c(300, 0.7), showpercent = T)\n```\n\nIf you want to get **confidence interval**, you should apply `se = T` option to `svykm` object.\n\n```{r}\ns3 \u003c- svykm(Surv(time, status \u003e 0) ~ sex, design = dpbc, se = T)\nsvyjskm(s3)\nsvyjskm(s3, ci = F)\nsvyjskm(s3, ci = F, surv.scale = \"percent\", pval = T, table = T, cut.landmark = 1000, showpercent = T)\n```\n\n### Theme \n\n#### JAMA\n```{r}\nsvyjskm(s2, theme = \"jama\", pval = T, table = T, design = dpbc)\n```\n\n#### NEJM\n\n```{r}\nsvyjskm(s2, theme = \"nejm\", nejm.infigure.ratiow = 0.45, nejm.infigure.ratioh = 0.4, nejm.infigure.ylim = c(0.2, 1), pval = T, table = T, design = dpbc)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinseob2kim%2Fjskm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjinseob2kim%2Fjskm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinseob2kim%2Fjskm/lists"}