Closed anujkhare closed 7 years ago
Hey @anujkhare the tidymatrix you have proposed sounds reasonable for your plotting purposes, but strictly speaking it is not "tidy" since tidy functions always return data.frame (not matrix). right now you have a column for each variable, right? to make that tidy you would have to convert it to a tall format data.frame, for example
tidy.df <- with(fit, data.frame(
weight=as.numeric(t(beta)),
lambda,
arclength=colSums(abs(beta[-1,])),
variable=rownames(beta)[as.integer(col(t(beta)))]))
library(ggplot2)
ggplot()+
geom_point(aes(arclength, weight, color=variable),
data=tidy.df)
looks great @anujkhare !
@tdhock Is this method like what you had in mind for the tidy matrix output? It returns a single matrix with lambda, n_iters, scale, loglik, arclength, beta columns.
Could you please review?