Hi,

yes, it's really not a finance question, but I think it's okay to give an
answer shortly:

Assuming your table is named myTable, just do the following:

for(i in 1:nrow(myTable)){
	if(is.na(myTable$name_x[i]) || (myTable$name_x[i] == " ")){
		myTable$name_x[i] <- myTable$name_y[i]
	}
}

This should work. I haven't tested it due to the fact that you haven't
provided your first tries as a code snippet, but I'm entirely sure this will
work. But in general I would do it via sql, this will employ the solution
much faster.

Best regards,

Konrad Hoppe
www.konrad-hoppe.com


-----Ursprüngliche Nachricht-----
Von: r-sig-finance-bounces@stat.math.ethz.ch
[mailto:r-sig-finance-bounces@stat.math.ethz.ch] Im Auftrag von
jeff.a.ryan@gmail.com
Gesendet: Donnerstag, 17. Juni 2010 15:09
An: Daniel; r-sig-finance-bounces@stat.math.ethz.ch;
r-sig-finance@stat.math.ethz.ch
Betreff: Re: [R-SIG-Finance] update cells

Not a Finance question. Please follow the posting guidelines and redirect to
R-help

Jeff
Sent via BlackBerry from T-Mobile

-----Original Message-----
From: Daniel <dmsilv@gmail.com>
Date: Thu, 17 Jun 2010 08:34:16 
To: <r-sig-finance@stat.math.ethz.ch>
Subject: [R-SIG-Finance] update cells

Hello all,I have a table with about 18000 rows, I need to UPDATE the strings
in the "name.x" column in each row by the strings from "name.y" given if
"name.x" is NA or " ". How can I do it?
Also I want to update values in other columns, but I think that will be the
same job.
Daniel

	[[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance@stat.math.ethz.ch mailing list

-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions
should go.

_______________________________________________
R-SIG-Finance@stat.math.ethz.ch mailing list

-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions
should go.

	[[alternative HTML version deleted]]

