{"action":"closed","issue":{"url":"https://api.github.com/repos/dmcglinn/quant_methods/issues/12","labels_url":"https://api.github.com/repos/dmcglinn/quant_methods/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/dmcglinn/quant_methods/issues/12/comments","events_url":"https://api.github.com/repos/dmcglinn/quant_methods/issues/12/events","html_url":"https://github.com/dmcglinn/quant_methods/issues/12","id":127973026,"number":12,"title":"Unexpected '}' in my if statement","user":{"login":"Jordylacrosse","id":16686783,"avatar_url":"https://avatars.githubusercontent.com/u/16686783?v=3","gravatar_id":"","url":"https://api.github.com/users/Jordylacrosse","html_url":"https://github.com/Jordylacrosse","followers_url":"https://api.github.com/users/Jordylacrosse/followers","following_url":"https://api.github.com/users/Jordylacrosse/following{/other_user}","gists_url":"https://api.github.com/users/Jordylacrosse/gists{/gist_id}","starred_url":"https://api.github.com/users/Jordylacrosse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jordylacrosse/subscriptions","organizations_url":"https://api.github.com/users/Jordylacrosse/orgs","repos_url":"https://api.github.com/users/Jordylacrosse/repos","events_url":"https://api.github.com/users/Jordylacrosse/events{/privacy}","received_events_url":"https://api.github.com/users/Jordylacrosse/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-21T17:11:09Z","updated_at":"2016-01-21T18:43:07Z","closed_at":"2016-01-21T18:43:07Z","body":"Hello all, \r\n\r\nI am trying to create an 'if' statement in my R code and am stuck on one of the frustrating outcomes of a missing/extra component in my R code. I've been tinkering with it for over an hour, and need some help.   No matter which way I put it, the error message I get is: Error: unexpected '}' in \"  }\".  Here is my code:\r\n\r\nvectorx<-c(1:10)\r\nvectorx\r\n\r\n y<-0\r\nfor(i in 1:10)\r\n  {\r\n  y[i]<-vectorx[i]+vectorx[i+1]\r\n  {\r\n  if(is.na(y[i] > 10))\r\n    }\r\n  }\r\n  \r\nprint(y)\r\n\r\n\r\n\r\nThe \"is.na\" code is designated to set any value to NA if greater than 10. (I had a different R code originally, but was prompted to provde a TRUE/FALSE statement.) The way around that way using the is.na function."}}