Is there an R function that implements the finite element method?
There is a new package that uses Finite Element Method (FEM). I think that's one of the first steps for using FEM in R.
fdaPDE
There is a book which tackles this topic exclusively:
Finite Element Computations in Mechanics with R: A Problem-Centered Programming Approach 1st Edition Khameel Bayo Mustapha
CRC Press Published April 20, 2018
More information can be found here: https://www.crcpress.com/Finite-Element-Computations-in-Mechanics-with-R-A-Problem-Centered-Programming/Mustapha/p/book/9781138501621