Search
 
SCRIPT & CODE EXAMPLE
 

R

combine row for every element of vector r

# Do this for vectors
v1 <- 1:2
v2 <- 3:4
expand.grid(v1, v2)
#  Var1 Var2
#1    1    3
#2    2    3
#3    1    4
#4    2    4

# Use merge for dataframes
df1 <- data.frame(a = 1:2, b=3:4)
df2 <- data.frame(cat = 5:6, dog = c("a","b"))
merge(df1, df2)
Comment

PREVIOUS NEXT
Code Example
R :: digits in format and formatc in r 
R :: how to pull all 500 stocks r 
R :: mean of a row dataframe in r 
R :: Iteration in R 
Rust :: rustlang error: linker `link.exe` not found 
Rust :: append to file rust 
Rust :: rust create directory 
Rust :: create file rust 
Rust :: rust timestamp 
Rust :: rust case 
Rust :: rust implement clone for struct 
Rust :: rust struct default values 
Rust :: rust global variables 
Rust :: struct in rust 
Rust :: rust initialize struct 
Rust :: rust lang enum 
Rust :: rust lang expected item found let 
Rust :: Read a floating point number from stdin 
Rust :: $sce trust url 
Rust :: armanriazi•rust•thread 
Rust :: armanriazi•rust•concept•datarace•rustaceans 
Rust :: armanriazi•rust•lifetime•drop 
Lua :: lua how to get random object from a table 
Lua :: roblox make kill brick 
Lua :: Pass values to functions from Onclicks roblox 
Lua :: prompt game pass purchase 
Lua :: lua json 
Lua :: roblox camera manipulation 
Lua :: lua string replace / remove 
Lua :: check if player is in group 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =