similar to: transform a list of arrays to tibble

Displaying 20 results from an estimated 200 matches similar to: "transform a list of arrays to tibble"

2023 Oct 17
1
transform a list of arrays to tibble
Arnaud, Short answer may be that the tibble data structure will not be supporting row names and you may want to simply save those names in an additional column or externally. My first thought was to simply save the names you need and then put them back on the tibble. In your code, something like this: save.names <- names(my.ret.lst) result.tib <- as_tibble_col(unlist(my.ret.lst),
2020 Nov 21
3
Error in unsplit() with tibbles
Hello, using the `unsplit()` function with tibbles currently leads to the following error: > mtcars_tb <- as_tibble(mtcars, rownames = NULL) > s <- split(mtcars_tb, mtcars_tb$gear) > unsplit(s, mtcars_tb$gear) Error: Must subset rows with a valid subscript vector. ? Logical subscripts must match the size of the indexed input. x Input has size 15 but subscript `rep(NA, len)` has
2020 Nov 21
2
Error in unsplit() with tibbles
I get the sentiment, but this is really just bad coding (on my own part, I suspect), so we might as well just fix it... -pd > On 21 Nov 2020, at 17:42 , Marc Schwartz via R-devel <r-devel at r-project.org> wrote: > > >> On Nov 21, 2020, at 10:55 AM, Mario Annau <mario.annau at gmail.com> wrote: >> >> Hello, >> >> using the `unsplit()`
2017 Nov 08
2
Ggplot error
Hello, I've an error recently. ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line() Error: Found object is not a stat. > sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.3 LTS Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.18.so locale: [1] LC_CTYPE=tr_TR.UTF-8
2017 Nov 08
0
Ggplot error
I was not able to reproduce this problem. I tried two environments 1. Ubuntu 14.04.5 LTS, R version 3.4.2 (same R version as yours) 2. Windows 10, same R version On Wed, Nov 8, 2017 at 9:50 AM, Zeki ?ATAV <zcatav at gmail.com> wrote: > Hello, > I've an error recently. > > ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line() > Error: Found object is not a stat. >
2017 Aug 07
1
tidyquant error downloading symbols for Index
Hi R Helpers, I recently tried to take advantage of the ability to download all the tickers in the S&P 500 using the functionality of tidyquant, but it threw an error. For summary, the set of commands that I ran was library(tidyquant) tq_index_options() tq_index("SP500") sessionInfo() R feedback including error message and sessionInfo are provided below. Guidance would be
2017 Nov 08
1
Ggplot error
I get the same result as Eric? withR version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 17.04 It looks like you have "tidyverse" loaded so I tried it with just ggplot2 loaded and with tidyverse loaded.? On Wednesday, November 8, 2017, 4:16:14 AM EST, Eric Berger <ericjberger at gmail.com> wrote: I was not able to reproduce this
2017 Nov 28
2
dplyr - add/expand rows
Or with the Bioconductor IRanges package: df <- with(input, DataFrame(station, year=IRanges(from, to), record)) expand(df, "year") DataFrame with 24 rows and 3 columns station year record <character> <integer> <character> 1 07EA001 1960 QMS 2 07EA001 1961 QMC 3 07EA001 1962 QMC 4
2012 Nov 09
2
TreynorRatio
i read about the performance analytics package i have a doubt about the TreynorRatio i have code g=getSymbols("IBM") > c=Cl(g) > r=Return.calculate(c) > SharpeRatio.annualized(r) IBM.Close Annualized Sharpe Ratio (Rf=0%) 0.3566339 > TreynorRatio (ret) Error in inherits(x, "xts") : argument "Rb" is missing, with
2017 Nov 29
2
dplyr - add/expand rows
On 11/29/2017 04:15 PM, T?th D?nes wrote: > Hi, > > A benchmarking study with an additional (data.table-based) solution. I don't think speed is the right benchmark (I do agree that correctness is!). For the R-help list, maybe something about least specialized R knowledge required would be appropriate? I'd say there were some 'hard' solutions -- Michael (deep
2017 Nov 27
2
dplyr - add/expand rows
try this: ########################################## library(dplyr) input <- tribble( ~station, ~from, ~to, ~record, "07EA001" , 1960 , 1960 , "QMS", "07EA001" , 1961 , 1970 , "QMC", "07EA001" , 1971 , 1971 , "QMM", "07EA001" , 1972 , 1976 , "QMC", "07EA001" , 1977 ,
2017 Nov 29
0
dplyr - add/expand rows
Hi, A benchmarking study with an additional (data.table-based) solution. Enjoy! ;) Cheers, Denes -------------------------- ## packages ########################## library(dplyr) library(data.table) library(IRanges) library(microbenchmark) ## prepare example dataset ########### ## use Bert's example, with 2000 stations instead of 2 d_df <- data.frame( station =
2010 Jul 05
2
Can anybody help me understand AIC and BIC and devise a new metric?
Hi all, Could anybody please help me understand AIC and BIC and especially why do they make sense? Furthermore, I am trying to devise a new metric related to the model selection in the financial asset management industry. As you know the industry uses Sharpe Ratio as the main performance benchmark, which is the annualized mean of returns divided by the annualized standard deviation of returns.
2017 Nov 28
0
dplyr - add/expand rows
On 11/26/2017 08:42 PM, jim holtman wrote: > try this: > > ########################################## > > library(dplyr) > > input <- tribble( > ~station, ~from, ~to, ~record, > "07EA001" , 1960 , 1960 , "QMS", > "07EA001" , 1961 , 1970 , "QMC", > "07EA001" , 1971 , 1971 ,
2011 May 23
2
Passing function arguments to dataset names
Hello, I am stuck in a relatively simple procedure and was wondering if anybody knows the answer. I am a relatively new R user. How do I use an argument of a custom function in the name of a dataset in R? For example, I have the function: MyF <- function(Tic, price){ xxxxx xxxxx xxxxx Ratio.Tic<- SharpeRatio.annualized(roc) } I would
2017 Nov 29
0
dplyr - add/expand rows
Hi Martin, On 11/29/2017 10:46 PM, Martin Morgan wrote: > On 11/29/2017 04:15 PM, T?th D?nes wrote: >> Hi, >> >> A benchmarking study with an additional (data.table-based) solution. > > I don't think speed is the right benchmark (I do agree that correctness > is!). Well, agree, and sorry for the wording. It was really just an exercise and not a full
2017 Sep 14
1
Print All Warnings that Occurr in All Parallel Nodes
Dear R Users, I have developed the following code for importing a series of zipped CSV by parallel computing. My problems are that: A) Some ZIP Files (Which contain CSVs inside) are corrupted, and cannot be opened. B) After executing parRapply I can only see the last.warning variable error, for knowing which CSV have failed in each node, but I cannot see all warnings, only 1 at a time. So: *
2020 Nov 21
0
Error in unsplit() with tibbles
> On Nov 21, 2020, at 10:55 AM, Mario Annau <mario.annau at gmail.com> wrote: > > Hello, > > using the `unsplit()` function with tibbles currently leads to the > following error: > >> mtcars_tb <- as_tibble(mtcars, rownames = NULL) >> s <- split(mtcars_tb, mtcars_tb$gear) >> unsplit(s, mtcars_tb$gear) > Error: Must subset rows with a valid
2010 Oct 25
3
Using tapply?
Dear R helpers, I am trying to calculate the Annualized Percent Rate using following R - Code. # ____________________________________________________________________ ## R Code library(animation) # INPUT C = 250000    # Loan Amount E = 2500      # Other Cost R = 6         # Interest rate r = R/1200    # Monthly interest rate q = 12        # No of Compoundings        n = 20        # No of
2020 Nov 21
0
Error in unsplit() with tibbles
Cool - thank you Peter! @Marc: This is really not a tidyverse vs base-R debate and I personally think that they should both work together for most parts. The common environment is still R. But just to give you the full picture I also filed a bug for tibbles (https://github.com/tidyverse/tibble/issues/829). With these two fixes I think that split/unsplit would work for tibbles and users (like me)