Hi Stefano,
maybe something like this can help you?
myfactor <- as.factor(c(2024, 2, 1, 0, 0))
# Convert factor values to integers
first_element <- as.integer(as.character(myfactor)[1])
second_element <- as.integer(as.character(myfactor)[2])
third_element <- as.integer(as.character(myfactor)[3])
Hi All,
I just have two questions since I did not understand the behavior of
'[' vs the subset() function when filtering a dataframe that has NA
values
I was filtering a dataframe named 'weight' according to values of the
column named 'weight_rec' ...
str(weight)
'data.frame': 17307 obs. of 6
Hi Luigi,
try this
library(taRifx)
df_noFact <- remove.factors(df)
str(df_noFact)
'data.frame': 5 obs. of 3 variables:
$ region : chr "A" "B" "C" "D" ...
$ sales : num 13 16 22 27 34
$ country: chr "a" "b" "c" "d" ...
I hope this helps
Fabio
Il giorno dom 19 set 2021 alle ore 12:04 Luigi
3 matches
Mail list logo