Sie sind auf Seite 1von 2

Yos_2 <- read.csv("Yos_2_2010y01m05.

csv", header = TRUE)


> Yos_2
Depth CH4 CO2 O2 N2
1 0 11.6 11.5 15.6 61.1
2 1 11.6 11.6 14.2 62.6
3 2 11.9 13.3 12.5 62.2
4 3 15.4 15.5 11.6 57.4
5 4 16.4 15.8 11.6 56.2
6 5 14.8 15.0 11.9 58.2
> names(Yos_2)
[1] "Depth" "CH4" "CO2" "O2" "N2"
> require(ggplot2)
> library(reshape2)
> Yos_2.1 <- melt(Yos_2, id.vars = "Depth")
> p <- ggplot(Yos_2.1, aes(x=Depth, y=value, fill=variable))
> p + geom_bar(stat = "identity", position = position_stack(reverse = TRUE)) +
coord_flip() + scale_x_reverse()
+ ggtitle("Gas Component_No.2_2010y01m05") + xlab("Depth (m)") + ylab("Percentage")
+ theme(legend.position = "right")
+ theme(axis.text = element_text(colour = "blue", size = 12)) + theme(plot.title =
element_text(size = rel(2)))
+ theme(legend.text = element_text(size = 16, colour = "red")) + theme(axis.title.x
= element_text(size = rel(1.5), angle = 180))
+ theme(axis.title.y = element_text(size = rel(1.5), angle = 90))

>require(ggmap)
>mapImageData1 <- get_map(location = c(lon = 142.282486,lat = 43.867714),color =
"color",source = "google",maptype = "satellite",zoom = 17)
>ggmap(mapImageData1,extent = "device",ylab = "Latitude",xlab = "Longitude")

setwd("C:/Users/in01/Desktop/YOSHINO DATA NEW 2017_0205")


data<-read.csv("yos.csv")
library(dplyr)
library(tidyr)
library(ggplot2)
df <- drop_na(data)
write.csv(df, file = "df.csv",row.names=FALSE)
df1 <- arrange(df, date)
df2 <- filter(df1, depth == 0, id==96)
p <- plot_ly(df2) %>%
add_trace(x = ~date, y = ~ch4, type = 'bar', name = 'CH4',
marker = list(color = 'blue'),
hoverinfo = "text",
text = ~paste(ch4, '%')) %>%
add_trace(x = ~date, y = ~co2, type = 'bar', name = 'CO2',
marker = list(color = 'yellow'),
hoverinfo = "text",
text = ~paste(co2, '%')) %>%
add_trace(x = ~date, y = ~o2, type = 'bar', name = 'O2',
marker = list(color = 'red'),
hoverinfo = "text",
text = ~paste(o2, '%')) %>%
add_trace(x = ~date, y = ~n2, type = 'bar', name = 'N2',
marker = list(color = 'green'),
hoverinfo = "text",
text = ~paste(n2, '%')) %>%
add_trace(x = ~date, y = ~temp, type = 'scatter', mode = 'lines+markers', name =
'Temperature', yaxis = 'y2',
line = list(color = 'red'),
hoverinfo = "text",
text = ~paste(temp, 'C
')) %>%
layout(title = 'Gas component and temperature of gas extraction well No.91',
xaxis = list(title = "Time"),
yaxis = list(side = 'left', title = 'CH4 in percentage', showgrid = FALSE,
zeroline = TRUE),
yaxis2 = list(side = 'right', overlaying = "y", title = 'Temperature in
Celcius C', showgrid = TRUE, zeroline = FALSE),
barmode = 'stack')
p

setwd("C:/Users/in01/Desktop/YOSHINO DATA NEW 2017_0205")


data<-read.csv("yos.csv")
library(dplyr)
library(tidyr)
df <- drop_na(data)
View(df)
write.csv(df, file = "df.csv",row.names=FALSE)
save(df, file="data.RData", ascii=TRUE)
library(ggplot2)
df2 <- filter(df, depth == 0)
df3 <- filter(df, depth == 0, id==91)
mdf3 <- melt(df3, id.vars ="date")
df4 <- select(df3, -total, -co2.ch4, -temp)

Das könnte Ihnen auch gefallen