R-vs-Python | repository contains several code examples comparing R
kandi X-RAY | R-vs-Python Summary
kandi X-RAY | R-vs-Python Summary
This repository contains several code examples comparing R and Python for data science and visualization.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of R-vs-Python
R-vs-Python Key Features
R-vs-Python Examples and Code Snippets
Community Discussions
Trending Discussions on R-vs-Python
QUESTION
I am using the R programming language. I am trying to follow this tutorial over here: https://rviews.rstudio.com/2017/09/25/survival-analysis-with-r/ (bottom of the page).
I have slightly modified the code for this tutorial and have plotted the "staircases" (i.e. "survival functions", in the below picture "red", "blue", "green") corresponding to 3 of the observations in the data:
...ANSWER
Answered 2020-Dec-25 at 23:39The issue is that when you draw a plot in base
graphics draw directly on a device. The line of your code grob= plot(r_fit$unique.death.times, pred[1,], type = "l", col = "red")
creates a NULL
object (unlike ggplot
which would return a plot object).
You can make the plot directly in ggplot
(there are a few ways of doing this but I've done a simple example bolow) and convert it with ggplotly
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install R-vs-Python
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page