This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter.
fname<-file.choose()
system.time(df01 <- read.csv(fname, header = T, sep=",", stringsAsFactors = FALSE, encoding = "UTF-8"))
<ec>궗<ec>슜<ec>옄 <ec>떆<ec>뒪<ed>뀥 elapsed
0.10 0.00 0.09
names(df01)
[1] "Cruise_ID" "Year" "Month" "Day" "Hour" "Min"
[7] "Sec" "Latitude" "Lat_hem" "Longitude" "Longitude_hem" "Course"
[13] "Speed" "Heading" "App_WS" "App_WD" "Calc_WS" "Calc_WD"
[19] "True_WS" "True_WD" "Air_Temp" "Atmos_Press" "Humidity" "Solar_R"
[25] "Conductivity" "Seawater_T1" "Seawater_T2" "Salinity" "Depth"
str(df01)
'data.frame': 4308 obs. of 29 variables:
$ Cruise_ID : chr "HI-17-00" "HI-17-00" "HI-17-00" "HI-17-00" ...
$ Year : int 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 ...
$ Month : int 1 1 1 1 1 1 1 1 1 1 ...
$ Day : int 3 3 3 3 3 3 3 3 3 3 ...
$ Hour : int 0 0 0 0 0 1 1 1 1 1 ...
$ Min : int 55 56 57 58 59 0 1 2 3 4 ...
$ Sec : int 0 0 0 0 0 0 0 0 0 0 ...
$ Latitude : num 35 35 35 35 35 ...
$ Lat_hem : chr "N" "N" "N" "N" ...
$ Longitude : num 129 129 129 129 129 ...
$ Longitude_hem: chr "E" "E" "E" "E" ...
$ Course : num 216 286 301 300 294 ...
$ Speed : num 0.4 1.3 2.3 2.2 2.1 1.9 1.8 1.6 1.6 2.3 ...
$ Heading : num 305 303 306 310 316 ...
$ App_WS : num 1.693 0.557 0.335 1.194 2.479 ...
$ App_WD : num 195 157.1 69.8 30.1 325.9 ...
$ Calc_WS : int -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 ...
$ Calc_WD : int -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 ...
$ True_WS : num 1.655 1.225 1.144 0.799 1.445 ...
$ True_WD : num 132.9 103.8 104.3 45.5 272 ...
$ Air_Temp : num 7.43 7.58 7.71 7.69 7.46 ...
$ Atmos_Press : num 1023 1023 1023 1023 1023 ...
$ Humidity : num 55.5 53.9 54.6 53.2 52.7 ...
$ Solar_R : num 335 338 344 346 339 ...
$ Conductivity : chr "36.207" "36.207" "36.217" "36.217" ...
$ Seawater_T1 : chr "11.321" "11.321" "11.325" "11.325" ...
$ Seawater_T2 : chr "10.566" "10.566" "10.563" "10.563" ...
$ Salinity : chr "31.905" "31.905" "31.911" "31.911" ...
$ Depth : num 10.5 10.8 10.8 11.1 11.3 ...
head(df01)
Month <-formatC(df01$Month, format = "d", flag = "0", width = 2)
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale
Day <-formatC(df01$Day, format = "d", flag = "0", width = 2)
Hour <-formatC(df01$Hour, format = "d", flag = "0", width = 2)
Min <-formatC(df01$Min, format = "d", flag = "0", width = 2)
Sec <-formatC(df01$Sec, format = "d", flag = "0", width = 2)
datetime <-paste0(df01$Year, Month,Day, Hour, Min, Sec)
df01$datetime <-ymd_hms(datetime)
df01$datetime <-as_datetime(df01$datetime)
df01 <- df01[, c(1, 30, 8:29)] #而щ읆 <ec>닚<ec>꽌 <ec>옱諛곗뿴..
df01$Conductivity<-as.numeric(df01$Conductivity)
NAs introduced by coercion
df01$Seawater_T1<-as.numeric(df01$Seawater_T1)
NAs introduced by coercion
df01$Seawater_T2<-as.numeric(df01$Seawater_T2)
NAs introduced by coercion
df01$Salinity<-as.numeric(df01$Salinity)
NAs introduced by coercion
df01$Depth<-as.numeric(df01$Depth)
str(df01)
'data.frame': 4308 obs. of 24 variables:
$ Cruise_ID : chr "HI-17-00" "HI-17-00" "HI-17-00" "HI-17-00" ...
$ datetime : POSIXct, format: "2017-01-03 00:55:00" "2017-01-03 00:56:00" "2017-01-03 00:57:00" "2017-01-03 00:58:00" ...
$ Latitude : num 35 35 35 35 35 ...
$ Lat_hem : chr "N" "N" "N" "N" ...
$ Longitude : num 129 129 129 129 129 ...
$ Longitude_hem: chr "E" "E" "E" "E" ...
$ Course : num 216 286 301 300 294 ...
$ Speed : num 0.4 1.3 2.3 2.2 2.1 1.9 1.8 1.6 1.6 2.3 ...
$ Heading : num 305 303 306 310 316 ...
$ App_WS : num 1.693 0.557 0.335 1.194 2.479 ...
$ App_WD : num 195 157.1 69.8 30.1 325.9 ...
$ Calc_WS : int -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 ...
$ Calc_WD : int -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 ...
$ True_WS : num 1.655 1.225 1.144 0.799 1.445 ...
$ True_WD : num 132.9 103.8 104.3 45.5 272 ...
$ Air_Temp : num 7.43 7.58 7.71 7.69 7.46 ...
$ Atmos_Press : num 1023 1023 1023 1023 1023 ...
$ Humidity : num 55.5 53.9 54.6 53.2 52.7 ...
$ Solar_R : num 335 338 344 346 339 ...
$ Conductivity : num 36.2 36.2 36.2 36.2 36.2 ...
$ Seawater_T1 : num 11.3 11.3 11.3 11.3 11.3 ...
$ Seawater_T2 : num 10.6 10.6 10.6 10.6 10.6 ...
$ Salinity : num 31.9 31.9 31.9 31.9 31.9 ...
$ Depth : num 10.5 10.8 10.8 11.1 11.3 ...
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale
NA
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale