Integer Data: Categorical or Continuous? I am wondering if integer predictor data should be treated as categorical (thus requiring encoding) or continuous. For example, if the range of a given predictor X is all integers between 1 and 230, can I treat it as a continuous variable, or should I encode it to obtain 230 (or maybe 229) new dummy variables? The end goal of the analysis is to perform regression or classification.
 A: It really depends on context.
If the integer variable has some inherent ordering to it, for example it could be colours where lower numbers represent "darker shades" and higher numbers represented "lighter shades", then treating it as a continuous variable is almost certainly preferable. Not only would it make more sense, but you're eliminating some 200 variables from your model which is a huge bonus.
On the other hand if these integers have no inherent ordering, say for example they represent plots of land, then they should be treated as a categorical variable. It would make no sense to treat them as a continuous variable since its value is independent of the property of the variable you're interested in.
A: In general, neither is suitable. Integers are discrete, not continuous, but to treat them as nominal categories would throw out most of the information, and  even treating them as ordinal could lose quite a bit.
In some situations one or the other might be okay, but it's nearly always better to treat them as what they are -- for example, if the data are counts, use an analysis suited for counts.
As an example, say you wanted to perform a regression on count data; there are a number of count-regression models, including (but not limited to) Poisson, binomial and negative binomial regression.

In the case of integer IVs (predictors) there's no more need to do anything to integers than there is to do anything to some continuous predictor -- at least not on the basis that they're integers. 
In both the case of integer predictors and continuous predictors the critical thing is your understanding (whether from theory, previous studies or some other means) of how the predictor variable might relate to the response, rather than the fact that they're integers. 
A: You do not need to do any of the 2 you stated.
What you can do is regression. In R in glm you have option to set the family attribute in that you can set your preference. For example when you consider normal regression family = gaussian and if you want count type target variable as you explained in question then I think you need to set it as binomial(please check it once), but yes this is how your model will consider your target as count type rather then continuous or categorical.
