how to replace a dataframe with another dataframe in R

i want to replace a df1 data, with df2, which df2 is a data like df1 example df1 <- data.frame( name = c( "A. MAHJUM-61365", "A. MAHJUM-61365. MAHJUM-61365", "A. RIZAL. AD-11002795", "A. RIZAL. AD-11002795. RIZAL. AD-11002795", "ABD. KADIR-60447", "ABD. KADIR-60447ABD. KADIR-60447", "ABD. KAHAR-62551", "ABD. RASYID DS-11002082", "ABDREAS APUNG @SANY", "ABDUL AZIS @HYUNDAY", "ABDUL AZIZ @HYUNDAI",… Read More how to replace a dataframe with another dataframe in R

Convert to matrix but keep one diagonal to NULL in R

I have a huge dataset and that look like this. To save some memory I want to calculate the pairwise distance but leave the upper diagonal of the matrix to NULL. library(tidyverse) library(stringdist) #> #> Attaching package: ‘stringdist’ #> The following object is masked from ‘package:tidyr’: #> #> extract df3 <- tibble(fruits=c("apple","banana","ananas","apple","ananas","apple","ananas"), position=c("135","135","135","136","137","138","138"), counts =… Read More Convert to matrix but keep one diagonal to NULL in R