print to console tables that can be easily copied and pasted to Excel

3 years ago by CthulhuDreamer to c/r_programming

There is a function format_csv in package readr, which outputs csv formated output to string. It can be used as

to_console<-function(dta){
 cat(readr::format_csv(dta))
}


dta |> someoperation() |> to_console()
morcution 4 points 3 years ago

I use clipr::write_clip and clipr::read_clip - can paste to excel but also read in something you've copied from excel.

Helpful when you have a client with poorly formatted excel files, to the point that readxl won't do the job 😭

path: 0 1574875, hotness: undefined, score: 4, children: 1
boredScientist 2 points 3 years ago

Seconding clipr, it's my go-to for when i just need to quickly check or transferring something to and from Excel.

path: 0 1574875 1574931, hotness: undefined, score: 2, children: 0
r_programming
r_programming

@programming.dev

login for more options
314
44
1

Please use this as a forum to discuss R, and learn more about it. If you have any questions about how to do specific things in R, this is the place to ask.

Getting Started

You can download R here.

You can download RStudio here. RStudio IDE, which is supported by Posit PBC, is a powerful and well-developed IDE for R. Other development environment options include Emacs addon Emacs Speak Statistics and VSCode.

Other Communities

Other communities that may be of interest across the fediverse:

Please send @a_statistician a message to recommend additional communities to add to this list.

Learning resources:

  • R for Data Science - a good introductory book for learning R. Start here if you're overwhelmed.
  • Big Book of R - collection of more than 500 online books/tutorials covering various aspects of R. Some links are to paid books with previews, but most links are to free online textbooks.

go to feed...