Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4.2 TrustPilot
logo-home
Presentation

2. An introduction to using R

Note
-
Vendu
-
Pages
113
Publié le
06-07-2018
Écrit en
2017/2018

A link to the sample data is provided in the presentation. This section covers indexing and sub-setting, the use of square brackets, calculating summary statistics; functions such as mean(), by the end of this you will be comfortable with creating objects. The apply() function is covered as well as R help files. And finally how to generate histograms in R

Montrer plus Lire moins
Établissement
Cours














Oups ! Impossible de charger votre document. Réessayez ou contactez le support.

École, étude et sujet

Établissement
Cours

Infos sur le Document

Publié le
6 juillet 2018
Fichier mis à jour le
23 juillet 2018
Nombre de pages
113
Écrit en
2017/2018
Type
Presentation
Personne
Inconnu

Sujets

Aperçu du contenu

An introduction to R – part 2
Use the same R script as session 1

,Indexing and Sub-Setting
“finding and grabbing part of your data”

Link to data is found at end of presentation

,Indexing and sub-setting
• Recall that R has stored your data in a data frame; a good way to th
of this is the equivalent of a spreadsheet
• If you think of a data frame as a spreadsheet then you’ll be able to grasp t
concept of the frame dimensions
• There are two: rows and columns
• Often one needs to analyse only a subset of data such as certain ro
or columns (particular variables)
• Indexing: R data frame has assigns numerical values to your rows a
columns. These are implicit, i.e. R is not going to alter your data se
but these implicit numbers allow you to generate a subset of your
data. This is known as indexing

,How does one sub-set data?
• By use of [] and ,
• The square brackets replace the round brackets
• Therefore if I want to generate a subset of data from my session 1
data; I would use the following
Session1Data[]
• Within the brackets, you tell R what to do by using numbers and a
comma

,
,How does one sub-set data?
• By use of [] and ,
• The square brackets replace the round brackets
• Therefore if I want to generate a subset of data from my session 1 data;
would use the following
Session1Data[]
• Within the brackets, you tell R what to do by using numbers and a comm
• I have chosen to use the same R script from before and indicate as such
with the annotation
# Session 2
• I selected and ran this line of code

, How to use [] and ,
• Have your data file open in excel while you look at the next few step
• Type in the following and run it
Session1Data[1,]
€2,62
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur
Seller avatar
dominique13
4,3
(3)

Document également disponible en groupe

Faites connaissance avec le vendeur

Seller avatar
dominique13 University of Cape Town
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
7
Membre depuis
7 année
Nombre de followers
5
Documents
21
Dernière vente
3 année de cela

4,3

3 revues

5
1
4
2
3
0
2
0
1
0

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions