In reply to Glyn Adgie.
In the US, the National Science Foundation is fairly well insulated from political influences. Peer review is the primary factor in deciding what gets funded; research community input through the CCC plays a big role in setting 10-20-year priorities. The National Institutes of Health are similarly insulated. Tax funding is the largest source of funding for university-based research. Several companies also accept substantial amounts of taxpayer money (e.g., IBM, Xerox, and many tech startups).