RDSTK is a very versatile package. It includes functions to help you convert IP address to geo locations and derive statistics from them. It also allows you to input a body of text and convert it into sentiments. This is a continuation from the last exercise RDSTK 2 We are going to use the function […]
Data Hacking with RDSTK solution 3
Below are the solutions to these exercises on the RDSTK package ############### # # # Exercise 1 # # # ############### list=c("97.77.104.22","104.199.228.65","50.93.204.169","107.189.46.5","104.154.142.10","104.131.255.12","209.212.253.44","70.248.28.23","52.119.20.75","192.169.168.15","47.88.31.75 80","107.178.4.109","152.160.35.171","104.236.54.196","50.93.197.102","159.203.117.1","206.125.41.132","50.93.201.28","8.21.67.248 31","104.28.16.199") ############### # # # Exercise 2 # # # ############### df=data.frame(list) df[,1]=as.character(df[,1]) data=lapply(df[,1],ip2coordinates) df=do.call(rbind.data.frame,data) df ## ip.address dma_code latitude country_code3 area_code longitude ## 1 97.77.104.22 641 29.4717 USA 210 -98.5140 ## […]
Data Hacking with RDSTK 2
RDSTK is a very versatile package. It includes functions to help you convert IP address to geo locations and derive statistics from them. It also allows you to input a body of text and convert it into sentiments. This is a continuation from the last exercise RDSTK 1 This package provides an R interface to […]
Data Hacking with RDSTK 2 solution
Below are the solutions to these exercises on sorting and ordering. ############### # # # Exercise 1 # # # ############### library(RDSTK) ############### # # # Exercise 2 # # # ############### s1="statistics" s3="value" stringer= function(s2){ s1="statistics" s3="value" s2=as.character(s2) return(paste(s1,s2,s3, sep = ".")) } ############### # # # Exercise 3 # # # ############### stringer("hello") […]
Data Hacking with RDSTK (part 1)
RDSTK is a very versatile package. It includes functions to help you convert IP address to geo locations and derive statistics from them. It also allows you to input a body of text and convert it into sentiments. This package provides an R interface to Pete Warden’s Data Science Toolkit. See www.datasciencetoolkit.org for more information. […]
Data Hacking with RDSTK (part 1) solution
Below are the solutions to these exercises on data hacking with RDSTK (part 1). ############### # # # Exercise 1 # # # ############### library(RDSTK) ############### # # # Exercise 2 # # # ############### stat=ip2coordinates(“165.124.145.197″) ############### # # # Exercise 3 # # # ############### stat$elevation=coordinates2statistics(stat[3],stat[6],”elevation”)[‘statistics.elevation.value’] ############### # # # Exercise 4 # # […]
Let’s get started with dplyr
The dplyr package by Hadley Wickham is a very useful package that provides “A Grammar of Data Manipulation”. It aims to simplify common data manipulation tasks, and provides “verbs”, i.e. functions that correspond to the most common data manipulation tasks. Have fun playing with dplyr in the exercises below! Answers to the exercises are available […]
Let’s get started with dplyr Solution
Below are the solutions to these exercises on dplyr. ############### # # # Exercise 1 # # # ############### df=data.frame(Theoph) library(dplyr) ############### # # # Exercise 2 # # # ############### names(df) ## [1] "Subject" "Wt" "Dose" "Time" "conc" ############### # # # Exercise 3 # # # ############### select(df,Subject:Dose) ## Subject Wt Dose ## […]
Protected: Tidy the data up!
There is no excerpt because this is a protected post.
Protected: Tidy the Data Up Solutions
There is no excerpt because this is a protected post.