3. R has a built-in character vector of US State names, state.name. Use this cha
ID: 3914875 • Letter: 3
Question
3. R has a built-in character vector of US State names, state.name. Use this character vector and R's character functions to answer the following questions.Show R code
(a) List all the US State names that are more than one word. How many are there?
(b) What is the longest US State name(s) (including spaces) and how long is it?
(c) What is the longest single word US State name and how long is it?
(d) List all the US State names, where all of the upper and lower case “a"s are replaced with a capital “Z".
Explanation / Answer
Answer:
Data sets related to the states of the USA
Details:
state.area:
this vector had numeric area as state areas in square miles.
state.center:
list with components named x and y approxmate geographic center of each state
state.division:
factor giving state divisions
state.name:
character vector with state full names.
state.region:
factor giving the region
state.x77:
matrix with 50 rows and 8 columns for below columns
population: estimated population by 1st july 1975
Income: per capita Income by 1974
illiteracy: illiteracy by 1970 in %.
life exp: life expectancy for 1969-71
murder:murder aand non-negligent manslaughter per 100000population by 1976.
frost:
Mean number of days with minimum temperature feezing 1931-1960
Area:
land area in square miles
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.