Commit a21ac2b6acf9e6ec6402ee1bf724998936728727
1 parent
ddea4061
Updated parsers
Showing
17 changed files
with
267 additions
and
72 deletions
ISO27001effectiveness/DESCRIPTION
1 | Package: ISO27001effectiveness | 1 | Package: ISO27001effectiveness |
2 | Type: Package | 2 | Type: Package |
3 | -Title: What the Package Does (Title Case) | 3 | +Title: Study about how ISO27001 certifications affect cyberattacks |
4 | Version: 0.1.0 | 4 | Version: 0.1.0 |
5 | Author: Who wrote it | 5 | Author: Who wrote it |
6 | Maintainer: The package maintainer <yourself@somewhere.net> | 6 | Maintainer: The package maintainer <yourself@somewhere.net> |
7 | -Description: More about what it does (maybe more than one line) | ||
8 | - Use four spaces when indenting paragraphs within the Description. | 7 | +Description: Compare the cyberattacks reported in hackmaggedon website with data |
8 | + obtained from the official ISO survey to 27001. Working around countries, | ||
9 | + industrial sectors, etc. | ||
9 | License: What license is it under? | 10 | License: What license is it under? |
10 | Encoding: UTF-8 | 11 | Encoding: UTF-8 |
11 | LazyData: true | 12 | LazyData: true |
12 | RoxygenNote: 5.0.1 | 13 | RoxygenNote: 5.0.1 |
13 | Imports: xlsx, | 14 | Imports: xlsx, |
14 | - ggplot2 | 15 | + ggplot2, |
16 | + countrycode |
ISO27001effectiveness/NAMESPACE
1 | # Generated by roxygen2: do not edit by hand | 1 | # Generated by roxygen2: do not edit by hand |
2 | 2 | ||
3 | +export(GetDefaultAttacksData) | ||
4 | +export(GetISOSurveyCertsPerCountry) | ||
5 | +export(GetISOSurveyCertsPerSector) | ||
6 | +export(GetISOSurveySitesPerCountry) | ||
7 | +export(ParseHMExcel) | ||
8 | +export(ParseHMFolder) | ||
9 | +export(ProccesISOSurveyByCountryRaw) | ||
10 | +export(ProccesISOSurveyRaw) | ||
11 | +export(ProcessHMRaw) |
ISO27001effectiveness/R/Hackmageddon_Parser.R
@@ -49,16 +49,31 @@ ProcessHMRaw <- function(dataset.raw, dateOffset){ | @@ -49,16 +49,31 @@ ProcessHMRaw <- function(dataset.raw, dateOffset){ | ||
49 | #Standar names to the columns | 49 | #Standar names to the columns |
50 | dataset <- setNames(dataset.raw, c("Date", "Attack", "Target", "Country")) | 50 | dataset <- setNames(dataset.raw, c("Date", "Attack", "Target", "Country")) |
51 | 51 | ||
52 | - #Remove rows with Date NA | 52 | + #Data frame changes to standarize values and make easier the joins |
53 | dataset <- dataset[!is.na(dataset$Date),] | 53 | dataset <- dataset[!is.na(dataset$Date),] |
54 | dataset <- dataset[!is.na(dataset$Country),] | 54 | dataset <- dataset[!is.na(dataset$Country),] |
55 | - dataset <- dataset[!dataset$Country == ">1",] | ||
56 | - dataset <- dataset[!dataset$Country == ">A",] | 55 | + dataset$Country <- toupper(dataset$Country) |
56 | + | ||
57 | dataset <- dataset[!dataset$Country == "INT",] | 57 | dataset <- dataset[!dataset$Country == "INT",] |
58 | dataset <- dataset[!grepl(">",dataset$Country),] | 58 | dataset <- dataset[!grepl(">",dataset$Country),] |
59 | + dataset <- dataset[dataset$Country != "N/A",] | ||
59 | dataset$Country <- gsub("\n"," ",dataset$Country) | 60 | dataset$Country <- gsub("\n"," ",dataset$Country) |
60 | dataset <- FilterMultiCountry(dataset) | 61 | dataset <- FilterMultiCountry(dataset) |
61 | - dataset <- dataset[!dataset$Country == "",] | 62 | + dataset <- dataset[dataset$Country != "",] |
63 | + | ||
64 | + dataset <- dataset[dataset$Country != "H",] | ||
65 | + dataset <- dataset[dataset$Country != "W",] | ||
66 | + dataset <- dataset[dataset$Country != "14",] | ||
67 | + dataset <- dataset[dataset$Country != "EU",] | ||
68 | + dataset <- dataset[dataset$Country != "UN",] | ||
69 | + dataset <- dataset[dataset$Country != "TI",] | ||
70 | + dataset <- dataset[dataset$Country != ".TI",] | ||
71 | + dataset$Country <- gsub("G8","GI",dataset$Country) | ||
72 | + dataset$Country <- gsub("UK","GB",dataset$Country) | ||
73 | + dataset$Country <- gsub("EN","GB",dataset$Country) | ||
74 | + dataset$Country <- gsub("UAE","AE",dataset$Country) | ||
75 | + dataset$Country <- gsub("CB","KH",dataset$Country) | ||
76 | + | ||
62 | 77 | ||
63 | #Format properly the date | 78 | #Format properly the date |
64 | dataset$Date <- as.POSIXct(dataset$Date*86400, tz = "GMT", origin = dateOffset) | 79 | dataset$Date <- as.POSIXct(dataset$Date*86400, tz = "GMT", origin = dateOffset) |
@@ -66,28 +81,43 @@ ProcessHMRaw <- function(dataset.raw, dateOffset){ | @@ -66,28 +81,43 @@ ProcessHMRaw <- function(dataset.raw, dateOffset){ | ||
66 | dataset | 81 | dataset |
67 | } | 82 | } |
68 | 83 | ||
84 | +#' Look for rows with more than one country target and split into multiple | ||
85 | +#' | ||
86 | +#' @param dataset.pre data.frame to process | ||
87 | +#' | ||
88 | +#' @return data.frame | ||
69 | FilterMultiCountry <- function(dataset.pre) { | 89 | FilterMultiCountry <- function(dataset.pre) { |
90 | + | ||
91 | + #data.frame with multiple taget country rows | ||
70 | multi <- dataset.pre[grepl(" ",dataset.pre$Country),] | 92 | multi <- dataset.pre[grepl(" ",dataset.pre$Country),] |
71 | 93 | ||
72 | - dataset <- dataset.pre[!grepl(" ",dataset.pre$Country),] | 94 | + if (nrow(multi) == 0) { #Ignore if there are not multiple target rows |
73 | 95 | ||
74 | - for (i in 1:nrow(multi)) { | ||
75 | - crow <- multi[i,] | 96 | + dataset.pre |
97 | + } else { | ||
76 | 98 | ||
77 | - country_s <- strsplit(toString(crow$Country), " ") | 99 | + #data.frame with every rows except multi ones |
100 | + dataset <- dataset.pre[!grepl(" ",dataset.pre$Country),] | ||
78 | 101 | ||
79 | - for (j in 1:length(country_s)) { | ||
80 | - Date <- crow[1] | ||
81 | - Attack <- crow[2] | ||
82 | - Target <- crow[3] | ||
83 | - Country <- country_s[[1]][j] | ||
84 | - new.row <- data.frame(Date, Attack, Target, Country) | ||
85 | - print(new.row) | ||
86 | - dataset <- rbind(dataset, new.row) | 102 | + #Iterate over multi |
103 | + for (i in 1:nrow(multi)) { | ||
104 | + crow <- multi[i,] #current row | ||
105 | + | ||
106 | + country_s <- strsplit(toString(crow$Country), " ")[[1]] #each country target | ||
107 | + | ||
108 | + #Iterate over each country target | ||
109 | + for (j in 1:length(country_s)) { | ||
110 | + Date <- crow[1] | ||
111 | + Attack <- crow[2] | ||
112 | + Target <- crow[3] | ||
113 | + Country <- country_s[j] | ||
114 | + new.row <- data.frame(Date, Attack, Target, Country) | ||
115 | + dataset <- rbind(dataset, new.row) #Append new row to output data.frame | ||
116 | + } | ||
87 | } | 117 | } |
88 | - } | ||
89 | 118 | ||
90 | - dataset | 119 | + dataset |
120 | + } | ||
91 | } | 121 | } |
92 | 122 | ||
93 | #' Parse every excel file into a folder | 123 | #' Parse every excel file into a folder |
ISO27001effectiveness/R/ISOSurvey_Parser.R
@@ -69,6 +69,7 @@ ProccesISOSurveyRaw <- function(dataset.raw, years){ | @@ -69,6 +69,7 @@ ProccesISOSurveyRaw <- function(dataset.raw, years){ | ||
69 | #' @param years List of years to return, c("X2006", "X2010", ...) | 69 | #' @param years List of years to return, c("X2006", "X2010", ...) |
70 | #' | 70 | #' |
71 | #' @return data.frame | 71 | #' @return data.frame |
72 | +#' @export | ||
72 | #' | 73 | #' |
73 | #' @examples | 74 | #' @examples |
74 | #' | 75 | #' |
@@ -79,8 +80,24 @@ ProccesISOSurveyByCountryRaw <- function(dataset.raw, years){ | @@ -79,8 +80,24 @@ ProccesISOSurveyByCountryRaw <- function(dataset.raw, years){ | ||
79 | #Standard proccess | 80 | #Standard proccess |
80 | dataset <- ProccesISOSurveyRaw(dataset.raw, years) | 81 | dataset <- ProccesISOSurveyRaw(dataset.raw, years) |
81 | 82 | ||
83 | + dataset$Country <- gsub("Bolivia","Bolivia, Plurinational State of",dataset$Country) | ||
84 | + dataset$Country <- gsub("Cape Verde","Cabo Verde",dataset$Country) | ||
85 | + dataset$Country <- gsub("Congo, Republic of","Congo, the Democratic Republic of the",dataset$Country) | ||
86 | + dataset$Country <- gsub("Côte D'ivoire","Cote d'Ivoire",dataset$Country) | ||
87 | + dataset$Country <- gsub("Gibraltar (UK)","Gibraltar",dataset$Country) | ||
88 | + dataset$Country <- gsub("Hong Kong, China","Hong Kong",dataset$Country) | ||
89 | + dataset$Country <- gsub("Macau, China","Macao",dataset$Country) | ||
90 | + dataset$Country <- gsub("Palestine","Palestine, State of",dataset$Country) | ||
91 | + dataset$Country <- gsub("San Marino, Republic of","San Marino",dataset$Country) | ||
92 | + dataset$Country <- gsub("Taipei, Chinese","Taiwan, Province of China",dataset$Country) | ||
93 | + dataset$Country <- gsub("The Former Yugoslav Republic of Macedonia","Macedonia, the former Yugoslav Republic of",dataset$Country) | ||
94 | + dataset$Country <- gsub("United States of America","United States",dataset$Country) | ||
95 | + dataset$Country <- gsub("Venezuela","Venezuela, Bolivarian Republic of",dataset$Country) | ||
96 | + | ||
97 | + | ||
82 | #Translate country names to 2 letter code | 98 | #Translate country names to 2 letter code |
83 | - CountryNames <- GetCountryAbrev() | 99 | + CountryNames <- data.frame(countrycode::countrycode_data$country.name, countrycode::countrycode_data$iso2c) |
100 | + CountryNames <- setNames(CountryNames, c("Country","country_short")) | ||
84 | dataset <- merge(x = dataset, y = CountryNames, by = "Country", all.x = TRUE) | 101 | dataset <- merge(x = dataset, y = CountryNames, by = "Country", all.x = TRUE) |
85 | 102 | ||
86 | dataset | 103 | dataset |
ISO27001effectiveness/R/Util.R deleted
1 | -#-----------------------------Util functions-------------------------------------------------- | ||
2 | - | ||
3 | -#' Return the 2 letter code of a country relation | ||
4 | -#' | ||
5 | -#' Relation of country names included in the ISO Survey input file with 2 letter code | ||
6 | -#' included on the hackmaggedon input files | ||
7 | -#' | ||
8 | -#' @return data.frame | ||
9 | -GetCountryAbrev <- function(){ | ||
10 | - Country <- c("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bonaire", "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, Republic of", "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Curaçao", "Cyprus", "Czech Republic", "Côte D'ivoire", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar (UK)", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard Island and McDonald Mcdonald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong, China", "Hungary", "Iceland", "India", "Indonesia", "Iran, Islamic Republic of", "Iraq", "Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau, China", "The Former Yugoslav Republic of Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Palestine", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Romania", "Russian Federation", "Rwanda", "Reunion", "Saint Barthelemy", "Saint Helena", "Saint Kitts and Nevis", "Saint Lucia", "Saint Martin (French part)", "Saint Pierre and Miquelon", "Saint Vincent and the Grenadines", "Samoa", "San Marino, Republic of", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Sint Maarten (Dutch part)", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Sudan", "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Timor-Leste", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States of America", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Viet Nam", "British Virgin Islands", "US Virgin Islands", "Wallis and Futuna", "Western Sahara", "Yemen", "Zambia", "Zimbabwe", "Aland Islands", "Taipei, Chinese") | ||
11 | - country_short <- c("AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "HR", "CU", "CW", "CY", "CZ", "CI", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RO", "RU", "RW", "RE", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "AX", "CN") | ||
12 | - | ||
13 | - dataset <- data.frame(Country, country_short) | ||
14 | - | ||
15 | - dataset | ||
16 | -} |
ISO27001effectiveness/man/FilterMultiCountry.Rd
0 → 100644
1 | +% Generated by roxygen2: do not edit by hand | ||
2 | +% Please edit documentation in R/Hackmageddon_Parser.R | ||
3 | +\name{FilterMultiCountry} | ||
4 | +\alias{FilterMultiCountry} | ||
5 | +\title{Look for rows with more than one country target and split into multiple} | ||
6 | +\usage{ | ||
7 | +FilterMultiCountry(dataset.pre) | ||
8 | +} | ||
9 | +\arguments{ | ||
10 | +\item{dataset.pre}{data.frame to process} | ||
11 | +} | ||
12 | +\value{ | ||
13 | +data.frame | ||
14 | +} | ||
15 | +\description{ | ||
16 | +Look for rows with more than one country target and split into multiple | ||
17 | +} | ||
18 | + |
ISO27001effectiveness/man/GetCountryAbrev.Rd deleted
1 | -% Generated by roxygen2: do not edit by hand | ||
2 | -% Please edit documentation in R/Util.R | ||
3 | -\name{GetCountryAbrev} | ||
4 | -\alias{GetCountryAbrev} | ||
5 | -\title{Return the 2 letter code of a country relation} | ||
6 | -\usage{ | ||
7 | -GetCountryAbrev() | ||
8 | -} | ||
9 | -\value{ | ||
10 | -data.frame | ||
11 | -} | ||
12 | -\description{ | ||
13 | -Relation of country names included in the ISO Survey input file with 2 letter code | ||
14 | -included on the hackmaggedon input files | ||
15 | -} | ||
16 | - |
ISO27001effectiveness/man/GetDefaultAttacksData.Rd
0 → 100644
1 | +% Generated by roxygen2: do not edit by hand | ||
2 | +% Please edit documentation in R/Hackmageddon_Parser.R | ||
3 | +\name{GetDefaultAttacksData} | ||
4 | +\alias{GetDefaultAttacksData} | ||
5 | +\title{Parse the default data from the package from hackmaggedon (2012-2016)} | ||
6 | +\usage{ | ||
7 | +GetDefaultAttacksData() | ||
8 | +} | ||
9 | +\value{ | ||
10 | +data.frame | ||
11 | +} | ||
12 | +\description{ | ||
13 | +Parse the default data from the package from hackmaggedon (2012-2016) | ||
14 | +} | ||
15 | +\examples{ | ||
16 | +Attacks <- GetDefaultAttacksData() | ||
17 | +} | ||
18 | + |
ISO27001effectiveness/man/GetISOSurveyCertsPerCountry.Rd
0 → 100644
1 | +% Generated by roxygen2: do not edit by hand | ||
2 | +% Please edit documentation in R/ISOSurvey_Parser.R | ||
3 | +\name{GetISOSurveyCertsPerCountry} | ||
4 | +\alias{GetISOSurveyCertsPerCountry} | ||
5 | +\title{Get data of certificates per year and country from IS27001} | ||
6 | +\usage{ | ||
7 | +GetISOSurveyCertsPerCountry() | ||
8 | +} | ||
9 | +\value{ | ||
10 | +data.frame | ||
11 | +} | ||
12 | +\description{ | ||
13 | +Get data of certificates per year and country from IS27001 | ||
14 | +} | ||
15 | +\examples{ | ||
16 | +Cert_PerCountry <- GetISOSurveyCertsPerCountry() | ||
17 | +} | ||
18 | + |
ISO27001effectiveness/man/GetISOSurveyCertsPerSector.Rd
0 → 100644
1 | +% Generated by roxygen2: do not edit by hand | ||
2 | +% Please edit documentation in R/ISOSurvey_Parser.R | ||
3 | +\name{GetISOSurveyCertsPerSector} | ||
4 | +\alias{GetISOSurveyCertsPerSector} | ||
5 | +\title{Get data of certificates per year and sector from IS27001} | ||
6 | +\usage{ | ||
7 | +GetISOSurveyCertsPerSector() | ||
8 | +} | ||
9 | +\value{ | ||
10 | +data.frame | ||
11 | +} | ||
12 | +\description{ | ||
13 | +Get data of certificates per year and sector from IS27001 | ||
14 | +} | ||
15 | +\examples{ | ||
16 | +Cert_PerSector <- GetISOSurveyCertsPerSector() | ||
17 | +} | ||
18 | + |
ISO27001effectiveness/man/GetISOSurveySitesPerCountry.Rd
0 → 100644
1 | +% Generated by roxygen2: do not edit by hand | ||
2 | +% Please edit documentation in R/ISOSurvey_Parser.R | ||
3 | +\name{GetISOSurveySitesPerCountry} | ||
4 | +\alias{GetISOSurveySitesPerCountry} | ||
5 | +\title{Get data of sites per year and country from IS27001} | ||
6 | +\usage{ | ||
7 | +GetISOSurveySitesPerCountry() | ||
8 | +} | ||
9 | +\value{ | ||
10 | +data.frame | ||
11 | +} | ||
12 | +\description{ | ||
13 | +Get data of sites per year and country from IS27001 | ||
14 | +} | ||
15 | +\examples{ | ||
16 | +Sites_PerCountry <- GetISOSurveySitesPerCountry() | ||
17 | +} | ||
18 | + |
ISO27001effectiveness/man/LoadParserLibraries.Rd deleted
1 | -% Generated by roxygen2: do not edit by hand | ||
2 | -% Please edit documentation in R/Util.R | ||
3 | -\name{LoadParserLibraries} | ||
4 | -\alias{LoadParserLibraries} | ||
5 | -\title{Install and load required libraries} | ||
6 | -\usage{ | ||
7 | -LoadParserLibraries() | ||
8 | -} | ||
9 | -\description{ | ||
10 | -This function checks if every required library is installed to be loaded, if not they will be installed and then loaded. | ||
11 | -Libraries installed: | ||
12 | - xlsx to parse excel files like ISO survey source format | ||
13 | -} | ||
14 | - |
ISO27001effectiveness/man/ParseHMExcel.Rd
0 → 100644
1 | +% Generated by roxygen2: do not edit by hand | ||
2 | +% Please edit documentation in R/Hackmageddon_Parser.R | ||
3 | +\name{ParseHMExcel} | ||
4 | +\alias{ParseHMExcel} | ||
5 | +\title{Parse an excel raw data file from armaggedon} | ||
6 | +\usage{ | ||
7 | +ParseHMExcel(file, cols) | ||
8 | +} | ||
9 | +\arguments{ | ||
10 | +\item{file}{path to the excel file} | ||
11 | + | ||
12 | +\item{cols}{list of columns index to read} | ||
13 | +} | ||
14 | +\value{ | ||
15 | +data.frame | ||
16 | +} | ||
17 | +\description{ | ||
18 | +Parse an excel raw data file from armaggedon | ||
19 | +} | ||
20 | +\examples{ | ||
21 | +data.raw <- ParseHMExcel("./data/hackmaggedon/file.xls", c(2, 3, 6, 5)) | ||
22 | +} | ||
23 | + |
ISO27001effectiveness/man/ParseHMFolder.Rd
0 → 100644
1 | +% Generated by roxygen2: do not edit by hand | ||
2 | +% Please edit documentation in R/Hackmageddon_Parser.R | ||
3 | +\name{ParseHMFolder} | ||
4 | +\alias{ParseHMFolder} | ||
5 | +\title{Parse every excel file into a folder} | ||
6 | +\usage{ | ||
7 | +ParseHMFolder(folder, cols, dateOffset) | ||
8 | +} | ||
9 | +\arguments{ | ||
10 | +\item{folder}{path to the folder to iterate} | ||
11 | + | ||
12 | +\item{cols}{columns to parse into each file} | ||
13 | + | ||
14 | +\item{dateOffset}{origin to calc the dates into each file} | ||
15 | +} | ||
16 | +\value{ | ||
17 | +data.frame | ||
18 | +} | ||
19 | +\description{ | ||
20 | +Parse every excel file into a folder | ||
21 | +} | ||
22 | +\examples{ | ||
23 | +data.pro <- ProcessHMRaw("./data/hackmaggedon/", c(1, 5, 3) "1899-12-30") | ||
24 | +} | ||
25 | + |
ISO27001effectiveness/man/ProccesISOSurveyByCountryRaw.Rd
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | % Please edit documentation in R/ISOSurvey_Parser.R | 2 | % Please edit documentation in R/ISOSurvey_Parser.R |
3 | \name{ProccesISOSurveyByCountryRaw} | 3 | \name{ProccesISOSurveyByCountryRaw} |
4 | \alias{ProccesISOSurveyByCountryRaw} | 4 | \alias{ProccesISOSurveyByCountryRaw} |
5 | -\title{Process raw data from ISO survey} | 5 | +\title{Join data from ISOSurvey with 2 letter code countries plus process raw.data} |
6 | \usage{ | 6 | \usage{ |
7 | ProccesISOSurveyByCountryRaw(dataset.raw, years) | 7 | ProccesISOSurveyByCountryRaw(dataset.raw, years) |
8 | } | 8 | } |
@@ -15,12 +15,11 @@ ProccesISOSurveyByCountryRaw(dataset.raw, years) | @@ -15,12 +15,11 @@ ProccesISOSurveyByCountryRaw(dataset.raw, years) | ||
15 | data.frame | 15 | data.frame |
16 | } | 16 | } |
17 | \description{ | 17 | \description{ |
18 | -Proccess the raw data from ISO survey to replace NAs, normalizate country names and filter years | 18 | +Join data from ISOSurvey with 2 letter code countries plus process raw.data |
19 | } | 19 | } |
20 | \examples{ | 20 | \examples{ |
21 | 21 | ||
22 | Cert_PerCountry <- ProccesISOSurveyRaw(Cert_PerCountry, c("X2010", "X2011", "X2012", "X2013", "X2014", "X2015")) | 22 | Cert_PerCountry <- ProccesISOSurveyRaw(Cert_PerCountry, c("X2010", "X2011", "X2012", "X2013", "X2014", "X2015")) |
23 | Sites_PerCountry <- ProccesISOSurveyRaw(Sites_PerCountry, c("X2010", "X2011", "X2012", "X2013", "X2014", "X2015")) | 23 | Sites_PerCountry <- ProccesISOSurveyRaw(Sites_PerCountry, c("X2010", "X2011", "X2012", "X2013", "X2014", "X2015")) |
24 | -Cert_PerSector <- ProccesISOSurveyRaw(Cert_PerSector, c("X2010", "X2011", "X2012", "X2013", "X2014", "X2015")) | ||
25 | } | 24 | } |
26 | 25 |
ISO27001effectiveness/man/ProccesISOSurveyRaw.Rd
0 → 100644
1 | +% Generated by roxygen2: do not edit by hand | ||
2 | +% Please edit documentation in R/ISOSurvey_Parser.R | ||
3 | +\name{ProccesISOSurveyRaw} | ||
4 | +\alias{ProccesISOSurveyRaw} | ||
5 | +\title{PRocess raw data parsed from excel file ISOSurvey27001} | ||
6 | +\usage{ | ||
7 | +ProccesISOSurveyRaw(dataset.raw, years) | ||
8 | +} | ||
9 | +\arguments{ | ||
10 | +\item{dataset.raw}{data.frame with raw data} | ||
11 | + | ||
12 | +\item{years}{list of years to include preceded with a X} | ||
13 | +} | ||
14 | +\value{ | ||
15 | +data.frame | ||
16 | +} | ||
17 | +\description{ | ||
18 | +PRocess raw data parsed from excel file ISOSurvey27001 | ||
19 | +} | ||
20 | +\examples{ | ||
21 | +Cert_PerSector <- ProccesISOSurveyRaw(Cert_PerSector, c("X2010", "X2011", "X2012", "X2013", "X2014", "X2015")) | ||
22 | +} | ||
23 | + |
ISO27001effectiveness/man/ProcessHMRaw.Rd
0 → 100644
1 | +% Generated by roxygen2: do not edit by hand | ||
2 | +% Please edit documentation in R/Hackmageddon_Parser.R | ||
3 | +\name{ProcessHMRaw} | ||
4 | +\alias{ProcessHMRaw} | ||
5 | +\title{Prepare raw data from hackmaggedon's excel to use it} | ||
6 | +\usage{ | ||
7 | +ProcessHMRaw(dataset.raw, dateOffset) | ||
8 | +} | ||
9 | +\arguments{ | ||
10 | +\item{dataset.raw}{data.frame with raw data} | ||
11 | + | ||
12 | +\item{dateOffset}{origin to add the numeric date} | ||
13 | +} | ||
14 | +\value{ | ||
15 | +data.frame | ||
16 | +} | ||
17 | +\description{ | ||
18 | +Prepare raw data from hackmaggedon's excel to use it | ||
19 | +} | ||
20 | +\examples{ | ||
21 | +data.pro <- ProcessHMRaw(data.raw, "1899-12-30") | ||
22 | +} | ||
23 | + |