Patrick Baylis' R Functions

add_lags_and_leads | Return data.table with lag |

clean_binned_results | Clean binned results from felm (and maybe lm?). Will try to... |

construct_formula | Construct a formula for lfe::felm |

cut_and_reorder | Reorder a variable quickly for a regression. |

extract_from_range | Get varname, min, max from named range. Not exported |

fC | Convenience function to format number with commas. |

felm_to_dt | # Convert felm to data.table. Not exported for now. |

find_missing | # By varname, fill in missing value, assuming constant gap.... |

get_all_dups | Get all duplicates in a data.table for a given set of... |

latex_makesubrules | Create a set of cmidrules based on given edges. |

latex_special_row | Create a LaTeX table row character vector wrapped in... |

obj_size | Return data.table with lag |

pastep | Concatenate and flattens strings with " + " |

reg_felm | Run a regression and return the results in a tibble. Useful... |

stargazerw | Calls stargazer, returns cleaned up stargazer output. Sets a... |

strip_felm | Strip off data-intensive felm objects. |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.