Em seg., 29 de dez. de 2025 ?s 17:58, Enrico Schumann <es at enricoschumann.net>
escreveu:
On Mon, 29 Dec 2025, Andre Luiz Tietbohl Ramos writes:
Em seg., 29 de dez. de 2025 ?s 10:25, Enrico Schumann <es at enricoschumann.net>
escreveu:
Could you please post a small, reproducible example (in plain
text)? Otherwise, it will be hard so see where your problem
lies.
kind regards
Enrico
Hello,
Thanks for the interest, Enrico. It is below.
R> tickers
"AALR3.SA" "AGRO3.SA" "ALPA3.SA" "ALPA4.SA" "ALUP11.SA" "AMER3.SA"
AMOB3.SA" "ANIM3.SA" "ASAI3.SA" "AURE3.SA" "AZUL4.SA" "B3SA3.SA" "
BAUH4.SA" "BAZA3.SA" "BBAS3.SA" "BBDC4.SA" "BBSE3.SA" "BDLL4.SA" "
BEES3.SA" "BIDU34.SA" "BLAU3.SA" "BMOB3.SA" "BPAC11.SA" "BPAN4.SA" "
BRAP4.SA" "BRFS3.SA" "BRKM5.SA" "BRSR6.SA" "BRST3.SA" "BSLI3.SA" "
CBAV3.SA" "CEAB3.SA" "CEBR3.SA" "CMIG3.SA" "CMIG4.SA" "CMIN3.SA" "
COPH34.SA" "CPFE3.SA" "CPLE6.SA" "CRPG5.SA" "CSAN3.SA" "CSED3.SA" "
CSMG3.SA" "CSNA3.SA" "CSUD3.SA" "CXSE3.SA" "CYRE3.SA"
...
R>
R> getSymbols(tickers, src = "yahoo", from = start, to = end, maxgap =
auto.asign = TRUE)
R>
R> tickers <- mget(ls(pattern = paste(tickers, collapse = "|")))
R>
R> names(tickers)
[1] "AALR3.SA" "AFHI11.SA" "AGRO3.SA"
"ALPA3.SA" "ALPA4.SA" "ALUP11.SA"
[7] "AMER3.SA" "AMOB3.SA" "ANIM3.SA"
"ASAI3.SA" "AURE3.SA" "AZUL4.SA"
[13] "B3SA3.SA" "BAUH4.SA" "BAZA3.SA"
*"BBAS3.SA <http://BBAS3.SA>" "BBAS3.SA_log_returns"
"BBAS3.SA_mean_log" *
[19] "BBAS3.SA_sd_log" "BBDC4.SA" "BBSE3.SA"
"BBSE3.SA_log_returns" "BBSE3.SA_mean_log" "BBSE3.SA_sd_log"
[25] "BDLL4.SA" "BEES3.SA" "BIDU34.SA"
"BLAU3.SA" "BMOB3.SA" "BPAC11.SA"
[31] "BPAN4.SA" "BRAP4.SA" "BRFS3.SA"
"BRKM5.SA" "BRSR6.SA" "BRST3.SA"
...
R> class(tickers$BBAS3.SA)
[1] "xts" "zoo"
R> colnames(tickers$BBAS3.SA)
[1] "BBAS3.SA.Open" "BBAS3.SA.High" "BBAS3.SA.Low"
"BBAS3.SA.Close" "BBAS3.SA.Volume" "BBAS3.SA.Adjusted"
R> class(tickers$BBAS3.SA_log_returns)
[1] "xts" "zoo"
R> colnames(tickers$BBAS3.SA_log_returns)
[1] "daily.returns"
R> class(tickers$BBAS3.SA_mean_log)
[1] "numeric"
R> R> colnames(tickers$BBAS3.SA_mean_log)
NULL (as expected)
R>
Therefore the list I get from the mget operation above contains several
elements with different types, which may include even _sd_ columns as
My objective is to get rid of the .SA suffix used for Brazilian stocks in
all elements downloaded as well as their columns. I chose to put
everything in a list and operate on it.
[...]
Like Eric, I cannot reproduce your result. In addition
to Dirk's suggestions for debugging:
i) start from a clean session (no workspace-loading);
ii) since your column 'tickers$BBAS3.SA_log_returns' is named
"daily.returns" -- any chance you are (accidentally) calling
'quantmod::dailyReturn' in your code?
--
Enrico Schumann
Lucerne, Switzerland
https://enricoschumann.net