Database Reference
In-Depth Information
Although plots can be saved using the RStudio GUI, plots can also be saved using
R code by specifying the appropriate graphic devices. Using the jpeg() function,
the following R code creates a new JPEG file, adds a histogram plot to the file, and
then closes the file. Such techniques are useful when automating standard reports.
Other functions, such as png() , bmp() , pdf() , and postscript() , are available
in R to save plots in the desired format.
jpeg(file="c:/data/sales_hist.jpeg") # create a new jpeg
file
hist(sales$num_of_orders)
# export histogram to jpeg
dev.off()
# shut off the graphic device
More information on data imports and exports can be found at
http://cran.r-project.org/doc/manuals/r-release/R-data.html ,
such as how to import datasets from statistical software packages including
Minitab, SAS, and SPSS.
3.1.3 Attribute and Data Types
In the earlier example, the sales variable contained a record for each customer.
Several characteristics, such as total annual sales, number of orders, and gender,
were provided for each customer. In general, these characteristics or attributes
provide the qualitative and quantitative measures for each item or subject of
interest. Attributes can be categorized into four types: nominal, ordinal, interval,
and ratio (NOIR) [8]. Table 3.2 distinguishes these four attribute types and shows
the operations they support. Nominal and ordinal attributes are considered
categorical attributes, whereas interval and ratio attributes are considered numeric
attributes.
Search WWH ::




Custom Search