Search
 
SCRIPT & CODE EXAMPLE
 

R

how to add random numbers randomly in a dataframe in r

# 1000 random numbers with 0 or 1 values:

a <-sample(0:1, 1000, rep = TRUE)

# 0 1 1 0 0 0 1 0 ...
Comment

PREVIOUS NEXT
Code Example
R :: harmonic mean in r 
R :: remove line with na r 
R :: generate all possible combinations of a set of characters r 
R :: find data type of vector r 
R :: how to add new value in R list 
R :: r range with step 
R :: read csv in r 
R :: r convert matrix to list of column vectors 
R :: how to import csv file in r 
R :: split strings by space in r 
R :: diff days R lubridate 
R :: how to build random forest in r 
R :: r seq 
R :: r ddply 
R :: turn row names into column in r 
R :: create vector in r 
R :: How to use par() in R 
R :: Reorder bars in geom_bar ggplot2 by value 
R :: make the first row as header in r 
R :: calculated defualt values in R function parameters 
R :: unset par mar 
R :: generate bin frequency table in R 
R :: How to create a new column with spark_apply 
R :: excel date format r 
R :: how the print backslash in r 
R :: how to get the number of individual numbers in a vector in r 
Rust :: whats the difference between Iter and into_iter rust 
Rust :: add element to vec rust 
Rust :: calculator in rust 
Rust :: run or compile rust code 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =