Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

R how to get no. of cities search vs count of distinct visitorid

$
0
0

I have a dataset that looks like this:

fullVisitorId  VisitId visitNumber City
1010122109733  1513354 1           Bangkok
1010164109733  1513366 8           Kuala Lumpur
1010122165452  1513354 5           Tokyo
1010198798713  1517773 10          Seoul

Using dplyr in R, how can I get

no. of cities searched | count of distinct visitorid
1                      | 500
2                      | 300
3                      | 10 

I'll like to get no. of cities searched vs count of distinct visitorId


Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>