Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Samenvatting Volledige Lijst met R studio codes | Onderzoekstraining I & II | RSM premaster

Rating
3.0
(1)
Sold
25
Pages
13
Uploaded on
25-03-2023
Written in
2022/2023

In dit document vind je een volledige lijst met R Studio codes die je nodig hebt voor de vakken onderzoekstraining I & onderzoekstraining II van de Nederlandstalige premaster, RSM. In de linker kolom staat de functie en in de rechter kolom de code. Hierdoor kan je gemakkelijk met ctrl + f de juiste code zoeken. Ideaal voor je openboek tentamen dus! Volledige samenvattingen van de vakken onderzoekstraining I & II zijn ook beschikbaar.

Show more Read less
Institution
Course

Content preview

Codes in R – OZT II

Instellingen nieuw file
Functie Code
Clear everything remove(list=ls())
cat("\f")
Install and load all packages #install.packages("ggplot2", dependencies =
- Eerste keer package installeren: “#” TRUE)
weghalen voor eerste regel library(ggplot2)
- Daarna alleen package laden
#install.packages("stargazer", dependencies =
TRUE)
library(stargazer)

#install.packages("psych", dependencies =
TRUE)
library(psych)

#install.packages("gmodels", dependencies =
TRUE)
library(gmodels)

#install.packages("RColorBrewer",
dependencies = TRUE)
library(RColorBrewer)

#install.packages("Hmisc", dependencies =
TRUE)
library(Hmisc)

#install.packages("corrgram", dependencies =
TRUE)
library(corrgram)

#install.packages("corrplot", dependencies =
TRUE)
library(corrplot)

#install.packages("ppcor", dependencies =
TRUE)
library(ppcor)

#install.packages("readxl", dependencies =
TRUE)
library(readxl)

#install.packages("plyr", dependencies = TRUE)
library(plyr)

#install.packages("car", dependencies = TRUE)
library(car)

, #install.packages("reshape2", dependencies =
TRUE)
library(reshape2)
Set working directories dir <- "~/Erasmus/Onderzoekstraining
- pas path aan naar mappen op je eigen pc II/Tutorials/"

dirData <- paste0 (dir, "Data/")
dirProg <- paste0 (dir, "Programs/")
dirRslt <- paste0 (dir, "Results/")
Read data dsdrugstores <- read.csv (file = paste0(dirData,
- Bij foutmelding read.csv2 "Drugstores.csv"), stringsAsFactors = FALSE)



Voorbereiding
Functie Code
factor aanmaken dsLiving$fLiving <- factor (dsLiving$cLiving,
- voor categorische variabelen levels=c (1:5),
labels=c(“naam kolom1”, “etc.” ))
levels (dsLiving$Living)
Eerste 6 observaties head(naam dataset)
Laatste 6 observaties tail(naam dataset)
Los doc met alle waarden View(naam dataset)

Aantal dimensies dim(naam dataset)
Aantal rijen nrow(naam dataset)
Aantal kolommen ncol(naam dataset)
Bepalen aantal volledige observaties in een sum(complete.cases(naam dataset))
dataframe
Bepalen aantal niet-volledige observaties in een sum(!complete.cases(naam dataset))
dataframe
Bepalen van het aantal ontbrekende waarde colSums(is.na(naam dataset))
per kolom
Bepalen van het aantal ontbrekende waarde rowSums(is.na(naam dataset))
per rij

Identificeren van rijen met meer dan 1 which(rowSums(is.na(naam dataset)) > 1)
missende waarde
Structuur van objecten str (dsSchool)
Samenvatting belangrijkste stat. grootheden summary(dsSchool)
Rijen identificeren dsSchool [1, ]
Cellen identificeren dsSchool$Debts[2]
Verwijderen van missing values dsSub <- dsSub[complete.cases(dsSub), ]
Verwijderen van uitbijters dsSub <- dsSub [dsSub$pCool <= 35, ]
Cellen verwijderen d.m.v. temporary dataframe dsLiving.tmp <- dsLiving[!(dsLiving$cLiving == 5),
~ geen waardes kleiner dan 5 c(“cLiving”, “dFraternity”)]
Rijen/kolommen verwijderen/weglaten dsLiving.tmp <- [dsLiving.tmp$Location != 3, ]fis
Samenvoegen van rijen dsLiving.tmp <- dsLiving[c(“cLiving”,
~ rij 5 wordt rij 4 “dFraternity”)]
dsLiving.tmp$cLiving[dsLiving.tmp$cLiving == 5]
<- 4

Written for

Institution
Study
Course

Document information

Uploaded on
March 25, 2023
Number of pages
13
Written in
2022/2023
Type
SUMMARY

Subjects

$7.64
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Reviews from verified buyers

Showing all reviews
1 year ago

3.0

1 reviews

5
0
4
0
3
1
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Daniquedhs Erasmus Universiteit Rotterdam
Follow You need to be logged in order to follow users or courses
Sold
383
Member since
7 year
Number of followers
269
Documents
33
Last sold
3 months ago

3.9

57 reviews

5
18
4
22
3
13
2
3
1
1

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions