Search
 
SCRIPT & CODE EXAMPLE
 

R

how to read a vector input in r

elements_ <- c()
# let's say this vector consists of 4 elements
total_dim <- 4
# Using a for loop statement and the sequence function
for (i in seq(total_dim)) {
  elements_[i] <- as.numeric(readline(paste("Enter element",i,": ")))
}
Comment

PREVIOUS NEXT
Code Example
R :: turn matrix into dataframe r 
R :: import excel into r 
R :: r reverse vector 
R :: count word in a string r 
R :: convert a row to a column in r 
R :: r merge by two columns 
R :: R get specific character from string 
R :: histogram r add line 
R :: r - reorder columns in data frame 
R :: r - remove NA from a coulm 
R :: disable the y axis in plot r 
R :: check R package 
R :: r remove inf values 
R :: remove_all_labels(x) 
R :: Remove specific data frames from R 
R :: summary metrics of confusion matrix 
R :: how to interpolate missing data in r with example 
R :: R excel 
R :: how to group rages in r 
R :: Edit axis labels R 
R :: fcrit in r 
R :: Print the names of all worksheets in r 
R :: r - if value in a df is between two number then add 1 
Rust :: rust bevy query option 
Rust :: rust check valid email address using regex 
Rust :: rust repeat character x times 
Rust :: get os name rust 
Rust :: rust for loop 
Rust :: rust spinning rod animation in text 
Rust :: rust return the result with trait exit status 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =