[R-SIG-Finance] 4-digit SIC codes

G See gsee000 at gmail.com
Tue Feb 5 04:29:37 CET 2013


I'm not sure, but here's a really quick and dirty way to get it

> library(XML)
> x <- readHTMLTable("http://www.sec.gov/info/edgar/siccodes.htm",
                                  stringsAsFactors=FALSE)[[4]]
> colnames(x) <- x[2, ]
> SIC <- x[-c(1:3), ]
> head(SIC)
  SICCode A/D  Office                                    Industry Title
4     100           5                     AGRICULTURAL PRODUCTION-CROPS
5     200           5  AGRICULTURAL PROD-LIVESTOCK & ANIMAL SPECIALTIES
6     700           5                             AGRICULTURAL SERVICES
7     800           5                                          FORESTRY
8     900           5                     FISHING, HUNTING AND TRAPPING
9    1000           9                                      METAL MINING

> SIC[SIC$SICCode == "2834", ]
   SICCode A/D  Office               Industry Title
91    2834           1  PHARMACEUTICAL PREPARATIONS

HTH,
Garrett

On Mon, Feb 4, 2013 at 9:19 PM, Bastian Offermann
<bastian2507hk at yahoo.co.uk> wrote:
> Hi,
> does anybody know whether 4-digit SIC codes are available in R? Something
> along the lines
>
> "2834" "Pharmaceutical Preparations"
>
> Thank you.
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.



More information about the R-SIG-Finance mailing list