Extract these location coordinates from this html file

Assignment Help Basic Computer Science
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.

1125_585f1ed3-a53c-4c9f-9f12-2987f6b910ac.png

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:

1258_74a2e234-b6e7-4849-ab09-48f5aad8d8db.png

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.

Reference no: EM131082257

Questions Cloud

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.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Deterministic finite automaton

1. Consider the deterministic finite automaton M = ({q1, q2, q3}, {0, 1}, ∂, q1, {q2}) where is dened as follows:

  Does the influence of philosophy end there

How much of a disadvantage do computer scientists have considering all the other sciences like civil engineering, chemistry, physics, etc are hundreds of years old?

  Printed circuit board

What is a printed circuit board on which the CPU, RAM chips and other electronic circuit elements of a digital computer are frequently located?

  Circular path and capable of terminating

If I am currently located at any node (let's call it A) and I want to find another specific node (let's call it B), what kind of algorithm would be most efficient in finding node B without getting stuck in a circular path and capable of terminatin..

  Problem regarding the fuel consumption rating

The Gather's have 2 cars. Last year, one car was driven about 13 500 km and has a fuel consumption rating of 8.1L/100km and 55 625km was put on the other car which has a fuel consumption rating of 6.3L/100km

  Prepare an issues paper - current aspect of e-commerce

You are required to prepare an issues paper (a discussion of views of 2000 words in length) relating to some current aspect of e-Commerce.

  Displays the total amount for each service category

?? P7.17Write a program that reads a text file as described in Exercise P7.16, and that writes a separate file for each service category, containing the entries for that category. Name the output files Dinner.txt, Conference.txt, and so on.

  What is the average length of the search for worst-fit

another placement algorithm for dynamic partitioning is referred to as worst-fit. In this case, the largest free block of memory is used for bringing in process. Discuss the pros and cons of this method compared to first-, next-, and best fit. Wha..

  Write a function which has this exact signature

however. As an example, if the main() function were: int main() { double x[] = {2,4,4,4,5,5,7,-9}; cout

  Establishing network between windows-linux computers

To network a Windows desktop and a computer running RedHat Linux, what will you need and what steps will you take?

  What does the sql query

What does the following SQL query do? sqlStr = "SELECT* FROM computers WHERE Speed >2 AND Memory > 4 ORDER BY OS-Type"

  Assignment on mobile app work breakdown structure

Create a Gantt chart for the project. Take a screenshot of the Gantt chart which can later be inserted into your written paper.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd