25, 35, 45, 55, 18, 28, 38, 48, 58),
Lot=c(1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 11, 21, 31, 41, 51),
Location = c("HSV", "ATH", "HSV", "ATH", "FLO", "HSV", "ATH", "HSV", "ATH",
"FLO", "HSV&qu
On 23 Mar 2009, at 17:39, Jason Rupert wrote:
I would like to replace a few varaibles within a data frame.
For example, in the dataframe below (contrived) I would like to
replace the current housesize value only if the Location is HSV.
However, I would like to leave the other values int
Dear Jason,
Try this:
index<- with(test_data2_df,Location %in% "HSV")
test_data2_df$HouseSize<-ifelse(index,1000,test_data2_df$HouseSize) # I
used 1000 as reference
test_data2_df
HTH,
Jorge
On Mon, Mar 23, 2009 at 1:39 PM, Jason Rupert wrote:
>
> I would like to replace a few varaibles withi
I would like to replace a few varaibles within a data frame.
For example, in the dataframe below (contrived) I would like to replace the
current housesize value only if the Location is HSV. However, I would like to
leave the other values intact.
I tried "ifelse", but I don't really need
4 matches
Mail list logo