I'm on macOS. There's a minified version of MacTeX, but it requires figuring out what else you need to install to make it work, which when you're using it via pandoc via RMarkdown is not necessarily simple. The idea is that tectonic just downloads what it needs to get the job done without the user ever calling TeXLive Manager.
dumb question: i want to do sprintf("% 5.0f", 1:10) where the 5 is determined dynamically. is there some not-awful way to do this (not switching back and forth between sprintf and paste)? i guess i've done it before but am at a loss
You can do this as follows:
printf("%*d", width, value);
From Lee's comment:
You can also use a * for the precision size:
printf("%*.*f", width, precision, value);
Question for data.table guys. I'm using lists inside a row like this: dt[,gearsL:=.(list(unique(gear))), by=cyl] . I'd like to store that in an sql database to use later. Is there a way to flatten the list so it's readable again as a data.table item ?
@PLapointe hm, not sure i follow. seems like it should depend a lot on the DB. i know various ones are designed for different purposes and support different things... simplest way would be to dt[, rid := .I]; gearLDT = dt[, .(gear = unlist(gearsL)), by=rid] and store the latter table in the DB too, eh..?
@Frank I see what you did. However, I need to store the entire list in one "cell" (in excel terms), store that long character field in an sql database in a way I could read it again as as.data.frame or something similar.
my real life example, the gearsL:=.(list(unique(gear))) is a two item list which can be transformed to a data frame (same number of rows)
@PLapointe ok, but lists are not text. i guess the only rationale for storing a two item list is because the order doesn't matter (otherwise, you could use two columns, one for the first element and the other for the second?), and if the order doesn't matter, then you are trying to store a set (in the set theoretic sense), so you need a DB that supports set-valued cells... or to make a new table
relational data is almost always smaller, in terms of memory, than a single massive table, in my experience...
(currently chopping a 2GB thing i was given, hopefully into relational tables...)
@yeah, I understand what you are saying, but I will never need to do operations on this list by SQL, I will need to load specific rows back in R to do a merge of the info in these lists.
my SQL data base is already huge, i'm just trying to store text
So, per Mehrdad's answer to a related question, I get it that a "proper" database table column doesn't store a list. Rather, you should create another table that effectively holds the elements of said list and then link to it directly or through a junction table. However, the type of list I wan...