# Alexandru Mardare

# 1701698


# Computing data & information systems HND 


# Statistical programming


# Task 1 irisanalysis.r 


# Assignment 2 Task 1 R Programming


setwd("~/Documents") # Set the working directory


read.table('iris.csv' , header=T , sep = ',')  # Read from Excel file iris.csv from Documents


# Load data file results 



results<-read.csv("iris.csv", header=TRUE) # Read the dedicates iris.csv file



# Loop through dataframe using FOR returns the column vectors



for (i in results) print(i) # Displays results from the CSV


# Loop through dataframe rows using FOR

for (i in 1:nrow(results))   # Displays specifies results from CSV file
   
{
  print (i) # Print the loop variable  # Display the loop
  
  
  print (results[i,]) # Display the row
}

cor(Petal.length ,Sepal.length, method="pearson") # Creates the pearson correlation between results



plot(Sepal.length, Petal.length="scatterplot", las=1)  # Plots the data as a scatterplot.










