Extracting coordinates from Shape File

Sorry for the error, B.points is a vector of length one, so B[1].points should access the points field of the first element.