PDF graphics in R

-1

I have the following exercise and I am in doubt on item b in bold.

Perform a data analysis, using lm (), between two variables, just as we did in the room, but you must import data from any source using read.table () or equivalent commands according to the format of the data.

(1) Data - choose the variables you want to work with and manipulate the data in a spreadsheet; export the file in the desired format to be imported into R.

(2) Adjust - after importing the data, make an adjustment using lm () using different models (functional shapes) and plot the data points and the settings found (PDF format).

(3) send in compressed file containing only 2 files:

a. the data file;

b. the code to be executed in R - it is important to emphasize that the user must execute the code with source () and the code must do the whole task: import, analysis and generation of the plots in PDF, and use the summary command to present the important statistical information for each model.

How to generate the graph in pdf?

    
asked by anonymous 12.12.2016 / 11:27

1 answer

2

Use the pdf

Example:

pdf('grafico.pdf')
H <- c(2,3,3,3,4,5,5,5,5,6)
counts <- table(H)
barplot(counts)
dev.off()
    
12.12.2016 / 11:46