Hi R Gurus,

I am writing a simple function that take a numeric vector column from a
data frame and scales the vector column with certain criteria.  I would
then pass this function to a list of dataframes by lappy.

Question is how do I write a function that works on a numeric vector.  My
function as is, seems to work on the first element of the vector.

I.E.
scale
function(x,mn,max){
if (x==min(x)) 0

if (x==max(x)) 10
else x=max-min/10
}

where x is the numeric column of the dataframe.

Thank you.

        [[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.

Reply via email to