home.social
  1. Hey modelling people. I wanted to get into models, and in several introductions to the topic (such as recent ones like frontiersin.org/articles/10.33 ), the R package DMC. From the few tutorials I found, it appears the package was never on CRAN (?) but needed to be downloaded from GitHub. However, I can't find a repository or any trace of the package. Does it still exist?

  2. Get unique rows of a dataframe in , but ignore some columns (e.g., ID in this df)?

    df1 <-
    data.frame(
    name = c("apple", "apple", "apple", "orange", "orange"),
    ID = c(1, 2, 3, 4, 5),
    is_fruit = c("yes", "yes", "yes", "yes", "yes")
    )

    If you're a fan like me, you might want:

    df1[!duplicated(df1[!names(df1) %in% c("ID")]), ]

  3. I don't think my code for day 9 of the will win a beauty competition, BUT I saved every position of every knot, just for this .

    It's too slow for my taste, but any attempt on speeding it up resulted in too many green dots plotted at the same time (I already struggled to make the gold line stay AND have the right number of green dots appear), or the gold line being wonky.

    Find the code here:
    github.com/einGlasRotwein/adve

    PS: This beast takes > 30 min to render.

  4. :rstats: `paste0()` can help you select columns in a df, base R style.

    # generate example data
    df <- as.data.frame(matrix(sample(30), nrow = 3))

    # change last three column names
    names(df)[ncol(df):(ncol(df) - 2)] <- c("some", "random", "names")

    # switch columns up for fun :-)
    df <- df[ , sample(10)]

    # Extract columns V1-V7
    df[paste0("V", 1:7)]