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 Between() | |
| ' | |
| ' Between Macro | |
| ' | |
| 'Dim time1, time2 | |
| Range("E6").Select | |
| time1 = Now |
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
| #install a package - do this ONCE on your computer! | |
| install.packages("XLConnect") | |
| #call library - do this EVERY TIME you start R ... | |
| #assuming you need the library! | |
| library("xlconnect") |
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
| #NA/missing values | |
| a<-NA | |
| b<-5 | |
| #check for NA | |
| is.na(a) | |
| is.na(num2) | |
| num1+num2 |
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
| #create three vectors of equal length | |
| x<-c(1,2,3) | |
| y<-c(4,5,6) | |
| z<-c(7,8,9) | |
| #create a data frame | |
| v<-data.frame(x,y,z) |
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
| #create a vector x | |
| x<-c(1,2,3) | |
| #write file x.txt | |
| write.table(x,"x.txt") | |
| #where was that file saved? |
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
| #import modules | |
| from bs4 import BeautifulSoup | |
| import os | |
| #set directories | |
| folder = "E:/BillMcDonald/Sample2" | |
| os.listdir(folder) |
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
| <?xml version="1.0" encoding="ISO-8859-1"?> | |
| <?xml-stylesheet href="latest_ob.xsl" type="text/xsl"?> | |
| <current_observation version="1.0" | |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:noNamespaceSchemaLocation="http://www.weather.gov/view/current_observation.xsd"> | |
| <credit>NOAA's National Weather Service</credit> | |
| <credit_URL>http://weather.gov/</credit_URL> | |
| <image> |
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
| 'Refresh data in a protected worksheet | |
| 'Source: https://www.extendoffice.com/documents/excel/4379-excel-protect-sheet-but-allow-data-refresh.html | |
| 'Save workbook as .xlsm, hit Alt+F11, and paste the following code into the MODULES section of your workbook: | |
| Sub DataRefresh() | |
| ActiveSheet.Unprotect | |
| ActiveWorkbook.RefreshAll | |
| Application.OnTime Now + TimeValue("00:00:01"), "DataRefresh2" | |
| End Sub | |
| Sub DataRefresh2() |
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
| setwd("C:/Iris/") | |
| #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... |
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
| #install packages ONCE on your machine... | |
| #http://georgejmount.com/rpackagesexplained/ | |
| install.packages("DescTools") | |
| install.packages("RDCOMClient", repos = "http://www.omegahat.org/R") |
OlderNewer