I contain a dataset 'area'
House_No. Info_On_Area
1a Names of neighbouringhouse in 100m 1b 1c 1d 1e
1a Area of neighbouringhouse in 100m 500 1000 1500 300
1a Names of neighbouringhouse in 300m 1b 1c 1d 1e 1f 1g 1h
1a Area of neighbouringhouse in 300m 500 1000 1500 300 600 400 2000
2a Names of neighbouringhouse in 100m 2b 2c 2d 2e
2a Area of neighbouringhouse in 100m 500 1000 1500 300
2a Names of neighbouringhouse in 300m 2b 2c 2d 2e 2f 2g 2h
2a Area of neighbouringhouse in 300m 500 1000 1500 300 600 400 2000
I want to create a dataframe where I can have the table to appear as
House_No. Area of neighbouringhouse in 100m Area of neighbouringhouse in 300m
I used dplyr and grouped the different house numbers
CT <- data.frame(but %>% group_by(House_No.
)) and tried using rowSums. However, I got the error saying that the information is not numeric. I think that is because I need to make the numbers in the row values as numbers and I am not sure of how to do so.
I got stuck at this stage and couldnt proceed further.
I did look into similar solutions but they dont seem to be having a data frame where they are working towards the summing row values such as Sum rows in data.frame or matrix, Sum by Rows in R.
I would be grateful for any help! Thank you :)
dput(head(df, 10))
– AlexB