Einführung in R
und Positron

Miguel Alvarez

kamapu.net

Dozent

Miguel Alvarez

  • Vegetationsökologist
  • Datenwissenschaftler
  • KI-Experte
  • R (und Python) Programmierer
    • Umwelt und Biodiversität
    • Geographische Informationssystheme
    • Datenbanken
    • Reproduzierbarkeit
    Open Source

Motivation

  • Warum R?
  • Erwartung vom Kurs

Geschichte von R

  • S (1975)
    • S-PLUS
    • TIBCO Spotfire S+
  • R (1992)



R ist die kostenlose Alternative zu S


Ross Ihaka
Robert Gentleman

Was ist R?

  • Programmiersprache
    • Open Source (offene Quelle)
    • Freeware (kostenlos)
  • Statistische Umgebung
    • Interface
    • Terminal/Konsole


https://www.r-project.org/

Was ist R?

  • Statistisches Programmieren
    • Mathematik
    • Grafiken
  • Kommandozeilen
  • REPL (Read-Eval-Print-Schleife)
(5 + 100) * 25
[1] 2625
50/10
[1] 5
60 > 15
[1] TRUE

Was ist R?

plot(Petal.Length ~ Sepal.Length,
      pch = 16,
      col = Species,
      cex = 1.5,
      data = iris)

Was ist R?

boxplot(Sepal.Length ~ Species,
    data = iris)

Was ist R?

library(ggplot2)
ggplot(iris,
    aes(x = Sepal.Length,
        y = Petal.Length,
        color = Species
      )) +
  geom_point(size = 6)

Warum R?

  • Kostet nichts
  • Steuerung von Analysen
  • Skripten
    • Protokolle
    • Reproduzierbarkeit
  • Vielseitig

Wichtige Elemente

  • Konsole
  • Sitzung
  • Workspace (Environment)
  • Arbeitsverzeichnis (working directory)
  • Skript
  • Paket (Package)

Entwicklungsumgebungen

IDE (integrated development environment)


Literarisches Programmieren

Es dient die Software Dokumentation.
Erster Umgebung war WEB (1984) von Donald E. Knuth.


R als Taschenrechner

  • Mathematische Operatoren
  • Klammern
5+6*11
[1] 71
(5+6)*11
[1] 121
  • Zuweisung <-
M <- 5
M + 2
[1] 7

Logische Operatoren

==
!=
>
>=
<
<=
&
|
%in%
!
any()
all()

10 > 15
[1] FALSE
10 < 15
[1] TRUE

Siehe auch…

  • Weitere Materialien und Infos in kamapu.net.
  • Weitere Kurse bei der VHS Bonn hier.