{"size":{"Width":330,"Height":530},"appearance":{"background":null,"padding":14,"font":{"family":"Courier New","size":10.0,"bold":false,"italic":false,"underline":false,"strikeout":false,"color":"rgb(0,72,168)"},"border":{"on":true,"size":0.0,"style":"solid","color":"#666"},"text":{"wrap":false,"hAlign":"left","vAlign":"top"}},"outputType":"TABLE","widgetState":null,"outputs":{"text":" Hawaii Minnesota Connecticut \n 81.3 81.1 80.8 \n California Massachusetts New York \n 80.8 80.5 80.5 \n Vermont New Hampshire New Jersey \n 80.5 80.3 80.3 \n Utah Colorado Wisconsin \n 80.2 80.0 80.0 \n Washington Rhode Island Nebraska \n 79.9 79.9 79.8 \n Iowa Arizona North Dakota \n 79.7 79.6 79.5 \n Oregon Idaho South Dakota \n 79.5 79.5 79.5 \n Florida Maine Virginia \n 79.4 79.2 79.0 \n Illinois Maryland Kansas \n 79.0 78.8 78.7 \n Pennsylvania Montana Texas \n 78.5 78.5 78.5 \n New Mexico Delaware Wyoming \n 78.4 78.4 78.3 \n Alaska Michigan Nevada \n 78.3 78.2 78.1 \n North Carolina Ohio Indiana \n 77.8 77.8 77.6 \n Missouri GA South Carolina \n 77.5 77.2 77.0 \nDistrict of Columbia Tennessee Arkansas \n 76.5 76.3 76.0 \n Kentucky Oklahoma Louisiana \n 76.0 75.9 75.7 \n Alabama West Virginia Mississippi \n 75.4 75.4 75.0 \n","console":"<pre class='debug-source'>>library(rvest)\n</pre>\n<pre class='debug-message'>Loading required package: xml2\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>># Reading in the table from wikipedia\n</pre>\n<pre class='debug-source'>>page = read_html("https://en.wikipedia.org/wiki/List_of_U.S._states_by_life_expectancy")\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>># Obtain the peice of the web page that corresponds to the "wikitable" node\n</pre>\n<pre class='debug-source'>>my.table = html_node(page, ".wikitable")\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>># Convert the html table element into a data frame\n</pre>\n<pre class='debug-source'>>my.table = html_table(my.table, fill = TRUE)\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>># Extracting the columns from the table and turning into a named vector\n</pre>\n<pre class='debug-source'>>x <- my.table[,4]\n</pre>\n<pre class='debug-source'>>names(x) = my.table[,3]\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>># Excluding non-states and averages from the table\n</pre>\n<pre class='debug-source'>>x = x[!as.character(my.table[,3]) %in% c("78.9", "Northern Mariana Islands", "Guam", "American Samoa", "Puerto Rico", "U.S. Virgin Islands")]\n</pre>\n<pre class='debug-source'>>names(x)[names(x) == "Georgia"] = "GA"\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>># Outputting as an object with a better name\n</pre>\n<pre class='debug-source'>>life.expectancy = x\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>>\n</pre>\n<pre class='debug-source'>># Move the company names into the rows of the table\n</pre>\n<pre class='debug-source'>># row.names(my.table) = my.table[, "State"]\n</pre>\n<pre class='debug-source'>># # Remove columns not needed\n</pre>\n<pre class='debug-source'>># my.table = my.table[, -c(2,7,8)]\n</pre>\n<pre class='debug-source'>># # Convert dollars and percentages into numeric values\n</pre>\n<pre class='debug-source'>># my.table[, 3] = parse_number(my.table[, 3])\n</pre>\n<pre class='debug-source'>># my.table[, 4] = parse_number(my.table[, 4])\n</pre>\n<pre class='debug-source'>># my.table[, 5] = parse_number(my.table[, 5])\n</pre>\n<pre class='debug-source'>># my.table\n</pre>\n<pre class='debug-source'>>#x\n</pre>\n<pre class='debug-out'> Hawaii Minnesota Connecticut \n 81.3 81.1 80.8 \n California Massachusetts New York \n 80.8 80.5 80.5 \n Vermont New Hampshire New Jersey \n 80.5 80.3 80.3 \n Utah Colorado Wisconsin \n 80.2 80.0 80.0 \n Washington Rhode Island Nebraska \n 79.9 79.9 79.8 \n Iowa Arizona North Dakota \n 79.7 79.6 79.5 \n Oregon Idaho South Dakota \n 79.5 79.5 79.5 \n Florida Maine Virginia \n 79.4 79.2 79.0 \n Illinois Maryland Kansas \n 79.0 78.8 78.7 \n Pennsylvania Montana Texas \n 78.5 78.5 78.5 \n New Mexico Delaware Wyoming \n 78.4 78.4 78.3 \n Alaska Michigan Nevada \n 78.3 78.2 78.1 \n North Carolina Ohio Indiana \n 77.8 77.8 77.6 \n Missouri GA South Carolina \n 77.5 77.2 77.0 \nDistrict of Columbia Tennessee Arkansas \n 76.5 76.3 76.0 \n Kentucky Oklahoma Louisiana \n 76.0 75.9 75.7 \n Alabama West Virginia Mississippi \n 75.4 75.4 75.0 \n</pre>\r\n<div class=\"debug-summarystatistics\"><table>\r\n<tr><th>Started:</th><td class=utc-time>2018-09-22T10:46:29.046Z</td></tr>\r\n<tr><th>Finished:</th><td class=utc-time>2018-09-22T10:46:29.046Z</td></tr>\r\n<tr><th>Total time:</th><td>0.58s</td></tr>\r\n<tr><th>Time executing code:</th><td title=\"0.04s\">0.54s</td></tr>\r\n<tr><th>Other overhead on R server:</th><td>0.39s</td></tr>\r\n<tr><th>Time spent transferring data:</th><td>0.04s</td></tr>\r\n<tr><th>Data sent to R server:</th><td>1.7KB</td></tr>\r\n<tr><th>Data received from R server:</th><td>12.3KB</td></tr>\r\n</table></div>","message":"Loading required package: xml2\n","warning":"","table":"{\"Dimensions\":[{\"IsStatistic\":true,\"Elements\":[{\"IsNumber\":true,\"IsBoolean\":false,\"IsDateTime\":false,\"IsPercent\":false,\"HasDecimalPlaces\":true,\"DecimalPlaces\":1,\"MoneySymbol\":null,\"IsCategorical\":false,\"Categories\":[],\"SeriesType\":0,\"Id\":\"StatisticsElement0\",\"Name\":\"\",\"WrappedName\":[\"\"],\"IsText\":false}],\"Id\":\"StatisticsDimensionID\",\"Name\":null,\"WrappedName\":null,\"Tiers\":[],\"Count\":1},{\"IsStatistic\":false,\"Elements\":[{\"Id\":\"RowDimensionElement31\",\"Name\":\"Delaware\",\"WrappedName\":[\"Delaware\"]},{\"Id\":\"RowDimensionElement32\",\"Name\":\"Wyoming\",\"WrappedName\":[\"Wyoming\"]},{\"Id\":\"RowDimensionElement33\",\"Name\":\"Alaska\",\"WrappedName\":[\"Alaska\"]},{\"Id\":\"RowDimensionElement34\",\"Name\":\"Michigan\",\"WrappedName\":[\"Michigan\"]},{\"Id\":\"RowDimensionElement35\",\"Name\":\"Nevada\",\"WrappedName\":[\"Nevada\"]},{\"Id\":\"RowDimensionElement36\",\"Name\":\"North Carolina\",\"WrappedName\":[\"North Carolina\"]},{\"Id\":\"RowDimensionElement37\",\"Name\":\"Ohio\",\"WrappedName\":[\"Ohio\"]},{\"Id\":\"RowDimensionElement38\",\"Name\":\"Indiana\",\"WrappedName\":[\"Indiana\"]},{\"Id\":\"RowDimensionElement39\",\"Name\":\"Missouri\",\"WrappedName\":[\"Missouri\"]},{\"Id\":\"RowDimensionElement40\",\"Name\":\"GA\",\"WrappedName\":[\"GA\"]},{\"Id\":\"RowDimensionElement41\",\"Name\":\"South Carolina\",\"WrappedName\":[\"South Carolina\"]},{\"Id\":\"RowDimensionElement42\",\"Name\":\"District of Columbia\",\"WrappedName\":[\"District of Columbia\"]},{\"Id\":\"RowDimensionElement43\",\"Name\":\"Tennessee\",\"WrappedName\":[\"Tennessee\"]},{\"Id\":\"RowDimensionElement44\",\"Name\":\"Arkansas\",\"WrappedName\":[\"Arkansas\"]},{\"Id\":\"RowDimensionElement45\",\"Name\":\"Kentucky\",\"WrappedName\":[\"Kentucky\"]},{\"Id\":\"RowDimensionElement46\",\"Name\":\"Oklahoma\",\"WrappedName\":[\"Oklahoma\"]},{\"Id\":\"RowDimensionElement47\",\"Name\":\"Louisiana\",\"WrappedName\":[\"Louisiana\"]},{\"Id\":\"RowDimensionElement48\",\"Name\":\"Alabama\",\"WrappedName\":[\"Alabama\"]},{\"Id\":\"RowDimensionElement49\",\"Name\":\"West Virginia\",\"WrappedName\":[\"West Virginia\"]},{\"Id\":\"RowDimensionElement50\",\"Name\":\"Mississippi\",\"WrappedName\":[\"Mississippi\"]}],\"Id\":\"RowCategoricalDimension\",\"Name\":null,\"WrappedName\":null,\"Tiers\":[],\"Count\":20}],\"DataPoints\":[[{\"Value\":78.4,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":78.3,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":78.3,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":78.2,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":78.1,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":77.8,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":77.8,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":77.6,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":77.5,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":77.2,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":77.0,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":76.5,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":76.3,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":76.0,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":76.0,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":75.9,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":75.7,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":75.4,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":75.4,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null},{\"Value\":75.0,\"WrappedText\":null,\"IsBlank\":null,\"Significance\":null,\"ExtraText\":null}]],\"Settings\":{\"CellDimensionId\":null,\"RowDimensionsIds\":[\"RowCategoricalDimension\"],\"ColumnDimensionsIds\":[\"StatisticsDimensionID\"],\"ColumnHeadersHidden\":true,\"Title\":null,\"Footnote\":\"Showing 32 to 51 of 51 rows.\",\"IsRowHeadersSortable\":false,\"IsColumnHeadersSortable\":true,\"HeaderSorts\":[],\"IsRowHeadersFilterable\":false,\"IsColumnHeadersFilterable\":true,\"HeaderFilters\":[],\"PaginationParameters\":{\"StartElement\":31,\"EndElement\":50,\"TotalElements\":51,\"IsRows\":true,\"ShowingElement\":null},\"TableStyleCssClass\":\"style-97ba0187-37c0-47a1-a4ad-31b0f5281e77-1-_-8\",\"LiveTableFormat\":{},\"AvailableWidth\":330,\"AvailableHeight\":530,\"TableWidth\":null}}"},"secondsTaken":0.578129,"updated":"2018-09-22T10:46:29.0622418Z","lastUpdatedMessage":null,"executedCode":"library(rvest)\n\n# Reading in the table from wikipedia\npage = read_html(\"https://en.wikipedia.org/wiki/List_of_U.S._states_by_life_expectancy\")\n\n# Obtain the peice of the web page that corresponds to the \"wikitable\" node\nmy.table = html_node(page, \".wikitable\")\n\n# Convert the html table element into a data frame\nmy.table = html_table(my.table, fill = TRUE)\n\n# Extracting the columns from the table and turning into a named vector\nx <- my.table[,4]\nnames(x) = my.table[,3]\n\n\n\n# Excluding non-states and averages from the table\nx = x[!as.character(my.table[,3]) %in% c(\"78.9\", \"Northern Mariana Islands\", \"Guam\", \"American Samoa\", \"Puerto Rico\", \"U.S. Virgin Islands\")]\nnames(x)[names(x) == \"Georgia\"] = \"GA\"\n\n# Outputting as an object with a better name\nlife.expectancy = x\n\n\n\n\n# Move the company names into the rows of the table\n# row.names(my.table) = my.table[, \"State\"]\n# # Remove columns not needed\n# my.table = my.table[, -c(2,7,8)]\n# # Convert dollars and percentages into numeric values\n# my.table[, 3] = parse_number(my.table[, 3])\n# my.table[, 4] = parse_number(my.table[, 4])\n# my.table[, 5] = parse_number(my.table[, 5])\n# my.table\n#x","lastSavedCode":"library(rvest)\n\n# Reading in the table from wikipedia\npage = read_html(\"https://en.wikipedia.org/wiki/List_of_U.S._states_by_life_expectancy\")\n\n# Obtain the peice of the web page that corresponds to the \"wikitable\" node\nmy.table = html_node(page, \".wikitable\")\n\n# Convert the html table element into a data frame\nmy.table = html_table(my.table, fill = TRUE)\n\n# Extracting the columns from the table and turning into a named vector\nx <- my.table[,4]\nnames(x) = my.table[,3]\n\n\n\n# Excluding non-states and averages from the table\nx = x[!as.character(my.table[,3]) %in% c(\"78.9\", \"Northern Mariana Islands\", \"Guam\", \"American Samoa\", \"Puerto Rico\", \"U.S. Virgin Islands\")]\nnames(x)[names(x) == \"Georgia\"] = \"GA\"\n\n# Outputting as an object with a better name\nlife.expectancy = x\n\n\n\n\n# Move the company names into the rows of the table\n# row.names(my.table) = my.table[, \"State\"]\n# # Remove columns not needed\n# my.table = my.table[, -c(2,7,8)]\n# # Convert dollars and percentages into numeric values\n# my.table[, 3] = parse_number(my.table[, 3])\n# my.table[, 4] = parse_number(my.table[, 4])\n# my.table[, 5] = parse_number(my.table[, 5])\n# my.table\n#x","highlightedCodeSpans":[],"tableTransformations":"<TabularTransformer>\r\n <TabularTransform type=\"Truncation\" truncationHeaderType=\"Column\" />\r\n <TabularTransform currentRow=\"31\" />\r\n</TabularTransformer>","tabularFilteringOptions":null,"hasGuiControls":false,"guiControls":{"Code":"","JSError":null,"JSErrorDetails":null,"ControlDefinitionErrors":null,"InputValidationErrors":null,"Controls":[{"ItemGuid":"00000000-0000-0000-0000-000000000000","ControlName":null,"Page":null,"Group":null,"Type":null,"Label":null,"LabelEmphasised":false,"Value":null,"Allowed":null,"Multi":false,"Prompt":null,"ErrorMessage":null,"Invalid":null,"Required":false,"AllowedTypes":null,"OwnerRItemGuid":null,"MinInputs":0,"MaxInputs":0,"Height":0,"Duplicates":false,"Values":null,"CheckAlign":null,"Text":null,"Increment":0.0,"Min":0.0,"Max":0.0,"Vertical":true}]},"calculating":"Idle","showDebug":false,"layout":"OutputOnly","vSplit":0.25,"hSplit":0.45,"updateWarnings":true,"updateMode":"Automatic","warnSlow":true,"Options":{"debugconsole":false,"codeposition":"OutputOnly","splitH":0.45,"splitV":0.25,"update warnings":true,"updating":"Automatic","warn slow":true}}