[R] Structuring Inventory in R

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Wed Aug 28 08:18:03 CEST 2019


Perhaps

dta <- data.frame( SKU=c("4950","8488","1159"), Price=c(10,15,3),Qty=c(24,144,16),ID=c("10208473","38447769","43759115") )

Lists are not as easy to optimize performance with as tables are... unless you have a specific reason to use them I would minimize your use of single-element items in lists.

On August 27, 2019 9:49:28 PM PDT, Jim Lemon <drjimlemon using gmail.com> wrote:
>Hi Alex,
>At a guess you may want something like this:
>
>data.frame(item="SKU",price=10,qty=2,ID="00001")
>
>This produces a data frame with one row. You will probably want many
>more rows.
>
>Jim
>
>On Wed, Aug 28, 2019 at 2:21 PM Alex Naverniak <stopro888 using gmail.com>
>wrote:
>>
>> Hi,
>> I am trying to create Inventory structure with item SKU and 3
>subitems like
>> "Price"; "Qty"; "ID". I tried
>list(SKU,list("Item1","Item2","Item3")). It
>> seem not to work. Please help with ideas. Thanks.
>> Alex
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list