The function should be named "hemisphereSummary" and have the following

computer science

Description

R Programming assignment. Instructions are in the assignment.

Requirements:
#	1) The function should be named "hemisphereSummary" and have the following
#		parameters:
#		df : the input data frame (two columns) containing x and y values.
#		projargs: the character string of projection arguments, and should
#			default to "+proj=longlat +datum=WGS84".
#	2) Within the function, you can (and should) load the libraries "sp" and 
#		"foreach".  No other libraries may be used.
#	3) Within the function, register a sequential backend to foreach.
#		Hint: help(package="foreach")
#	4) Before determining the hemispheres, the input data frame must be 
#		converted to a SpatialPoints object (with the correct projection
#		arguments).
#	5) The SpatialPoints object (not the input data frame) should be examined 
#		one point at a time using a foreach loop.  
#	6) The loop should determine whether a point is in the northern or southern 
#		hemisphere (we will count equatorial points as "north"), returned as
#		a factor "N" or "S".
#	7) The loop should also determine whether a point is in the eastern or western
#		hemisphere (prime meridian points should be "east"), returned as a factor
#		"E" or "W".
#	8) The final SpatialPointsDataFrame should have two attributes, "NShemisphere"
#		and "EWhemisphere", rownames should be set to NULL, and be returned from the function.
#	9) Comment your code in at least 3 places.
#	10) The code should be submitted tom Compass 2g as a single function with the filename:
#		LastName-FirstName-geog489-s20-assignment-05.R
#	and should have at the top:

Instruction Files

Related Questions in computer science category