100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Samenvatting Volledige Lijst met R studio codes | Onderzoekstraining I & II | RSM premaster $5.97   Add to cart

Summary

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

 73 views  5 purchases
  • Course
  • Institution

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...

[Show more]

Preview 2 out of 13  pages

  • March 25, 2023
  • 13
  • 2022/2023
  • Summary
avatar-seller
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Daniquedhs. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $5.97. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

62555 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$5.97  5x  sold
  • (0)
  Add to cart