{"action":"created","issue":{"url":"https://api.github.com/repos/USGS-R/dataRetrieval/issues/171","labels_url":"https://api.github.com/repos/USGS-R/dataRetrieval/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/USGS-R/dataRetrieval/issues/171/comments","events_url":"https://api.github.com/repos/USGS-R/dataRetrieval/issues/171/events","html_url":"https://github.com/USGS-R/dataRetrieval/issues/171","id":129298260,"number":171,"title":"readNWISpeak bug","user":{"login":"USGSPMM3","id":16928289,"avatar_url":"https://avatars.githubusercontent.com/u/16928289?v=3","gravatar_id":"","url":"https://api.github.com/users/USGSPMM3","html_url":"https://github.com/USGSPMM3","followers_url":"https://api.github.com/users/USGSPMM3/followers","following_url":"https://api.github.com/users/USGSPMM3/following{/other_user}","gists_url":"https://api.github.com/users/USGSPMM3/gists{/gist_id}","starred_url":"https://api.github.com/users/USGSPMM3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGSPMM3/subscriptions","organizations_url":"https://api.github.com/users/USGSPMM3/orgs","repos_url":"https://api.github.com/users/USGSPMM3/repos","events_url":"https://api.github.com/users/USGSPMM3/events{/privacy}","received_events_url":"https://api.github.com/users/USGSPMM3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-27T23:07:26Z","updated_at":"2016-01-28T19:55:49Z","closed_at":null,"body":"```\r\nstations<-c(\"06011000\")\r\npeakdata1<-readNWISpeak(stations,startDate=\"\",endDate=\"\",asDateTime=FALSE)\r\npeakdata2<-readNWISpeak(stations,startDate=\"\",endDate=\"\",asDateTime=TRUE)\r\n```\r\n\r\n\r\nThe readNWISpeak only pulls dates that are formatted with a month, day, and year.  \r\nIn many cases the day of peak is unknown but the month and year is.\r\nreadNWISpeak does not pull dates that are only a month and year, and thus\r\n I can't get the year of the peak which is necessary for processing using various\r\nUSGS software and processing methods.\r\nUsing the USGS peak flow data retrieval you will see that there is a Month and Year\r\n associated 06011000 is shown but the readNWISpeak does not pull this information.\r\nhttp://nwis.waterdata.usgs.gov/mt/nwis/peak?site_no=06011000&agency_cd=USGS&format=html"},"comment":{"url":"https://api.github.com/repos/USGS-R/dataRetrieval/issues/comments/176375685","html_url":"https://github.com/USGS-R/dataRetrieval/issues/171#issuecomment-176375685","issue_url":"https://api.github.com/repos/USGS-R/dataRetrieval/issues/171","id":176375685,"user":{"login":"ldecicco-USGS","id":1105215,"avatar_url":"https://avatars.githubusercontent.com/u/1105215?v=3","gravatar_id":"","url":"https://api.github.com/users/ldecicco-USGS","html_url":"https://github.com/ldecicco-USGS","followers_url":"https://api.github.com/users/ldecicco-USGS/followers","following_url":"https://api.github.com/users/ldecicco-USGS/following{/other_user}","gists_url":"https://api.github.com/users/ldecicco-USGS/gists{/gist_id}","starred_url":"https://api.github.com/users/ldecicco-USGS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldecicco-USGS/subscriptions","organizations_url":"https://api.github.com/users/ldecicco-USGS/orgs","repos_url":"https://api.github.com/users/ldecicco-USGS/repos","events_url":"https://api.github.com/users/ldecicco-USGS/events{/privacy}","received_events_url":"https://api.github.com/users/ldecicco-USGS/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T19:55:49Z","updated_at":"2016-01-28T19:55:49Z","body":"I'm just pushing up a solution that would propagate the argument \"convertType\". So, if you have the `devtools` package installed, you can install this development version like this\r\n\r\n```\r\ndevtools::install_github(\"USGS-R/dataRetrieval\")\r\n\r\nlibrary(dataRetrieval)\r\nstations<-c(\"06011000\")\r\npeakdata3<-readNWISpeak(stations,startDate=\"\",endDate=\"\",convertType=FALSE)\r\n```\r\nThe column \"peak_tm\" is now a character vector. You can use either base R or `lubridate` to pull out the year and months. The way I would probably do it is:\r\n\r\n```\r\npeakdata3$year <- as.integer(sapply(strsplit(peakdata3$peak_dt, \"-\"), function(x) x[1]))\r\npeakdata3$month <- as.integer(sapply(strsplit(peakdata3$peak_dt, \"-\"), function(x) x[2]))\r\n```\r\n"}}