R Dataset / Package psych / cities
Attachment | Size |
---|---|
dataset-20432.csv | 638 bytes |
Documentation |
---|
On this Picostat.com statistics page, you will find information about the cities data set which pertains to Distances between 11 US cities. The cities data set is found in the psych R package. Try to load the cities data set in R by issuing the following command at the console data("cities"). This may load the data into a variable called cities. If R says the cities data set is not found, you can try installing the package by issuing this command install.packages("psych") and then attempt to reload the data with library("psych") followed by data("cities"). Perhaps strangley, if R gives you no output after entering a command, it means the command succeeded. If it succeeded you can see the data by typing cities at the command-line which should display the entire dataset. If you need to download R, you can go to the R project website. You can download a CSV (comma separated values) version of the cities R data set. The size of this file is about 638 bytes. Distances between 11 US citiesDescriptionAirline distances between 11 US cities may be used as an example for multidimensional scaling or cluster analysis. Usagedata(cities) FormatA data frame with 11 observations on the following 11 variables.
DetailsAn 11 x11 matrix of distances between major US airports. This is a useful demonstration of multiple dimensional scaling. city.location is a dataframe of longitude and latitude for those cities. Note that the 2 dimensional MDS solution does not perfectly capture the data from these city distances. Boston, New York and Washington, D.C. are located slightly too far west, and Seattle and LA are slightly too far south. Sourcehttp://www.timeanddate.com/worldclock/distance.html Examplesdata(cities) city.location[,1] <- -city.location[,1] #not run #an overlay map can be added if the package maps is available # # #libary(maps) #map("usa") #title("MultiDimensional Scaling of US cities") #points(city.location)plot(city.location, xlab="Dimension 1", ylab="Dimension 2", main ="Multidimensional scaling of US cities") city.loc <- cmdscale(cities, k=2) #ask for a 2 dimensional solution round(city.loc,0) city.loc <- -city.loc city.loc <- rescale(city.loc,apply(city.location,2,mean),apply(city.location,2,sd)) points(city.loc,type="n") text(city.loc,labels=names(cities)) -- Dataset imported from https://www.r-project.org. |
Picostat Manual |
---|
How To Register With a Username
How To Register With Google Single Sign On (SSO)
How To Login With a Username and Password
How To Login With Google Single Sign On (SSO)
How To Import a Dataset
How To Perform Statistical Analysis with Picostat
How To Use Educational Applications with Picostat
|
Recent Queries For This Dataset |
---|
No queries made on this dataset yet. |
Title | Authored on | Content type |
---|---|---|
R Dataset / Package datasets / sunspot.year | March 9, 2018 - 1:06 PM | Dataset |
R Dataset / Package datasets / airmiles | March 9, 2018 - 1:06 PM | Dataset |
R Dataset / Package Stat2Data / SampleFG | March 9, 2018 - 1:06 PM | Dataset |
OpenIntro Statistics Dataset - toy_anova | August 9, 2020 - 2:38 PM | Dataset |
swiss | February 26, 2017 - 11:28 AM | Dataset |