zadania1-uzupelnienie

This commit is contained in:
Jakub Adamski 2021-03-11 10:13:43 +01:00
parent 300fa28b7d
commit 5538e4e579
4 changed files with 68 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.DS_Store
.Rproj.user

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Ćwiczenia statystyka
Zadania w RStudio.

View File

@ -44,5 +44,56 @@ print(zaok)
print(calk)
#ZAD8
start <- Sys.time()
for (x in 1:100000000){
pierw <- sqrt(x)
}
print(Sys.time() - start)
start <- Sys.time()
for (x in 1:100000000){
pierw <- x^(1/2)
}
print(Sys.time() - start)
#ZAD9
install.packages("schoolmath")
library(schoolmath)
last <- 0
number <- 0
for (x in primlist){
if (x >= 1000){
print(last)
break
}
last <-x
if (x > 100 && x < 500){
number <- number + 1
}
}
print(number)
# ZAD 10
print(c(paste(paste(rep("a", 3), 1:3, sep = "")), paste(paste(rep("b", 3), 1:3, sep = ""))))
#ZAD 11
litery <- c("X", "Y", "Z")
print(paste(1:30, rep(litery, 10), sep="."))
#ZAD 12
install.packages("car")
library(car)
odpowiedzi <- c("a", "b", "c", "d", "e")
x <- sample(odpowiedzi, 100, replace = TRUE)
print(recode(x, "c('a', 'b') = 1; c('c', 'd') = 2; 'e' = 3"))

13
zajecia1/zajecia1.Rproj Normal file
View File

@ -0,0 +1,13 @@
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX