Re: [R] Selecting elements

2021-08-25 Thread Jim Lemon
Hi Silvano, Just add the selected elements to the return value: set.seed(123) Var.1 <- rep(LETTERS[1:4], 10) Var.2 <- sample(1:40, replace=FALSE) data <- data.frame(Var.1, Var.2) (Order <- data[order(data$Var.2, decreasing=TRUE), ]) allowed<-matrix(c(3,3,2,2,2,5,0,3,3,4,2,1),nrow=3,byrow=TRUE) col

Re: [R] Selecting elements

2021-08-25 Thread Silvano Cesar da Costa
Wow, That's exactly what I want. But, if possible, that a list was created with the selected elements (variable and value). Is it possible to add in the output file? Thank you very much. Prof. Dr. Silvano Cesar da Costa Universidade Estadual de Londrina Centro de Ciências Exatas Departamento de E

Re: [R] Need help to unzip files in Windows

2021-08-25 Thread Rui Barradas
Hello, Are you looking for what follows Andrew's code below to download and untar the files? read_one_gz_file <- function(x, path){ fl <- file.path(path, x) tryCatch({ read.table(zz <- gzfile(fl)) }, warning = function(w) w, error = function(e) e ) } URL <- "https://ftp.ncb