Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Kod do "R" do zaliczenia Laboratorium_1. Zmieńcie parametr "setwd" na lokalizację pliku flats1.csv na dysku.
- setwd("C:\\Users\\Student\\Desktop\\Sztuczna Inteligencja\\")
- flats <- read.csv("flats1.csv", stringsAsFactors=FALSE)
- class(flats)
- str(flats)
- dim(flats)
- head(flats,6)
- head(flats,15)
- tail(flats,6)
- names(flats)
- glimpse(flats)
- summary(flats)
- count(flats, City)
- flats %>% count(City) %>% arrange(n)
- flats %>% filter(City != "Lviv") %>% filter(Room == 3 ) %>% count(City) %>% arrange(desc(n))
- flats %>% filter(Room == 2) %>% filter(City != "Lviv") %>% count(City) %>% arrange(desc(n))
- flats %>% filter(Room == 2) %>%
- filter(City != " Kiev Svyatoshinsky ") %>%
- summarise(mean(Square))
- flats %>%
- filter(Room == 2) %>%
- filter(City != "Kharkiv") %>%
- summarise(mean(Square), sd(Square))
- flats %>%
- filter(Room == 1) %>%
- filter(City != "Kharkiv") %>%
- group_by(City) %>%
- summarise(mean=median(Square), sd=sd(Square))
- flats %>%
- filter(Room == 3) %>%
- filter(City == "Odessa")
- flats %>%
- filter(Room == 1) %>%
- filter(City == "Lviv" ) %>%
- summarise(mean=median(Square))
- flats %>%
- filter(City == "Lviv") %>%
- filter(Room == 2) %>%
- summarise(var(Price))
- ggplot(flats, aes(x=Room))+
- geom_bar(fill="lightblue",col="grey") +
- ylab(' Number ')
- p <- ggplot(flats, aes(x=Square)) +
- geom_bar(fill="lightblue",col="grey") +
- ylab(' Number ')
- p
- ggplot(flats, aes(x=Square)) +
- geom_histogram(breaks=seq(0, 250, by = 50),fill="lightblue", col="grey") +
- ylab('Number')
- ggplot(flats, aes(x=Square, y= Price)) +
- geom_point()
- ggplot(flats, aes(x=Square, y=Price)) +
- geom_boxplot() +
- coord_flip()
- scale_x_reverse()
- df <- data.frame(x=1:5, y=(1:5)^2)
- ggplot(df, aes(x, y)) +
- geom_area()
- qplot(City, Price, data=flats, geom="boxplot")+
- coord_flip()
- qplot(Room, Price, data=flats, geom="boxplot")+
- coord_flip()
- ggplot(flats, aes(x=Square, y= Price)) +
- geom_point()
- ggplot(flats, aes(x=Price)) +
- geom_histogram(breaks=seq(0,1.2e7,by=1e6), fill="lightblue", col="grey")+
- ylab('Number')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement