Posts

Showing posts with the label Data Analyze
Image
 CROSSTABLES IN R | DATA VISUALIZATION A crosstable, also known as a contingency table, is a table showing the frequency of occurrences of certain events or values within different groups or categories. In R, the table() function can be used to create a crosstable. For example, if you have a categorical variable "Gender" and another categorical variable "Age group", you can create a crosstable showing the number of occurrences of each age group for each gender by running: # Create example data Gender <- sample ( c ( "Male" , "Female" ) , 100 , replace = TRUE ) Age <- sample ( 18 : 80 , 100 , replace = TRUE ) Age_Group <- cut ( Age, c ( 18 , 30 , 40 , 50 , 60 , 70 , 80 ) , labels = c ( "18-29" , "30-39" , "40-49" , "50-59" , "60-69" , "70-79" ) ) data <- data.frame ( Gender, Age_Group ) table ( data $Gender , data $Age_Group ) 18-29 30-39 40-49 50-59 60-69 70-79...
Image
WORLD MAP | K-MEANS CUSTERING | DATA VISUALIZATION read the dataset df <- read.csv("C:/Users/Asus/Desktop/VERİ BİLİMİ YÜKSEK LİSANS/R -Data Visualisation/blog/blog-9/worldcities.csv") head(df) > str(df) 'data.frame': 26569 obs. of  11 variables:  $ city      : chr  "Tokyo" "Jakarta" "Delhi" "Mumbai" ...  $ city_ascii: chr  "Tokyo" "Jakarta" "Delhi" "Mumbai" ...  $ lat       : num  35.69 -6.21 28.66 18.97 14.6 ...  $ lng       : num  139.7 106.8 77.2 72.8 121 ...  $ country   : chr  "Japan" "Indonesia" "India" "India" ...  $ iso2      : chr  "JP" "ID" "IN" "IN" ...  $ iso3      : chr  "JPN" "IDN" "IND" "IND" ...  $ admin_name: chr  "Tōkyō" "Jakarta" "Delhi" "Mahārāshtra" ...  $ capital   : chr  "primary" "prima...