User-based nearest neighbour implementation in R?
Maybe the best answer for Your question is recommenderlab package for R available from CRAN. Here's the link to vignette. It has CF algorithms implemented and Jaccard coef. for 0/1 user feedback case.  

Only similarity(distance) computation in base stats R package there is dist function. But it's limited to few distance measures. I know that when I search for distance measures in R package called vegan claimed to have many methods implemented. But I have never used it. 

IMHO most basic recommender systems algorithms are really simple. It worth spending few minutes and implement it to get a better understanding and intuition how it works. 
Nevertheless, below my quick and dirty user-based kNN implementation for Your case. The code can be rewritten in better way (Adv.R is really good resource) - but this is only example for learning purpose and I do not take responsibilities for any damages :-)

require(reshape2)

ratings &lt;- read.csv(con &lt;- textConnection('
User,Item,Rating
Anna,Apple,2
Bob,Apple,4
Carlos,Apple,1
Ethan,Apple,1
Gene,Apple,2
Anna,Banana,4
Dana,Banana,3
Ethan,Banana,5
Frank,Banana,5
Bob,Carrot,1
Ethan,Carrot,2
Gene,Carrot,4
'), header = T)

R &lt;- ratings %&gt;% dcast(Item ~ User)
ProductNames &lt;- R[,1]
R &lt;- R[,-1] # only ratings

# tanimoto similarity (~Jaccard coefficiet)
tanimoto &lt;- function(v1,v2) length(intersect(v1,v2))/length(union(v1,v2))

# return top-k similar users
getKNN &lt;- function(R, i, k, sim = tanimoto) {
  similarity &lt;- array(0,length(R))
  for(j in 1:length(R)) {
    if(i!=j) similarity[j] = sim(which(!is.na(R[,i])),which(!is.na(R[,j])))
  }
  idx &lt;- order(similarity, decreasing = T)[1:k]
  data.frame(idx = idx, similarity = similarity[idx])
}

kNNRecommender &lt;- function(R, k) {
  reco &lt;- data.frame()
  for(u in 1:length(R)) {
    userItems &lt;- which(!is.na(R[,u])) #items rated by user
    nn &lt;- getKNN(R,u, k) # get user neighbours

    # rating prediction - wiegted by similarity
    r &lt;- array(0, c(dim(R)[1], k))
    for(i in 1:k) {
      r[,i] = R[,nn[i,]$idx] * nn[i,]$similarity
    }
    r[is.na(r)] &lt;- 0
    userReco &lt;- rowSums(r) / sum(nn$similarity)
    userRecoIdx &lt;- order(userReco, decreasing = T)

    # remove items already rated by user
    userRecoIdx &lt;- userRecoIdx[-userItems]

    # add to recommendations result
    reco &lt;- rbind(reco, data.frame(
      User=u,
      Item=(if(length(userRecoIdx)==0) NA else userRecoIdx),
      Prediction=(if(length(userRecoIdx)==0) NA else userReco[userRecoIdx])
    ))
  }
  reco
}

kNNRecommender(R, 2)