Lineability in subsets of measure and function spaces