AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Create r package rstudio12/20/2023 Cs(so, it, goes) creates c("so", "it", "goes"). Two of my favorites: describe, a more robust summary function, and Cs, which creates a vector of quoted character strings from unquoted comma-separated text. There are a number of useful functions in here. Each cell is imported in its own row, with information about data type, position, and color, not just value, allowing you to reshape the data from there. If you've ever wanted to tear your hair out over an Excel file with merged cells, data in column headers, headers mixed in data, and key information in color coding, this is the package for you. Rio has a good idea: Pull a lot of separate data-reading packages into one, so you just need to remember 2 functions: import and export. Hadley Wickham (readr), Jim Hester (vroom) Read_csv(myfile.csv) or vroom(myfile.csv) data.table's fread() is another useful alternative. readr has been around for awhile vroom is a speedier alternative, useful for larger data sets. Read_excel("my-spreadsheet.xls", sheet = 1)īase R handles most of these functions but if you have huge files, these packages offer faster and standardized way to read CSVs and similar files into R. Map_df(mylist, myfunction) More: Charlotte Wickham's purr tutorial video, the purrr cheat sheet PDF download, easy error checking with purrr's possibly.įast way to read Excel files in R, without dependencies such as Java. And, its functions are more standardized than base R's apply family - plus it's got functions for tasks like error-checking. It's more complex to learn than the older plyr package, but also more robust. Purrr makes it easy to apply a function to each item in a list and return results in the format of your choice. Especially useful for operating on data by categories. The essential data-munging R package when working with data frames.
0 Comments
Read More
Leave a Reply. |