# ------------------------------------------------------------------ # File name: script.R # # A simple R script to plot square root function # The graph will be output to the screen in a separate graphics window # # To execute R commands in a file, type source("filename.R") at the propmt # R looks for files in a "working directory"; type getwd() to find out this directory # Use setwd() to set working directory. For example, if the file script_plot.R is in the # /Users/hk/Documents/R_scripts directory, type # setwd("/Users/hk/Documents/R_scripts/") then source("script.R") # In Unix, you can start R from the directory containing your R scripts # # Version: 2.1 # Authors: H. Kocak, University of Miami and B. Koc, Stetson University # References: # https://www.r-project.org # ------------------------------------------------------------------ x = seq(from = 0, to = 10, by = 0.5) square_root_x = sqrt(x) plot(x, square_root_x)