Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to convert factor variable to a numeric vector in R?

$
0
0

@harry wrote:

I am currently trying to plot a location using longitude and latitude but in my data longitude and latitude given in the factored form.I want to know how I can convert the factor variable to a numeric vector by which I can plot the location.

str(LatLonCounts)
'data.frame':   1638 obs. of  3 variables:
 $ Var1: Factor w/ 42 levels "-87.93","-87.92",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ Var2: Factor w/ 39 levels "41.64","41.65",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ Freq: int  0 0 0 0 0 0 0 0 0 0 ...

Here Var1 and Var2 are longitude and latitude.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles