Skip to content

rmarkdown-advanced example read/compile error using foreign (v0.8-68). solution using readstata13 or haven #1

@drenn2

Description

@drenn2

Replace line 100-111

```{r, echo=TRUE, message=FALSE}
need <- c("foreign", "sandwich", "ggplot2", "stargazer", "readstata13") # list packages you need
have <- need %in% rownames(installed.packages()) # see which are already
if(any(!have)) install.packages(need[!have]) # installs the missing ones 
invisible(lapply(need, library, character.only=T)) # then loads them all
```

Load the data: 

```{r, echo = T, message = F, warning=F}
washb <- readstata13::read.dta13("WASHBpublic_mock.dta") # Fix error using the foreign package
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions