The usual way of finding the percentage of responses that meet a criterion is to count the cases that meet the criterion, divide by the total number of responses and multiply by 100. With the responses coded as 0 and 1, counting the number of ones is the same as summing all of the responses. That is, if you have five responses with two "likes", you may have (1,0,0,1,0). Summing that set of numbers gives 2 and then you would divide by 5 (the number of responses) and multipy by 100 to get 2/5 * 100 = 40%. However, summing a set of values and then dividing the number of values is the same as calculating the mean. The percentage of responses that are 1 is the same as the mean of the responses times 100. mean(1,0,0,1,0) * 100 = 40.
Below is an example of doing this sort of calculation using one possible data layout. I also illustrated how to change Fram to Farm using the str_replace() function from the stringr package.
DF <- data.frame(Site = c("Farm 1","Farm 2","Fram 3","Farm 1","Farm 2",
"Farm 3","Farm 1","Fram 2","Farm 3","Farm 1"),
Like = c(0,1,1,0,0,0,1,0,1,1))
DF
#> Site Like
#> 1 Farm 1 0
#> 2 Farm 2 1
#> 3 Fram 3 1
#> 4 Farm 1 0
#> 5 Farm 2 0
#> 6 Farm 3 0
#> 7 Farm 1 1
#> 8 Fram 2 0
#> 9 Farm 3 1
#> 10 Farm 1 1
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(stringr)
DF <- DF |> mutate(Site = str_replace(Site, "Fram", "Farm"))
DF
#> Site Like
#> 1 Farm 1 0
#> 2 Farm 2 1
#> 3 Farm 3 1
#> 4 Farm 1 0
#> 5 Farm 2 0
#> 6 Farm 3 0
#> 7 Farm 1 1
#> 8 Farm 2 0
#> 9 Farm 3 1
#> 10 Farm 1 1
Percents <- DF |> group_by(Site) |> summarize(Perc = mean(Like) * 100)
Percents
#> # A tibble: 3 x 2
#> Site Perc
#> <chr> <dbl>
#> 1 Farm 1 50
#> 2 Farm 2 33.3
#> 3 Farm 3 66.7
Created on 2021-12-07 by the reprex package (v2.0.1)