Assignment 1 - IN PDF FORMAT Using R and Rstudio Pick a database from: data() Then preview...

60.1K

Verified Solution

Question

Advance Math

Assignment 1 - IN PDF FORMAT Using R and Rstudio

Pick a database from: data()

Then preview the first 10 rows.

Print the number of rows and columns

- Print the names of the variables

If you have row names, print them - work with the values for afield in your dataset. You can do it by dataset[[xx]] operator withxx can be the index of the field or the nae of the field.

Now use dataset[xx] to get a slice of datframe instead ofvector, e.g. df = mtcars[c(‘mpg’, ‘disp’)] - With two scalararguments (rows,columns), the [] operator can select elements inthe dataframe. Try this.

- Subset your data using rules similar to the lectures. Forexample part of the data that has a characteristics AND/OR anotherone, etc.

- Write a function that does an operation, for example averaginga property, on your dataset.

- Write a function that works on rows and adds a column to thedataset with the results for each row.

- Using the iris database, explain the following line ofcode:

data(iris) aggregate(iris[\"Petal.Length\"], by = iris[\"Species\"],FUN=median)

## Species Petal.Length

## 1 setosa 1.50

## 2 versicolor 4.35

## 3 virginica 5.55

Answer & Explanation Solved by verified expert
3.6 Ratings (516 Votes)
IF YOU HAVE ANY DOUBTS COMMENT BELOW I WILL BE TTHERE TO    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students