<style type='text/css'>.TerraceMsg { font-size: 12px; font-family:Dotum, Arial, Verdana, Sans-Serif;}.Bold { font-weight: bold; }</style><div class='TerraceMsg'><p>I have a csv file (<a href="https://drive.google.com/file/d/0ByY3OAw62EShOHRYQ2FKa0ZzTlk/view?usp=sharing" target="_self">Please download from here</a> ) names seoul_3month.csv, contains hourly pm10 concentration data from 25th april to 31th april 2012. I intended to plot every hour variogram using gstat and automap package in R.  I worte this code below but I got some error</p><p>error says: </p><span class="Apple-style-span" style='font: 15px/16px "Lucida Console"; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: pre-wrap; border-collapse: separate; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(225, 226, 229); -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;'><p> </p><pre tabindex="0" class="GEWYW5YBFEB" id="rstudio_console_output" style='margin: 0px; line-height: 1.2; font-family: "Lucida Console"; font-size: 11pt !important; white-space: pre-wrap !important; -ms-word-break: break-all; outline-style: none; -webkit-user-select: text;'><span class="GEWYW5YBAEB  ace_constant" style="color: rgb(197, 6, 11);">Error in vgm_list[[which.min(SSerr_list)]] : 
  attempt to select less than one element
</span><span class="GEWYW5YBAEB  ace_constant" style="color: rgb(197, 6, 11);">In addition: </span><span class="GEWYW5YBAEB  ace_constant" style="color: rgb(197, 6, 11);">There were 25 warnings (use warnings() to see them)
</span>Called from: top level 
<span class="GEWYW5YBJEB ace_keyword" style="color: blue; white-space: pre; -webkit-user-select: text;">Browse[1]></span></pre></span><p> </p><p>library(sp)<br>library(gstat)<br>library(rgdal)<br>library(automap)</p><p>seoul_3month<-read.csv(file="seoul_3month.csv")<br>seoul_3month<-na.omit(seoul_3month)<br>seoul_3month<br>seoul_every_hour<-split(seoul_3month,seoul_3month$time) #split the every hour data</p><p>seq(seoul_every_hour)</p><p> </p><p>vars<-lapply(seq(seoul_every_hour), function(i){<br>  dat<-seoul_every_hour[[i]]<br>  coordinates(dat)<-~LON+LAT<br>  proj4string(dat) <- "+proj=longlat +datum=WGS84" <br>  dat <- spTransform(dat, CRS("+proj=utm +north +zone=52 +datum=WGS84"))<br>  <br>  variogram<-autofitVariogram(log(PM10)~1,dat)<br>  plot<-plot(variogram,plotit=FALSE, asp=1)<br>  <br>  return(plot)<br>})<br>vars[[1]]<br>vars[[2]]</p><p> </p><p>Previously I did the same work for 1 march to 7 march 2012, by the same coad below but I plotted all the variogram successfully. you can see my previous same code here in the anser part of the <a href="http://stackoverflow.com/questions/31762461/how-to-plot-multiple-semi-variogram-from-a-single-dataset-efficiently-in-r" target="_self">following link </a>.<br><br>But for this present data set I got the error. Could anybody please tell me what is error about? Is there any problem in my data set? Thanks in advance.<br><br>Uzzal  </p></div><br><br/><br/><table border=0 cellpadding=0 cellspacing=0 ><tr><td style='vertical-align: top;font-size:9pt;'><div jquery1411706373835="566">Uzzal Kumar Dash</div>
<div jquery1411706373835="566">Master's student<br jquery1411706373835="567">Air Quality & Climate Modeling Laboratory (AqCliMB)<br jquery1411706373835="568">School of Environmental Science and Engineering (SESE)<br jquery1411706373835="569">Gwangju Institute of Science and Technology (GIST)<br jquery1411706373835="570">123 Cheomdan-gwagiro, Buk-gu, Gwangju 500-712</div>
<div jquery1411706373835="571">Republic of Korea<br jquery1411706373835="572"><br>web: <a href="http://aqclimb.gist.ac.kr/">http://aqclimb.gist.ac.kr/</a><br></div></td></tr></table><br>
<div id='TMSMDN' style="background:url('http://mail.gist.ac.kr:80/mail/receiveMDN.do?mdnData=oGhEpHGdw7UD%2BvJWe%2BEHziSZo9YXSOnN%2BZj7YnihXmohfqYJQE8YiziA%2BysuxmprZPIddCZ1U5IL%0AlRLB3jzj3dX%2BwXAdHH5HdK70NDwMTGu5XgDonVfpOlJDjhCtMyBbMXtCn3aw4SxCNKGrZVxokg%3D%3D%0A')"></div>