Hello I was trying to set up a function() that allows easely to calculate regressions for severel dependent variables with the same independent variables.
My function looked like this but was turned down by an error (Im quiet new to R Studio). So here is my solution: b CO2 logTrop_Aerosol lm(b ~ CO2 + logTrop_Aerosol ) Trend <- function(x,CO2,logTrop_Aerosol) { lm x CO2 + logTrop_Aerosol} b is a vector containing 400 values of heat content CO2 also contains 400 values as well as logTropAerosol my idea would be that I simply can replace x (heat content) by other vectors containing heat content. The error I got was the following: Error: unexpected symbol in "Trend <- function(x,y,z) { lm x" Thanks a lot for the help! Best Matthias [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.