knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(MATH4753davi0682)

Introduction

This package is about the applications to data using R.

Reading in data

To read in csv files into R work space, we can use read.csv().

data

Vector creation

We can create a vector by using the c() function.

v <- c(1,4,5)
v

Creation of lists

To create a list, we can use the function list.

l <- list(a = 1:20, b = letters, c = rnorm(10))
l

Creation of a matrix of NA's

mat <- matrix(NA, 
              nrow= 10,
              ncol = 5,
              byrow = TRUE
              )
mat

Creating data frames

To create a data frame, we can use data.frame()

df <- data.frame(a=1:26, b = letters, c = LETTERS, d= rnorm(26))
head(df)

Functions

This package includes 9 functions from the labs.

myscatterhist function

This function outputs scatter histogram of two vectors.

with(ddt, scatterhist(LENGTH,WEIGHT, xlab="LENGTH"))

mysample function

This function outputs a bar plot showing the relative frequency of the numbers (10) from n times of random drawing.

mysample(n=1000,iter=1,time=1)

myncurve function

This functions output the plot of normal distribution, and the probability P=(Y <= x).

myncurve(mu=10,sigma=5,x=6)

mybinomial function

This function outputs a bar plot of the relative frequency of the times of the success in a binomial test.

mybin(10000,10,.7)


menyangdavila/MATH4753davi0682 documentation built on May 3, 2022, 12:09 a.m.