The Shannon index is Σplnp from i = 1 to s, where p is the proportion (n/N) of individuals of one particular species found (n) divided by the total number of individuals found (N), ln is the natural log, Σ is the sum of the calculations, and s is the number of species. So it is easy to calculate in R :)
The Indval is usually calculated for groups with a couple or many samples, while the Shannon index is calculated for a single sample. One option is to calculate a single Shannon index for each sample, then take the mean value for that a group (which is more ecologically meaningful), or to merge the samples of one group into a single sample, then calculate the Shannon index for it.
There is no function in R that does this, as far as I know. You would need some matrices modifications previous to use the already existing functions.