I need to create a column with the ln of a variable in the same data frame

Asked

Viewed 511 times

3

I have a series of data for example GDP and I need to create a column next to it with the variable lnPIB, as I do in R?

1 answer

4

Just do:

bd <- data.frame(PIB = PIB)
bd$lnPIB <- log(bd$PIP)

Ready! Your data.frame called bd now has a column with the logarithm value of the GDP.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.