Reference no: EM131082257
In Section 11.8.3 we saw that the latitudes and longitudes for the countries are available on the Web, embedded in the page at https://dev.maxmind.com/geoip/ legacy/codes/average-latitude-and-longitude-for-countries/. A snippet of the HTML source for this page is shown in Figure 11.10. Extract these location coordinates from this HTML file.
Examine the HTML source, and notice that the data are simply placed as plain text within a node in the document. If we can extract the contents of this node, then we can place this information in a data frame. Begin by parsing
the HTML document with html Parse(). Don't download the document, simply pass the function the URL, https://dev.maxmind.com/geoip/legacy/codes/ average-latitude-and-longitude-for-countries.
Next, access the root of the document using xml Root (), and use an X Path expression to locate the nodes in the document.
The get Node Set() function should be useful here. The get Node Set() function takes the XML tree (or sub tree) and an X Path expression as input and returns a list of all nodes in the tree that are located with this expression.
Once you have located these nodes, check to see how many were found. It should be only one. The latitude and longitude values are in the text content of this node. Extract the text content with the xml Value () function. It should look something like:
The content is one long character string containing all the data.
Complete the exercise by reading the plain text in your character vector into a data frame. Use read table () to do this. The parameters, text, skip, header, and sep should be useful here.
Compute the net present worth to determine whether
: A machine costs $1,000,000 to purchase and will produce $200,000 per year revenue. Annual operating and maintenance cost is $50,000. The company plans to use the machine for 10 years and then sell it for scrap for which it expects to receive $50,000...
|
Company must receive each year to breakeven on investment
: A company purchases a new unit of machinery for $20,000. The machinery is to be sold at the end of 10 years for $2,000.If the company uses a MARR of 10%, what is the equivalent uniform net profit cash flow the company must receive each year to breake..
|
Find a formula for the number of cells as a function of time
: Functions worksheet. A confused cell with a terrifying genetic mutation divides into two cells exactly one minute after being created. Then, after another minute each of the two new cells will divide, and so on. Find a formula for the number of cel..
|
Main components of financial analysis
: What are the main components of ‘Financial Analysis' while working out the Detail Project Report? Why ‘Margin Money' for working capital is required to be provided as ‘Initial Investment' for the first year of operation?
|
Extract these location coordinates from this html file
: Complete the exercise by reading the plain text in your character vector into a data frame. Use read table () to do this. The parameters, text, skip, header, and sep should be useful here.
|
Question regarding the chicago manual style
: Sociologist argue that the individual must first learn society's culture in order to effectively interact with those around him/her. to What extent to you agree to this statement.
|
What interest rate must the investment earn
: A teacher invests $5,000 at the end of every year for a 30-year career.If this teacher wants to have $1,000,000 in savings at retirement, what interest rate must the investment earn? (Show Work)
|
Different strategic approach
: While PetSmart's prices are 11 percent lower on an average than Petco's, it stresses the services offered in its stores to boost revenues and profitability.Petco's strategy is to have smaller stores with more space for merchandise. Both companies ..
|
Cost-benefit analysis and cost-effectiveness analysis
: The difference between a basic “cost-benefit analysis” and a “cost-effectiveness analysis”. In addition, tell me a potential scenario where a cost effectiveness analysis should be used instead of a cost benefit analysis.
|