Dear Sohail,
For example, for the variable x in data frame df,
df$x[df$x <= 0] <- 0
I hope that this helps,
John
At 09:22 AM 9/29/2003 -0400, Khan, Sohail wrote:
Hi,
I am new to S language. I need to write a function which would replace all
values < 0 in a column(data.frame) with 0.
Thanks
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox@mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------
|