Plotting survival curves. Fitting a regularized Cox model using glmnet with family = "cox" returns an object of class "coxnet".Class "coxnet" objects have a survfit method which allows the user to visualize the survival curves from the model. In addition to the "coxnet" object, the user must pass the x and y objects used to fit the model (for computation of the baseline hazard), as well as …