Create assignment.r

main codes for the assignment