Data and Computing Fundamentals

Exercises on R Syntax

Your Name Here

Wed Feb 20 01:57:32 2013

Answer the following by constructing appropriate R commands and/or giving a text narrative.

Object Names

Show that names with different capitalization refer to different objects.

The name of the object being assigned to always goes to the left of the = operator. What happens if you put it on the right?

Strings and Names

Show that a string and a name are different.

Assign a string value to an object.

Numbers and Arithmetic

Use scientific notation to create these numbers: 100, 10, 0.001, 0.0000001

Try these mathematical operations and explain what the values mean:

What's the difference between NaN and NA?

Functions and arguments

Show that the order of unnamed arguments makes a difference. Use seq() to illustrate this.

Find the names of the arguments to seq(). Show that when you use the names, the order doesn't matter.

What kind of object is created by date()?

Data Frames

Read in the data set “utilities.csv” with fetchData("utilities.csv")

How many rows are there?

What are the names of the variables?

R Markdown Syntax

Write the Markdown to reproduce this outline. See below for a hint.

  1. Sweet
  2. Sour
  3. Savory

Vegetables

  1. Leafy
  2. Flower

Hint:

### Fruits

1. Sweet
    * Apples