R plm package

A package for Panel analysis in R.

It supports several models – within (fixed effect), random, between, pooling – and effects – individual, time, twoways.

Example:

library("plm")
data("Grunfeld", package="plm")
grun.twfe <- plm(inv~value+capital, data=Grunfeld, model="within", effect="twoways")

See also the “Panel Data Models” chapter from Principles of Econometrics with R.