Posts by Rafael Toledo • 338 points
9 posts
-
0
votes1
answer78
viewsA: how to define the input array for RNA training in the rnn package?
It seemed to me your data are organized as follows, each line you have the record of a single variable in 4 sequential moments of time, the Q_t is the value you want to predict based on the sequence…
-
2
votes2
answers416
viewsA: Sort column of a data frame in R
For me, the most elegant way would be to create a function that simplifies the chain of ifelse, and even generalize the transformation of the function to other situations. Example:…
ranswered Rafael Toledo 338 -
4
votes1
answer3371
viewsA: How to change the class of a variable within a table/ data frame/ Tibble?
first would be nice if you exposed your data or a part of it to make the problem playable. But, here taking a generic case. library(dplyr) tibble(uf=c("AM", "RJ", "SC"), regiao=c("norte", "sudeste",…
-
3
votes2
answers1675
viewsA: Percentage Frequency in R with dplyr
You can try it: dados %>% group_by(Central, depositos) %>% mutate(freq_relat=Resultado/sum(Resultado)) %>% mutate(freq_relat=round(freq_relat*100, 2))…
-
1
votes2
answers1241
viewsA: How to do sequence in R?
Complementing with one more response option, you can also use lapply. criar_seq <- function(x){ seq(x, (n+x-1)) } n <- 8 lapply(1:n, criar_seq) This will return a list of n sequences with the…
ranswered Rafael Toledo 338 -
8
votes2
answers2782
viewsQ: Is there a difference between assigning value using '<-' or '=' in R?
In practical terms there seems to be no difference, but underneath the cloth as language processes there is some difference?
-
0
votes1
answer231
viewsA: How to install Ebimage package for version 3.3.0 and 3.3.1 of R?
I was going to comment below the question because I do not have an accurate answer, but as I still do not have enough reputation I can not comment, so I will leave a hint here. Looks like you’re…
-
0
votes1
answer82
viewsA: Rename children directory and directories
By accessing each directory, you can rename all the files within it using: rename 's/^/0/' *, for a specific extension just change the * as rename 's/^/0/' *.in or also: for file in $(ls); do mv…
bashanswered Rafael Toledo 338 -
1
votes1
answer767
viewsA: Convert data.frame object to Numeric
@Julio Cesar, you can’t do that kind of operation with a data.frame. Some solutions to your problem: df <- data.frame("col_1" = as.character(seq(1,10)), "col_2" = as.character(seq(11,20))) 1.…
answered Rafael Toledo 338