This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #necessary packages | |
| library(DescTools) | |
| library(RDCOMClient) | |
| #download file from https://drive.google.com/file/d/1kn49DDrn4KR1LshGGT8BjD6J3gPcl1Mk/view?usp=sharing/ | |
| iris<-read.csv("iris.csv") | |
| #data manipulation/analysis ensues... | |
| #..and now we're ready bring back to Excel... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > str(XLView) | |
| function (x, col.names = TRUE, row.names = FALSE, na = "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Green() | |
| Selection.Interior.ColorIndex = 10 | |
| End Sub | |
| Sub Red() | |
| Selection.Interior.ColorIndex = 3 | |
| End Sub | |
| Sub Yellow() | |
| Selection.Interior.ColorIndex = 27 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| x<-c(1,2,3) | |
| y<-c(1,2,3) | |
| x==y | |
| a<-c(1,2,3) | |
| b<-c(1,2,3) | |
| a==b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #perform a function on each file | |
| #https://www.r-bloggers.com/perform-a-function-on-each-file-in-r/ | |
| setwd("H:/sample") | |
| list.files("H:/sample") | |
| fileNames<-Sys.glob("*.csv") | |
| fileNames |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(striprtf) | |
| #get list of all RTF FILES ONLY in the folder | |
| files <- list.files("C:/Factiva", pattern = "\\.rtf$") | |
| #loop through files | |
| for(file in files){ | |
| #read RTF into R | |
| x <- read_rtf(file) | |
| #strip RTF encoding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #simple example - no loop | |
| #https://docs.quanteda.io/reference/kwic.html | |
| library(quanteda) | |
| library(readtext) | |
| corp <- readtext::readtext("C:/FactivaOut") | |
| c <- corpus(corp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #http://wjh.harvard.edu/~inquirer/j1_1/ | |
| #must have Java installed | |
| #from command prompt: | |
| \cd GeneralInquirer\ | |
| C:\GeneralInquirer>java -mx128m giGui |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Private Sub Worksheet_SelectionChange(ByVal Target As Range) | |
| Set rng = Target | |
| Call Extras | |
| End Sub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public NoBlank As Long | |
| Public Skewn As Double | |
| Public Kurtos As Double | |
| Public Stdev As Double | |
| Public rng As Range | |
| Public iAreaCount As Integer | |
| Sub Extras() |