fit.iris.lm <- lm(Sepal.Length ~ Petal.Length + Petal.Width, iris)
summary(fit.iris.lm)
This gives us the following output:
I'm looking for a way to copy/paste the coefficients table from R console to Excel by highlighting the table and then Ctrl+C/Ctrl+V-ing it into Excel.
However, upon pasting it into Excel, all the columns are condensed into a single column:
I am looking for a way to copy/paste this output into Excel with all columns (Estimate, Std. Error) retained instead of condensed in one column and I am specifically looking for a way to do this without using any R functions for exporting tables (like write_xlsx)
or any other similar functions - I just want to copy and paste it.
You can't avoid using any function but if you just want something you can neatly paste you can use broom::tidy()
to convert the values into a tibble and clipr::write_clip()
to copy it to the clipboard.
library(broom)
library(clipr)
library(magrittr)
lm(Sepal.Length ~ Petal.Length + Petal.Width, iris) %>%
tidy() %>%
write_clip()
Pasted into Excel:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With