Created
July 20, 2017 17:17
-
-
Save samehkamaleldin/3af55443aadbcaf33867e2b8320f8437 to your computer and use it in GitHub Desktop.
R_code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########## Start of header ################ | |
# Title: Data Analysis Assignment [SeaWeed dataset] | |
# | |
# Description: | |
# Analysis of SeaWeed dataset | |
# extracted of from a field experiment on an island off Connemara | |
# | |
# Author: | |
# Date: 20.07.2017 | |
########## End of header ################### | |
############################################ | |
# 1- First we clean the table | |
############################################ | |
# reset R environement | |
rm(list=ls()) | |
# Import wolf data set from csv file | |
seaweed <- read.table('SeaWeed.csv', header=T, sep=',') | |
# convert textual values to numerical values | |
seaweed$Sediment <- as.numeric(factor(seaweed$Sediment, levels=c("None", "Low", "High"))) | |
seaweed$Nutrients <- as.numeric(factor(seaweed$Nutrients, levels=c("None", "Low", "High"))) | |
# Using examples from: | |
# http://www.ucd.ie/ecomodel/Resources/R_formulae_WebVersion.html | |
# fit a single mean to the brown-seaweeds | |
green_seed_mean <- lm(Green.seaweeds~1, data = seaweed) | |
plot(seaweed$Nutrients, seaweed$Brown.seaweeds) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment