├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CRAN.png ├── DownloadR.png ├── ExcelImport1.png ├── ExcelImport2.png ├── How-To-Use-R-With-Excel.Rmd ├── How-To-Use-R-With-Excel.html ├── InstallPackage_readxl.png ├── LICENSE ├── LinuxR1.png ├── MacR1.png ├── RDataStructures.png ├── README.md ├── RGui.png ├── RStudioGuide.png ├── WindowsR1.png └── WindowsR2.png /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at hello@alyssacolumbus.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Welcome! This is a repository I've put together with resources that have helped me learn R from Excel. I hope that it will grow over time, and I'd love for other people to help make it the best it can be. I want to be accessible to the broader community and cognizant of different learning styles, and I'm hoping you can help with that! 4 | 5 | ## Want to contribute? 6 | 7 | There are two ways you can contribute to this repository: 8 | 9 | 1. Submit a pull request. 10 | 11 | In your pull request, please add your content around the existing content. I likely won't accept a pull request that deletes something I've already written. Also, add a short note about why you think this content should be included! 12 | 13 | [How do I submit a pull request?](https://help.github.com/articles/creating-a-pull-request/) 14 | 15 | 2. Add an issue. 16 | 17 | If you're not sure how to submit a pull request or just want to suggest a more general thing (e.g. a new organization strategy), issues are a great way to do that! If you're submitting a new section or piece of content, add a link and a short bit about how it's helped you. If you're suggesting something broader, I'd love to hear your thoughts! 18 | 19 | ## What can I contribute? 20 | 21 | * Links! I'm especially looking for links to relevant courses and tutorials. 22 | 23 | * Code snippets. 24 | * Learn something cool? Find a shortcut? Leave lots of comments so I can follow your thought process and post it here! Either find a section you think it goes in or create a new one. 25 | 26 | * Something helpful I haven't thought of? Let me know! 27 | -------------------------------------------------------------------------------- /CRAN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/CRAN.png -------------------------------------------------------------------------------- /DownloadR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/DownloadR.png -------------------------------------------------------------------------------- /ExcelImport1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/ExcelImport1.png -------------------------------------------------------------------------------- /ExcelImport2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/ExcelImport2.png -------------------------------------------------------------------------------- /How-To-Use-R-With-Excel.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "How To Use R With Excel" #Moving from Excel to R 3 | subtitle:
A Comprehensive Guide to Transitioning from Excel to R\h 4 | author: "Alyssa Columbus" 5 | date: '`r format(Sys.Date(), "%B %d, %Y")`' 6 | output: 7 | html_document: 8 | df_print: paged 9 | toc: TRUE 10 | toc_float: TRUE 11 | toc_depth: '4' 12 | --- 13 | 14 | ```{r setup, include=FALSE} 15 | knitr::opts_chunk$set(echo = TRUE) 16 | ``` 17 | 18 | 56 | 57 | # 0. Prerequisites 58 | Before you get started, make sure you have [R](https://www.r-project.org/) and [RStudio](https://www.rstudio.com/) installed on your machine. If you don't have these installed on your machine, the following are instructions for you to install this software. 59 | 60 | ## 0.1 Installing R 61 | R is a powerful, open-source statistical programming language that anyone can download for free! You can simply go to [CRAN's website](https://www.r-project.org/) and install R by following these steps: 62 | 63 | ### 0.1.1 Under the 'Download' heading, select 'CRAN' 64 | ![](CRAN.png) 65 | 66 | ### 0.1.2 Install a CRAN Mirror 67 | 68 | Install the CRAN mirror that's nearest to your geographic location. For example, if you live in Orange County, California, you should install the [UCLA CRAN Mirror.](http://cran.stat.ucla.edu/) 69 | 70 | ### 0.1.3 Install your Machine's Version of R 71 | ![](DownloadR.png) 72 | 73 | #### 0.1.3.1 R for Windows 74 | ![Install R for the first time.](WindowsR1.png) 75 | 76 | ![After you click this link, follow the instructions given in the installation.](WindowsR2.png) 77 | 78 | #### 0.1.3.2 R for (Mac) OS X 79 | ![After you click this link, follow the instructions given in the installation.](MacR1.png) 80 | 81 | #### 0.1.3.3 R for Linux 82 | ![Install the R version relevant to your Linux server, and follow the instructions given in the installation.](LinuxR1.png) 83 | 84 | ## 0.2 Installing RStudio 85 | RStudio is an open-source professional software that makes R much easier to use. Download the free, open-source license version from [RStudio's website](https://www.rstudio.com/products/rstudio/download/#download). The installation steps are very similar to those of R's for all operating systems. 86 | 87 | # 1. Importing and Exporting Excel Files in R 88 | The open-source community has developed a few smooth and convenient ways for you to upload and download Excel files in R. 89 | 90 | ## 1.1 Importing Excel Files to R 91 | Install the `readxl` package into RStudio by typing 92 | 93 | ```{r, eval=FALSE} 94 | install.packages("readxl") 95 | ``` 96 | 97 | into the Console. 98 | 99 | ![](InstallPackage_readxl.png) 100 | 101 | 102 | 103 | After the package is finished installing, call the package by typing 104 | 105 | ```{r, eval=FALSE} 106 | library(readxl) 107 | ``` 108 | 109 | into the Console. You can now upload your Excel file into R (and assign it to the variable `data`) by typing 110 | 111 | ```{r, eval=FALSE} 112 | data <- read_excel("D:/path/file.xlsx") 113 | ``` 114 | 115 | into the Console. 116 | 117 | Another way you can import an Excel file into R after calling the `readxl` library is to, in RStudio, go to `File > Import Dataset > From Excel`, and browse for your Excel file. 118 | 119 | ![](ExcelImport1.png) 120 | 121 | 122 | After you're satisfied with how your data is being imported, select `Import` on the bottom right of the window, and your Excel data will be imported into R. 123 | 124 | ![](ExcelImport2.png) 125 | 126 | ## 1.2 Exporting Excel Files from R 127 | Install the `openxlsx` package into RStudio by typing 128 | 129 | ```{r, eval=FALSE} 130 | install.packages("openxlsx") 131 | ``` 132 | 133 | into the Console. 134 | 135 | After the package is finished installing, call the package by typing 136 | 137 | ```{r, eval=FALSE} 138 | library(openxlsx) 139 | ``` 140 | 141 | into the Console. You can now download your data (assigned to the variable `data` here) to a custom file name by typing 142 | 143 | ```{r, eval=FALSE} 144 | write.xlsx(data, file = "D:/path/your_file_name.xlsx") 145 | ``` 146 | 147 | into the Console. 148 | 149 | # 2. How to Transition From Excel to R 150 | 151 | ## 2.1 Navigating RStudio 152 | 153 | ![We will be working out of RStudio, a powerful IDE (Integrated Development Environment) for R.](RStudioGuide.png) 154 | 155 | ## 2.2 Data Structures and Variables in R 156 | 157 | ![](RDataStructures.png) 158 | 159 | 160 | Try to get comfortable with the different types of data structures in R. 161 | 162 | Excel spreadsheets are typically recognized as **dataframes** in R, which are composed of multiple lists. 163 | 164 | ### 2.2.1 Creating Your First Dataframe 165 | 166 | Start by creating some lists and assigning them to variables using `<-` (not `=`, as this may confuse R in some function calls): 167 | 168 | ```{r} 169 | teams <- c("Angels","Dodgers","Cubs") # c() command stands for combine; use whenever creating a list of objects in R 170 | wins <- c(70,56,64) 171 | ca_team <- c(TRUE, TRUE, FALSE) 172 | 173 | baseball <- data.frame(teams,wins,ca_team) # combine lists into dataframe 174 | 175 | baseball # view the dataframe 176 | ``` 177 | 178 | Now you have a dataframe with 3 columns, or lists (string, numeric, and boolean). 179 | 180 | ## 2.3 Working with Dataframes 181 | 182 | ### 2.3.1 Looking Up Number of Observations 183 | 184 | Using the `iris` dataset that comes with R, and the `nrow()` function, you can find the number of observations or rows: 185 | 186 | ```{r} 187 | # View(iris) # use this command to view the iris dataset 188 | nrow(iris) # displays the number of rows in the iris dataset 189 | ``` 190 | 191 | Similarly, you can also find the number of columns: 192 | 193 | ```{r} 194 | ncol(iris) # displays the number of columns in the iris dataset 195 | ``` 196 | 197 | To find the number of rows and columns at the same time, use `dim()`: 198 | 199 | ```{r} 200 | dim(iris) 201 | ``` 202 | 203 | ### 2.3.2 Focusing on the First/Last X Rows 204 | 205 | ```{r} 206 | head(iris, 10) # displays the first 10 rows of the iris dataset 207 | tail(iris, 10) # displays the last 10 rows of the iris dataset 208 | ``` 209 | 210 | ### 2.3.3 Looking at the Structure of a Dataframe 211 | 212 | ```{r} 213 | str(iris) # investigate the structure of the iris dataframe 214 | ``` 215 | 216 | ### 2.3.4 Focusing on Certain Columns, Rows, or Cells 217 | 218 | Sometimes you may want to look at a single cell, column, or row. To do so, add brackets to the dataframe in the console, like: 219 | 220 | ```{r, eval=F} 221 | iris[1,3] # look at the value in the 1st row, 3rd column 222 | 223 | iris[1,] # look at all of the values in the 1st row; don't forget the comma! 224 | 225 | iris[,3] # look at all of the values in the 3rd column; iris[3] also works 226 | 227 | iris[1:3,] # look at all of the values in rows 1 through 3; ':' can also be applied to selecting columns 228 | ``` 229 | 230 | A helpful phrase to remember is "Data RoCks!" As in, `Dataframe[Rownumber,Columnnumber]`. 231 | 232 | Most of the time, it's difficult to reference columns by number - especially when there's so many columns. Here are alternative ways to select one or multiple columns: 233 | 234 | ```{r, eval=F} 235 | iris$Sepal.Length # selecting the one Sepal.Length column from the iris dataset 236 | 237 | iris$Sepal.Length[3] # selecting the 3rd value in the Sepal.Length column, or the 3rd row value in the Sepal.Length column 238 | 239 | iris[c("Sepal.Length","Sepal.Width")] # selecting multiple columns (Sepal.Length, Sepal.Width) from the iris dataset 240 | ``` 241 | 242 | ### 2.3.5 Changing the Format of a Column 243 | 244 | Say you imported a dataset from Excel with `$` or `%` signs appended to some numeric values. If you didn't specify these values to be numeric when you imported your dataset, R will likely interpret those values to be strings instead of currency or percentages. This means that R will not be able to perform calculations with these values. 245 | 246 | However, in the R console, you can perform the following short commands to remove `$` or `%` signs and convert the string values to numeric values that can then be used in calculations: 247 | 248 | ```{r,eval=F} 249 | # delete the dollar signs in a currency column in the dataset 250 | dataset$currency <- gsub("\\$", "", dataset$currency) 251 | # change the format of the currency column to numeric 252 | dataset$currency <- as.numeric(dataset$currency) 253 | 254 | # similarly, with percentages, delete the percent signs in a percentages column in the dataset 255 | dataset$percentages <- gsub("\\%", "", dataset$percentages) 256 | # change the format of the percentages column to numeric 257 | dataset$percentages <- as.numeric(dataset$percentages) 258 | ``` 259 | 260 | ### 2.3.6 Sorting a Dataframe Based on One Column 261 | 262 | Back to the `iris` dataset: 263 | 264 | ```{r,eval=T} 265 | iris_sort_lg <- iris[order(iris$Sepal.Length),] # order the iris dataset from least to greatest value of Sepal.Length 266 | iris_sort_lg 267 | iris_sort_gl <- iris[order(-iris$Sepal.Length),] # order the iris dataset from greatest to least value of Sepal.Length 268 | iris_sort_gl 269 | ``` 270 | 271 | ### 2.3.7 Filtering Data by Column Content 272 | 273 | ```{r} 274 | # Create a new dataset called 'iris2' that only contains Sepal.Length > 6.7 275 | iris2 <- subset(iris, Sepal.Length > 6.7) 276 | iris2 277 | ``` 278 | 279 | ### 2.3.8 Calculating Quantities with Columns 280 | 281 | ```{r} 282 | # Adding 2 columns and assigning values to new column, Sepal_Sum 283 | iris$Sepal_Sum <- iris$Sepal.Length + iris$Sepal.Width 284 | 285 | # Subtracting 2 columns and assigning values to new column, Sepal_Diff 286 | iris$Sepal_Diff <- iris$Sepal.Length - iris$Sepal.Width 287 | 288 | head(iris) 289 | ``` 290 | 291 | ### 2.3.9 Calculations on Columns 292 | 293 | ```{r} 294 | # Adding the values of the Sepal.Length column and assigning the value to sepal_sum 295 | sepal_sum <- sum(iris$Sepal.Length) 296 | sepal_sum 297 | 298 | # Finding the average of the values of the Sepal.Length column and assigning the value to sepal_avg 299 | sepal_avg <- mean(iris$Sepal.Length) 300 | sepal_avg 301 | 302 | # Finding the median of the values of the Sepal.Length column and assigning the value to sepal_median 303 | sepal_median <- median(iris$Sepal.Length) 304 | sepal_median 305 | ``` 306 | 307 | ## 2.4 File Names and Version Control 308 | 309 | ### 2.4.1 File Names 310 | 311 | As in Excel spreadsheets, the file names of R scripts are important, as they need to be discernable by both users and computers. 312 | 313 | Here are some bad examples of file names: 314 | 315 | ``` 316 | myscript.R 317 | Joe's Filenames Use Spaces and Punctuation;"'.R 318 | figure 1.R 319 | fig 2.R 320 | JW7d^(2sl@pleasedontdeletethisWx2*.R 321 | ``` 322 | 323 | and here are some good examples of file names: 324 | 325 | ``` 326 | 2010-07-17_disneyland-55th-bday.R 327 | joes-filenames-are-getting-better.R 328 | fig01_scatterplot-length-vs-interest.R 329 | fig02_histogram-attendance.R 330 | 2018-06-18_predictive-modeling-contest-week1.R 331 | ``` 332 | 333 | The following sections detail why the above examples are categorized as good and bad file names. 334 | 335 | #### 2.4.1.1 Three Principles of Good File Names 336 | 337 | **1. Machine readable** 338 | 339 | Avoid spaces, punctuation, accented characters, and case sensitivity to achieve optimal machine readability. Make your file names easy to compute on with a deliberate use of delimiters. 340 | 341 | The deliberate use of `_` and `-` allows you to recover metadata from the file names. 342 | 343 | For example, for the following filenames, 344 | 345 | ``` 346 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T01.R 347 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T02.R 348 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T03.R 349 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_all.R 350 | ... 351 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_T01.R 352 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_T02.R 353 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_P01.R 354 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_P02.R 355 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_all.R 356 | ``` 357 | 358 | you can create a list of file names only containing "Non-GMWB-Mix" in R by typing the following into the Console. 359 | 360 | ```{r,eval=F} 361 | # Make sure you have the `dplyr` package installed first! 362 | flist <- list.files(pattern = "Non-GMWB-Mix") %>% head 363 | ``` 364 | 365 | If you also type 366 | 367 | ```{r,eval=F} 368 | # Make sure you have the `stringr` package installed first! 369 | stringr::str_split_fixed(flist,"[_\\.]",4) 370 | ``` 371 | 372 | into the Console, the date, quarter analysis, analysis type, and output type will be displayed separately, creating a nicely organized metadata table. 373 | 374 | The underscore `_` is used to delimit units of metadata you want to retrieve later, and the hyphen `-` is used to delimit separate words within these units of metadata. 375 | 376 | By making your file names machine readable, you make it easy to: 377 | 378 | 1. search for files later, 379 | 380 | 2. narrow file lists based on names, and 381 | 382 | 3. extract information from file names (e.g. by splitting). 383 | 384 | **2. Human readable** 385 | 386 | Include information on content in your file names to make them human readable. This connects with the concept of slugs from [semantic URLs](http://en.wikipedia.org/wiki/Semantic_URL). 387 | 388 | For example, 389 | 390 | ``` 391 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T01.R 392 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T02.R 393 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T03.R 394 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_all.R 395 | ... 396 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_T01.R 397 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_T02.R 398 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_P01.R 399 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_P02.R 400 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_all.R 401 | ``` 402 | 403 | these file names "embrace the slug" by having each of the subanalyses and subtypes in the Q2 Analysis labeled at the end of each file name. 404 | 405 | "Embracing the slug" allows you to more easily figure out which R files you're looking at or trying to find. 406 | 407 | **3. Plays well with default ordering** 408 | 409 | To play well with default ordering, you need to: 410 | 411 | 1. put something numeric first, 412 | 413 | 2. use the ISO 8601 standard for dates (YYYY-MM-DD), and 414 | 415 | 3. left-pad other numbers with zeros. 416 | 417 | Our example file names 418 | 419 | ``` 420 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T01.R 421 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T02.R 422 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T03.R 423 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_all.R 424 | ... 425 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_T01.R 426 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_T02.R 427 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_P01.R 428 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_P02.R 429 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_all.R 430 | ``` 431 | 432 | put something numeric first (the date, which also fits the ISO 8601 standard), so they're organized in chronological order. Also, the version numbers at the end of each file name are left-padded with zeros so when double-digit versions are created, the later versions won't be ordered before the single-digit versions. 433 | 434 | ### 2.4.2 Version Control 435 | 436 | An example of a series of good file names for version control is: 437 | 438 | ``` 439 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T01.R 440 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T02.R 441 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_T03.R 442 | 2018-07-05_Q2ANALYSIS_GMWB-Mix_all.R 443 | ... 444 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_T01.R 445 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_T02.R 446 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_P01.R 447 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_P02.R 448 | 2018-07-18_Q2ANALYSIS_Non-GMWB-Mix_all.R 449 | ``` 450 | 451 | Note how these file names not only follow all of the conventions for good file names, but they also indicate the type of script (with `T` for table(s) and `P` for plot(s)) and version number at the end. 452 | 453 | # 3. Common Excel Functions in R 454 | 455 | To find more information about how to use each of these R functions, type `?function` (e.g. `?sum`) in the RStudio Console, and you'll be provided with comprehensive and clear R documentation. If you need even more information about an R function, type "how to use ___ function in R" or something similar into Google. 456 | 457 | | Excel Formula | R Function | Type | 458 | |---------------|------------|------| 459 | | ABS | `abs` | Arithmetic | 460 | | ADDRESS | `assign` | Essentials | 461 | | AND | `&`,`&&`,`all` | Boolean | 462 | | AVERAGE, AVG, AVERAGEIF | `mean` | Arithmetic | 463 | | BETADIST | `pbeta` | Statistics | 464 | | BETAINV | `qbeta` | Statistics | 465 | | BINOMDIST | `pbinom` when cumulative,`dbinom` when not | Statistics | 466 | | CEILING | `ceiling` | Arithmetic | 467 | | CELL | `str` has the same idea | Essentials | 468 | | CHIDIST, CHISQDIST | `pchisq` | Statistics | 469 | | CHIINV, CHISQINV | `qchisq` | Statistics | 470 | | CHITEST | `chisq.test` | Statistics | 471 | | CHOOSE | `switch` | Essentials | 472 | | CLEAN | `gsub` | Text | 473 | | COLS, COLUMNS | `ncol` | Essentials | 474 | | COLUMN | `col`,`:`,`seq` | Essentials | 475 | | COMBIN | `choose` | Essentals | 476 | | CONCATENATE | `paste` | Text | 477 | | CONFIDENCE | `-qnorm(alpha/2)*std/sqrt(n)` | Statistics | 478 | | CORREL | `cor` | Statistics | 479 | | COUNT, COUNTIF | `length` | Arithmetic | 480 | | COVAR | `cov` | Statistics | 481 | | CRITBINOM | `qbinom` | Statistics | 482 | | DELTA | `identical` | Boolean | 483 | | EXACT | `==` | Boolean | 484 | | EXP | `exp` | Arithmetic | 485 | | EXPONDIST | `pexp` when cumulative,`dexp` when not | Statistics | 486 | | FACT | `factorial` | Arithmetic | 487 | | FACTDOUBLE | `dfactorial` in the `phangorn` package | Arithmetic | 488 | | FDIST | `pf` | Statistics | 489 | | FIND | `regexpr`,`grepl`,`grep` | Text | 490 | | FINV | `qf` | Statistics | 491 | | FISHER | `atanh` | Arithmetic | 492 | | FISHERINV | `tanh` | Arithmetic | 493 | | FIXED | `format`,`sprintf`,`formatC` | Essentials | 494 | | FLOOR | `floor` | Arithmetic | 495 | | FORECAST | `predict` on an `lm` object | Statistics | 496 | | FREQUENCY | `cut`,`table` | Arithmetic | 497 | | FTEST | `var.test` | Statistics | 498 | | GAMMADIST | `pgamma` if last argument T,`dgamma` if last arg. F | Statistics | 499 | | GAMMAINV | `qgamma` | Statistics | 500 | | GAMMALN | `lgamma` | Statistics | 501 | | GAUSS | `pnorm(x) - 0.5` | Statistics | 502 | | GCD | `gcd` | Arithmetic | 503 | | GEOMEAN | `exp(mean(log(x)))` | Arithmetic | 504 | | GESTEP | `>=` | Boolean | 505 | | HARMEAN | `harmonic.mean` in the `psych` package | Arithmetic | 506 | | HLOOKUP | `match`,`merge` | Essentials | 507 | | HYPGEOMDIST | `dhyper` | Statistics | 508 | | IF | `if`,`ifelse` | Essentials | 509 | | IFERROR | `try`,`tryCatch` | Essentials | 510 | | INDEX | `x[y,z]` | Essentials | 511 | | INDIRECT | `get` | Essentials | 512 | | INT | `as.integer`(not for negative numbers),`floor` | Arithmetic | 513 | | INTERCEPT | first element of `coef` of an `lm` object | Statistics | 514 | | ISLOGICAL | `is.logical` | Boolean | 515 | | ISNA | `is.na` | Boolean | 516 | | ISNUMBER | `is.numeric` | Boolean | 517 | | ISTEXT | `is.character` | Boolean | 518 | | KURT | `kurtosis` in the `moments` package | Statistics | 519 | | LARGE | `sort` | Statistics | 520 | | LCM | `scm` in the `schoolmath` package | Arithmetic | 521 | | LEFT | `substr` | Text | 522 | | LEN, LENGTH | `nchar` | Text | 523 | | LINEST | `lm` | Statistics | 524 | | LN, LOG | `log` | Arithmetic | 525 | | LOG10 | `log10` | Arithmetic | 526 | | LOGINV | `qlnorm` | Statistics | 527 | | LOGNORMDIST | `plnorm` | Statistics | 528 | | LOWER | `tolower` | Text | 529 | | MATCH | `match`,`which` | Essentials | 530 | | MAX | `max` (sometimes `pmax`) | Arithmetic | 531 | | MDETERM | `det` | Arithmetic | 532 | | MEDIAN | `median` | Arithmetic | 533 | | MID | `substr` | Text | 534 | | MIN | `min` (sometimes `pmin`) | Arithmetic | 535 | | MINVERSE | `solve` | Arithmetic | 536 | | MMULT | `%*%` | Arithmetic | 537 | | MOD | `%%` | Arithmetic | 538 | | MODE | `as.numeric(names(which.max(table(x))))` | Arithmetic | 539 | | MUNIT | `diag` | Arithmetic | 540 | | N | `as.numeric` | Arithmetic | 541 | | NEGBINOMDIST | `dnbinom` | Statistics | 542 | | NORMDIST, NORMSDIST | `pnorm` when cumulative,`dnorm` when not | Statistics | 543 | | NORMINV, NORMSINV | `qnorm` | Statistics | 544 | | NOT | `!` | Boolean | 545 | | NOW | `date`,`Sys.time` | Essentials | 546 | | OR | `|`,`||`,`any` | Boolean | 547 | | PEARSON | `cor` | Statistics | 548 | | PERCENTILE | `quantile` | Statistics | 549 | | PERCENTRANK | `ecdf` | Statistics | 550 | | PERMUT | `function(n,k) {choose(n,k)*factorial(k)}` | Arithmetic | 551 | | PERMUTATIONA | `n^k` | Arithmetic | 552 | | PHI | `dnorm` | Statistics | 553 | | POISSON | `ppois` when cumulatic,`dpois` when not | Statistics | 554 | | POWER | `^` | Arithmetic | 555 | | PROB | `ecdf` | Statistics | 556 | | PRODUCT | `prod` | Arithmetic | 557 | | PROPER | `toupper` | Text | 558 | | QUARTILE | `quantile` | Arithmetic | 559 | | QUOTIENT | `%/%` | Arithmetic | 560 | | RAND | `runif` | Arithmetic | 561 | | RANDBETWEEN | `sample` | Arithmetic | 562 | | RANK | `rank` | Essentials | 563 | | REPLACE | `sub`,`gsub` | Text | 564 | | REPT | `rep` and `paste` or `paste0` | Text | 565 | | RIGHT | `substring` | Text | 566 | | ROUND | `round` | Arithmetic | 567 | | ROUNDDOWN | `floor` | Arithmetic | 568 | | ROUNDUP | `ceiling` | Arithmetic | 569 | | ROW | `row`,`:`,`seq` | Essentials | 570 | | ROWS | `nrow` | Essentials | 571 | | RSQ | `summary` of `lm` object | Statistics | 572 | | SEARCH | `regexpr`,`grep` | Text | 573 | | SIGN | `sign` | Arithmetic | 574 | | SKEW | `skewness` in the `moments` package | Statistics | 575 | | SLOPE | in `coef` of `lm` object | Statistics | 576 | | SMALL | `sort` | Arithmetic | 577 | | SQRT | `sqrt` | Arithmetic | 578 | | STANDARDIZE | `scale` | Statitics | 579 | | STD, STDEV | `sd` | Arithmetic | 580 | | STEYX | `predict` on an `lm` object | Statistics | 581 | | STRING | `format`,`sprintf`,`formatC` | Text | 582 | | SUBSTITUTE | `sub`,`gsub`,`paste` | Essentials | 583 | | SUM, SUMIF | `sum` | Arithmetic | 584 | | SUMPRODUCT | `crossprod` | Arithmetic | 585 | | TDIST | `pt` | Statistics | 586 | | TEXT | `format`,`sprintf`,`formatC` | Text | 587 | | TINV | `abs(qt(x/2,data))` | Statistics | 588 | | TODAY | `Sys.Date` | Essentials | 589 | | TRANSPOSE | `t` | Arithmetic | 590 | | TREND | `fitted` of an `lm` object | Statistics | 591 | | TRIM | `sub` | Essentials | 592 | | TRIMMEAN | `mean(x,trim=tr/2)` | Arithmetic | 593 | | TRUNC | `trunc` | Essentials | 594 | | TTEST | `t.test` | Statistics | 595 | | TYPE | `typeof`,`mode`,`class` | Essentials | 596 | | UPPER | `toupper` | Text | 597 | | VALUE | `as.numeric` | Arithmetic | 598 | | VAR | `var` | Essentials | 599 | | VLOOKUP | `match`,`merge` | Essentials | 600 | | WEEKDAY | `weekdays` | Essentials | 601 | | WEIBULL | `pweibull` when cumulative,`dweibull` when not | Statistics | 602 | | ZTEST | `pnorm` | Statistics | 603 | 604 | # 4. Common Excel Plots in R 605 | 606 | ## 4.1 Distribution Plots 607 | 608 | ### 4.1.1 Density Plot 609 | 610 | Using the `iris` dataset that's pre-installed in R, 611 | 612 | ```{r,eval=T} 613 | # If you don't have the ggplot2 library, be sure to 614 | # install it by typing `install.packages("ggplot2")` 615 | # into the Console. 616 | library(ggplot2) 617 | 618 | ggplot(iris, aes(Petal.Width, colour=Species, fill=Species)) + 619 | geom_density(alpha=0.55) 620 | ``` 621 | 622 | ### 4.1.2 Histogram 623 | 624 | Using the `iris` dataset that's pre-installed in R, 625 | 626 | ```{r,eval=T} 627 | # If you don't have the ggplot2 library, be sure to 628 | # install it by typing `install.packages("ggplot2")` 629 | # into the Console. 630 | library(ggplot2) 631 | 632 | # Basic histogram 633 | ggplot(iris, aes(x=Petal.Width)) + geom_histogram() 634 | 635 | # Custom Bin Width 636 | ggplot(iris, aes(x=Petal.Width)) + geom_histogram(binwidth = 0.05) 637 | 638 | # Custom color 639 | ggplot(iris, aes(x=Petal.Width)) + 640 | geom_histogram(binwidth = 0.2, color="white", 641 | fill=rgb(0.2,0.7,0.1,0.4)) 642 | ``` 643 | 644 | ### 4.1.3 Boxplot (Box and Whisker Plot) 645 | 646 | Using the `iris` dataset that's pre-installed in R, 647 | 648 | ```{r,eval=T} 649 | # If you don't have the ggplot2 library, be sure to 650 | # install it by typing `install.packages("ggplot2")` 651 | # into the Console. 652 | library(ggplot2) 653 | 654 | ggplot(iris, aes(x=Species, y=Petal.Width)) + 655 | geom_boxplot(fill="slateblue", alpha=0.2) 656 | ``` 657 | 658 | ## 4.2 Correlation Plots 659 | 660 | ### 4.2.1 Scatterplot 661 | 662 | Using the `iris` dataset that's pre-installed in R, 663 | 664 | ```{r,eval=T} 665 | # If you don't have the ggplot2 library, be sure to 666 | # install it by typing `install.packages("ggplot2")` 667 | # into the Console. 668 | library(ggplot2) 669 | 670 | # Basic scatterplot 671 | ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width)) + 672 | geom_point() 673 | 674 | # Basic scatterplot with regression line 675 | ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width)) + 676 | geom_smooth(method = 'lm', formula = y~x) + 677 | geom_point() 678 | 679 | # Basic connected scatterplot 680 | ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width)) + 681 | geom_line() + 682 | geom_point() 683 | ``` 684 | 685 | ### 4.2.2 Heatmap 686 | 687 | Using the `mtcars` dataset that's pre-installed in R, 688 | 689 | ```{r,eval=T} 690 | # converting `mtcars` from a dataframe to a matrix 691 | data <- as.matrix(mtcars) 692 | # making the heatmap 693 | heatmap(data, Colv = NA, Rowv = NA, scale="column") 694 | ``` 695 | 696 | ### 4.2.3 Bubble 697 | 698 | Using the `iris` dataset that's pre-installed in R, 699 | 700 | ```{r,eval=T} 701 | # If you don't have the ggplot2 library, be sure to 702 | # install it by typing `install.packages("ggplot2")` 703 | # into the Console. 704 | library(ggplot2) 705 | 706 | # Bubble Chart 707 | ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, 708 | size = Petal.Width, color = Species)) + 709 | geom_point() 710 | ``` 711 | 712 | ## 4.3 Ranking Plots 713 | 714 | ### 4.3.1 Barplot 715 | 716 | Using the `mtcars` dataset that's pre-installed in R, 717 | 718 | ```{r,eval=T} 719 | # If you don't have the ggplot2 library, be sure to 720 | # install it by typing `install.packages("ggplot2")` 721 | # into the Console. 722 | library(ggplot2) 723 | 724 | # Vertical Barplot 725 | ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl))) + 726 | geom_bar() 727 | 728 | # Horizontal Barplot 729 | ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl))) + 730 | geom_bar() + 731 | coord_flip() 732 | 733 | # Horizontal Barplot with Custom Bar Width 734 | ggplot(mtcars, aes(x=as.factor(cyl), fill=as.factor(cyl))) + 735 | geom_bar(width=0.4) + 736 | coord_flip() 737 | ``` 738 | 739 | For stacked and grouped barplots: 740 | 741 | ```{r,eval=T} 742 | # Create the data 743 | set.seed(1234) 744 | data=matrix(sample(1:30,15), nrow=3) 745 | colnames(data)=c("A","B","C","D","E") 746 | rownames(data)=c("var1","var2","var3") 747 | head(data) 748 | 749 | # Stacked barplot 750 | barplot(data, col=colors()[c(23,89,12)], border="white", 751 | space=0.04, font.axis=2, xlab="group") 752 | 753 | # Grouped barplot 754 | barplot(data, col=colors()[c(23,89,12)], border="white", 755 | font.axis=2, beside=T, legend=rownames(data), 756 | xlab="group", font.lab=2) 757 | ``` 758 | 759 | ## 4.4 "Part of a Whole" Plots 760 | 761 | ### 4.4.1 Treemap 762 | 763 | Using the `mtcars` dataset that's pre-installed in R, 764 | 765 | ```{r,eval=T} 766 | # If you don't have the ggplot2 or treemapify libraries, 767 | # be sure to install them by typing 768 | # `install.packages("ggplot2")` and 769 | # `install.packages("treemapify") 770 | # into the Console. 771 | library(ggplot2) 772 | library(treemapify) 773 | 774 | # creating a smaller copy of `mtcars` 775 | cars <- head(mtcars) 776 | # creating a new column (`carname`) in `cars` 777 | cars$carname <- rownames(cars) 778 | # making `cyl` in `cars` a factor 779 | cars$cyl <- as.factor(cars$cyl) 780 | # making the treemap 781 | ggplot(cars, aes(area = disp, fill = cyl, label = carname)) + 782 | geom_treemap() + 783 | geom_treemap_text() 784 | ``` 785 | 786 | ### 4.4.2 Pie Chart 787 | 788 | ```{r,eval=T} 789 | # Create Data 790 | Prop=c(3,7,9,1,2) 791 | 792 | # Default Pie Chart 793 | pie(Prop) 794 | 795 | # Pie Chart with Custom Labels 796 | pie(Prop, labels = c("Gr-A","Gr-B","Gr-C","Gr-D","Gr-E")) 797 | ``` 798 | 799 | ## 4.5 Evolution/Time Series Plots 800 | 801 | ### 4.5.1 Area Chart 802 | 803 | ```{r,eval=T} 804 | # If you don't have the ggplot2 library, be sure to 805 | # install it by typing `install.packages("ggplot2")` 806 | # into the Console. 807 | library(ggplot2) 808 | 809 | # Create data 810 | data=data.frame(my_x=seq(1,10), my_size=sample(seq(1,20),10)) 811 | 812 | # Area Chart 813 | ggplot(data, aes(x=my_x , y=my_size)) + 814 | geom_area( fill="blue", alpha=.2) + 815 | geom_line() 816 | ``` 817 | 818 | ### 4.5.2 Stacked Area Chart 819 | 820 | Using the `iris` dataset that's pre-installed in R, 821 | 822 | ```{r,eval=T} 823 | # If you don't have the ggplot2 or RColorBrewer libraries, 824 | # be sure to install them by typing 825 | # `install.packages("ggplot2")` and 826 | # `install.packages("RColorBrewer") into the Console. 827 | library(ggplot2) 828 | library(RColorBrewer) 829 | 830 | # Creating data 831 | set.seed(1234) 832 | Sector <- rep(c("S01","S02","S03","S04", 833 | "S05","S06","S07"),times=7) 834 | Year <- as.numeric(rep(c("1950","1960","1970", 835 | "1980","1990","2000","2010"),each=7)) 836 | Value <- runif(49, 10, 100) 837 | data <- data.frame(Sector,Year,Value) 838 | 839 | # Stacked Area Chart 840 | ggplot(data, aes(x=Year, y=Value, fill=Sector)) + 841 | geom_area() 842 | 843 | # Stacked Area Chart with Custom Color Palette 844 | ggplot(data, aes(x=Year, y=Value, fill=Sector)) + 845 | geom_area(colour="black", size=.2, alpha=.4) + 846 | scale_fill_brewer(palette="Greens", 847 | breaks=rev(levels(data$Sector))) 848 | ``` 849 | 850 | ## 4.6 Interactive Plots 851 | 852 | To make any of the above plots interactive, use the `plotly` package. Here is an example of how to use `plotly`: 853 | 854 | ```{r,eval=T,message=F,warning=F} 855 | # If you don't have the ggplot2 or plotly libraries, be sure to 856 | # install them by typing `install.packages("ggplot2")` and 857 | # `install.packages("plotly")` into the Console. 858 | library(ggplot2) 859 | library(plotly) 860 | 861 | # Basic scatterplot with interactivity 862 | graph <- ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width)) + 863 | geom_smooth(method = 'lm', formula = y~x) + 864 | geom_point() 865 | ggplotly(graph) 866 | ``` 867 | 868 | ## 4.7 Other Plots 869 | 870 | If you can't find your desired plot in this manual, please refer to the [R Graph Gallery](https://www.r-graph-gallery.com/). 871 | 872 | # 5. Integrating R and Excel with BERT (Basic Excel R Toolkit) 873 | 874 | [BERT](https://bert-toolkit.com/) is a tool for connecting Excel and R on Windows machines. Specifically, BERT is designed to: 875 | 876 | 1. Support running R functions from Excel spreadsheet cells. In Excel terms, this is known as writing User-Defined Functions (UDFs) in R. 877 | 878 | > All you have to do is write the function. Everything else - loading the function into Excel, managing parameters, and handling type conversion - is done automatically for you. 879 | 880 | 2. Control Excel in real time, right from your R code and a convenient BERT console. 881 | 882 | 3. Call R functions from VBA. 883 | 884 | ## 5.1 Installing BERT 885 | 886 | Since BERT is free and open-source (just like R), you can download it without any assistance from IT. [Go to this download page](https://bert-toolkit.com/download-bert) and follow the instructions given for downloading the software. 887 | 888 | ## 5.2 Getting Started with BERT 889 | 890 | Refer to [BERT's well-written documentation](https://bert-toolkit.com/bert-quick-start) for help getting started with BERT. 891 | 892 | ### 5.2.1 BERT Example Functions 893 | 894 | BERT has conveniently written [some example functions](https://bert-toolkit.com/bert-example-functions) for basic data management and analysis tasks. 895 | 896 | ### 5.2.2 Excel Scripting Interface in R 897 | 898 | You can talk to Excel from R using the Excel scripting interface. Refer to [BERT's well-written documentation](https://bert-toolkit.com/excel-scripting-interface-in-r) for help getting started. 899 | 900 | # Appendix 901 | 902 | ## Updating R and RStudio 903 | If the aforementioned packages and functions start to not work after an extended period of time, you may need to update your versions of R, R packages, and RStudio software to the latest versions. 904 | 905 | ### Updating R 906 | To update your version of R, first close any R or RStudio windows you have open. 907 | 908 | #### Updating R on Windows 909 | Open the R GUI (x64, not i386). This is **not** the same as RStudio. The R GUI program icon should look very similar to this: 910 | 911 | ![](RGui.png) 912 | 913 | 914 | Install the `installr` package into R by typing 915 | 916 | ```{r, eval=FALSE} 917 | install.packages("installr") 918 | ``` 919 | 920 | into the Console. 921 | 922 | After the package is finished installing, call the package by typing 923 | 924 | ```{r, eval=FALSE} 925 | library(installr) 926 | ``` 927 | 928 | into the Console. You can now update your R software and packages to the latest versions by typing 929 | 930 | ```{r, eval=FALSE} 931 | updateR() 932 | ``` 933 | 934 | into the Console. Then R will walk you through a detailed and intuitive process of updating your R software and packages to the latest versions. 935 | 936 | #### Updating R on (Mac) OS X 937 | 938 | Open RStudio again, and type the following lines of code into the Console: 939 | 940 | ```{r, eval=FALSE} 941 | install.packages('devtools') #assuming it isn't already installed 942 | library(devtools) 943 | install_github('andreacirilloac/updateR') 944 | library(updateR) 945 | updateR(admin_password = "os_admin_user_password") 946 | ``` 947 | 948 | R will then walk you through a detailed and intuitive process of updating your R software and packages to the latest versions. 949 | 950 | #### Updating R on Linux 951 | 952 | [This resource](https://stackoverflow.com/questions/10476713/how-to-upgrade-r-in-ubuntu) will walk you through how to update your R software and packages to the latest versions on Linux. 953 | 954 | ### Updating R Packages Without Updating R 955 | 956 | Updating out-of-date packages that were installed from CRAN (with `install.packages()`) is easy with the `update.packages()` function. Type this function into the RStudio Console. 957 | 958 | ```{r, eval=FALSE} 959 | update.packages() 960 | ``` 961 | 962 | After entering this function, it will ask you what packages you want to update. To update all packages at once, use `ask = FALSE`. 963 | 964 | ```{r, eval=FALSE} 965 | update.packages(ask = FALSE) 966 | ``` 967 | 968 | To update packages installed from `devtools::install_github()`, type the following function into your RStudio Console (I would also recommend saving this function in an R Script for later use): 969 | 970 | ```{r, eval=FALSE} 971 | update_github_pkgs <- function() { 972 | # check/load necessary packages 973 | # devtools package 974 | if (!("package:devtools" %in% search())) { 975 | tryCatch(require(devtools), error = function(x) {warning(x); cat("Cannot load devtools package \n")}) 976 | on.exit(detach("package:devtools", unload=TRUE)) 977 | } 978 | 979 | pkgs <- installed.packages(fields = "RemoteType") 980 | github_pkgs <- pkgs[pkgs[, "RemoteType"] %in% "github", "Package"] 981 | 982 | print(github_pkgs) 983 | lapply(github_pkgs, function(pac) { 984 | message("Updating ", pac, " from GitHub...") 985 | 986 | repo = packageDescription(pac, fields = "GithubRepo") 987 | username = packageDescription(pac, fields = "GithubUsername") 988 | 989 | install_github(repo = paste0(username, "/", repo)) 990 | }) 991 | } 992 | ``` 993 | 994 | Then call the function. 995 | 996 | ```{r, eval=FALSE} 997 | update_github_pkgs() 998 | ``` 999 | 1000 | ### Updating RStudio 1001 | To update RStudio, open RStudio and go to `Help > Check for Updates` to install the newest version. 1002 | 1003 | ## References 1004 | 1005 | 1. [Excel Functions (Alphabetical)](https://support.office.com/en-us/article/Excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188) 1006 | 1007 | 2. [R for Excel Users](https://www.rforexcelusers.com/) 1008 | 1009 | 3. [Burns Statistics](http://www.burns-stat.com/) 1010 | 1011 | 4. [The R Graph Gallery](https://www.r-graph-gallery.com/) 1012 | 1013 | 5. [BERT Documentation](https://bert-toolkit.com/) 1014 | 1015 | ## Contact 1016 | 1017 | If you have any comments or suggestions about this manual, please contact the author, [Alyssa Columbus](mailto:acolumbu@uci.edu). 1018 | 1019 | 1020 | ### Please consider a donation! 1021 | 1022 | I am a huge advocate of open source software (e.g. R) and open science, so a version of this manual will always be freely available! That said, updating this manual takes a bit of time, so if you like this book and want to see it get even better, consider donating at [paypal.me/AlyssaColumbus](https://paypal.me/AlyssaColumbus). It really means a lot! -------------------------------------------------------------------------------- /InstallPackage_readxl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/InstallPackage_readxl.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Alyssa Columbus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LinuxR1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/LinuxR1.png -------------------------------------------------------------------------------- /MacR1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/MacR1.png -------------------------------------------------------------------------------- /RDataStructures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/RDataStructures.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # How to Use R With Excel 2 | ## A Comprehensive Guide to Transitioning From Excel to R 3 | ### Alyssa Columbus 4 | 5 | Read the full guide on [RPubs](http://rpubs.com/acolumbus/how-to-use-r-with-excel)! 6 | -------------------------------------------------------------------------------- /RGui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/RGui.png -------------------------------------------------------------------------------- /RStudioGuide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/RStudioGuide.png -------------------------------------------------------------------------------- /WindowsR1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/WindowsR1.png -------------------------------------------------------------------------------- /WindowsR2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acolum/r-and-excel/5e7eb135960565e53671040e7c7b7f6804c63738/WindowsR2.png --------------------------------------------------------------------------------