user2047882
user2047882

Reputation: 11

Changing vector names

To tidy up my data, I used following function -

tolower(gsub("\\.","",names(data)))

to remove Capitalization and dots (.) from long vector names like Last.Inquiry.For.Loan

It worked and gave back: lastinquiryforloan. But it is not sticking. When I run summary(data), I see all the old vector names. How do I make this change permanent, so that analysis is easier for me?

Upvotes: 1

Views: 1866

Answers (1)

rrs
rrs

Reputation: 9913

Arun is saying that you never actually replaced the old names. Try

names(data) <- tolower(gsub("\\.","",names(data)))

Upvotes: 5

Related Questions