# These are the methode which can store multi type not like vector array or matrix.

Country_data_1 = data.frame(country = c('India', 'US', 'UK'), 
population = c(1420000000, 50000000, 45000000), EU = c(FALSE,TRUE,TRUE))
Country_data_1

class(Country_data_1)

# to make country name as row names 
Country_data_2 = data.frame(population = c(1420000000, 50000000, 45000000)
, EU = c(FALSE, TRUE, TRUE), row.names=c('India', 'USA','UK'))
Country_data_2

print(' ')
print('fetching data from "Country_data_1" variable')
Country_data_1[1,]
Country_data_1[,2]
#or 
print(' ')
print('Which country belongs to Europian Union')
print(Country_data_1[,'country'])
Country_data_1[,'EU']

print(' ')
print('Fetching the data from "Country_data_2" variable')
Country_data_2['India','EU']
#or
Country_data_2[1,2]
Country_data_2[c(1,3),c('population','EU')]

Country_data_2[,'population'] = Country_data_2[,'population']/100000
colnames(Country_data_2) = c('Population(in milions)','EU')
Country_data_2[]
print(' ')
print('function is used in data frame')
dim(Country_data_2)
dim(Country_data_1)

nrow(Country_data_1)
nrow(Country_data_2)

ncol(Country_data_2)
ncol(Country_data_1)

print(' ')
print('to get the number of rows either from top or from bottom') 
head(Country_data_1,2)
tail(Country_data_2,2)

str(Country_data_1)

print(' ')
print('Will provide min max median and other data for numeric column')
summary(Country_data_2)

print(' ')
print('To get the row names and column names of data frame')
row.names(Country_data_1)
print('To fetch column names')
colnames(Country_data_1)
#or
names(Country_data_1)

row.names(Country_data_2)
names(Country_data_2)


























Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: