Question

In R’s built-in datasets library is the data frame quakes. Make sure you can access this...

In R’s built-in datasets library is the data frame quakes. Make sure you can access this object. Use the command head(quakes).

Then, do the following:

Select only those records that correspond to a magnitude (mag) of greater than or equal to 5 and write them to a file called Lab4-Q2.txt

You can use the command

dput(x=YourDataVariable, file="fileName.txt")

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Herethe library tidyerse is used.

library(tidyverse)

mag_quakes<-quakes %>% He
filter(mag >= 5.0)

load(mag_quakes)

" Here the dput is used and the output can be on R-studio console with the first 5 rows"

dput(mag_quakes[1:5,c(1:5)])
structure(list(lat = c(-26.00, -20.70, -13.64, -19.66, -16.46),
long = c(184.10, 169.92, 165.96, 180.28, 180.79),
depth = c(42, 139, 50, 431, 498),
mag = c(5.4, 6.1, 6.0, 5.4, 5.2),
stations = c(43, 94, 83, 57, 79)), .Names = c("lat","long","depth","mag","stations"), row.names = c(NA, 5L), class = "data.frame")

"Here the output is send to a file"
dput(mag_quakes,"Lab4-Q2.txt")

Add a comment
Know the answer?
Add Answer to:
In R’s built-in datasets library is the data frame quakes. Make sure you can access this...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Use one of R’s datasets(trees). Using descriptive statistics, visualize this data numerically and graphically. You can...

    Use one of R’s datasets(trees). Using descriptive statistics, visualize this data numerically and graphically. You can use the following resource as a guide: Section 2.5 (p. 15) and 3.5 (P. 25) from “Using R for Data Analysis and Graphics ”. Make sure to look into: a) the summary of the data, b) display it in the histogram, c) boxplot, d) qqnorm e) other plots and functions.

  • Lab Exercise #15 Assignment Overview This lab exercise provides practice with Pandas data analysis library. Data...

    Lab Exercise #15 Assignment Overview This lab exercise provides practice with Pandas data analysis library. Data Files We provide three comma-separated-value file, scores.csv , college_scorecard.csv, and mpg.csv. The first file is list of a few students and their exam grades. The second file includes data from 1996 through 2016 for all undergraduate degree-granting institutions of higher education. The data about the institution will help the students to make decision about the institution for their higher education such as student completion,...

  • I can't attach the data due to the file being real large i can email it...

    I can't attach the data due to the file being real large i can email it to you so i can have your help on it # Assignment 1 # R Programming Language # ---- Why do Exploratory Data Analysis (EDA)? ---- # We will be looking at ## identifying outliers ## null values ## generating plots ## examining correlations # -------------------------------------------------------------- # In this video we will cover: ## univariate plots for continuous variables (boxlots, historgrams) ## bivariate plots...

  • 19. UNIX/Linux normally include two editors: vi and (choose the single best answer). 20. You can...

    19. UNIX/Linux normally include two editors: vi and (choose the single best answer). 20. You can use thecommand to create empty a create b. make c touch d mu 21. Which command can be used to leave vi temporarily to access the command line? 22 If you execute the contents of filel are sorted and the results are stored in file2. a sort file1 -ofile2 b. sort file1 >file2 c sort filel -d file2 d sort filel filez field or...

  • A. File I/O using C library functions File I/O in C is achieved using a file...

    A. File I/O using C library functions File I/O in C is achieved using a file pointer to access or modify files. Processing files in C is a four-step process: o Declare a file pointer. o Open the desired file using the pointer. o Read from or write to the file and finally, o Close the file. FILE is a structure defined in <stdio.h>. Files can be opened using the fopen() function. This function takes two arguments, the filename and...

  • 1. Suppose you wrote a program that reads data from cin. You are now required to...

    1. Suppose you wrote a program that reads data from cin. You are now required to reimplement it so that you can read data from a file. You are considering the following changes. I. Declare an ifstream variable in_file II. Replace all occurrences of cin with in_file III. Replace all occurrences of > > and get_line with the appropriate operations for ifstream objects What changes do you need to make? I, II, and III II and III I and III...

  • In this project, you will construct an Object-Oriented framework for a library system. The library must...

    In this project, you will construct an Object-Oriented framework for a library system. The library must have books, and it must have patrons. The patrons can check books out and check them back in. Patrons can have at most 3 books checked out at any given time, and can only check out at most one copy of a given book. Books are due to be checked back in by the fourth day after checking them out. For every 5 days...

  • You will be writing a Library simulator involving multiple classes. You will write the LibraryItem, Patron,...

    You will be writing a Library simulator involving multiple classes. You will write the LibraryItem, Patron, and Library classes and the three classes that inherit from LibraryItem (Book, Album and Movie). All data members of each class should be marked as private and the classes should have any get or set methods that will be needed to access them. **USE PYTHON 3 ONLY!!! Here are descriptions of the three classes: LibraryItem: id_code - a unique identifier for a LibraryItem -...

  • For this assignment, you will use your knowledge of arrays and ArrayLists to write a Java...

    For this assignment, you will use your knowledge of arrays and ArrayLists to write a Java program that will input a file of sentences and output a report showing the tokens and shingles (defined below) for each sentence. Templates are provided below for implementing the program as two separate files: a test driver class containing the main() method, and a sentence utilities class that computes the tokens and shingles, and reports their values. The test driver template already implements accepting...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT