There’s the combn
function in the utils
package:
t(combn(LETTERS[1:3],2))
# [,1] [,2]
# [1,] "A" "B"
# [2,] "A" "C"
# [3,] "B" "C"
I’m a little confused as to why your x
has duplicated values.
More Related Contents:
- How to sort a character vector where elements contain letters and numbers in R?
- Filter rows which contain a certain string
- Apply function conditionally
- Gantt charts with R
- Splitting a continuous variable into equal sized groups
- Create integer sequences defined by ‘from’ and ‘to’ vectors
- customize ggplot2 axis labels with different colors
- Select every nth row from dataframe
- Is set.seed consistent over different versions of R (and Ubuntu)?
- Append data frames together in a for loop
- Can’t download data from Yahoo Finance using Quantmod in R
- Splitting a data.frame by a variable [duplicate]
- Advantages of reactive vs. observe vs. observeEvent
- Creating regular 15-minute time-series from irregular time-series
- Efficiently computing a linear combination of data.table columns
- Rounding numbers in R to specified number of digits
- Unlist a data frame by rows, not columns
- Scraping a dynamic ecommerce page with infinite scroll
- How to add table of contents in Rmarkdown?
- Calculating percentile of dataset column
- How do you delete a column by name in data.table?
- Applying a function to two lists?
- Merging two sets of data by data.table roll=’nearest’ function
- How to select R data.table rows based on substring match (a la SQL like)
- Non-numeric Argument to Binary Operator Error in R
- Special characters and superscripts on plot axis titles
- Character POSIXct Conversion in R causes wrong timezone values on daylight saving time transition (CEST/CET))
- SI prefixes in ggplot2 axis labels
- print to pdf file using grid.table in r – too many rows to fit on one page
- how to start a for loop in R programming