Recent content by trinker

  1. trinker

    Submission of package to CRAN: problem grasping an Error

    Cool. I have had a summer dedicated to family so haven't spent time coding or watching the forums. With the wife and kids back to school I'm back and saw this thread. Glad to hear it has been solved.
  2. trinker

    Submission of package to CRAN: problem grasping an Error

    @giam Did you ever solve this?
  3. trinker

    Bookclub: ISLR

    Not a book but a text of sorts: https://www.linkedin.com/pulse/frequentists-fight-back-kevin-gray/ Wanted to get people's thoughts...
  4. trinker

    Today I Learned: ____

    @jamesmartinn What are you thoughts on the interface for writing the functions? Did you like/dislike it? Was the approach simple? Could you generalize it to new situations?
  5. trinker

    Today I Learned: ____

    @jamesmartinn Nice. Do you have the source code for this available that you'd be willing to share?
  6. trinker

    quantile-quantile plot (qqplot) in R by hand-ish

    Thanks @Dason myppoints <- function(x, a = if(length(x) <= 10) 3/8 else 1/2) ((1:length(x)) - a)/(length(x) + (1-a)-a) par(mfrow = c(2, 1)) plot(qnorm(myppoints(x)), sort(x), xlim = c(-1.5, 1.5)) lines(qnorm(.25), ) qqnorm(x) qqline(x) Not sure yet why the adjustments but the paper...
  7. trinker

    quantile-quantile plot (qqplot) in R by hand-ish

    My understanding of a qqplot was it was the sorted values for a variable on the y against the theoretical values from a normal (or whatever distribution) distribution on the x. We can get the y values from our sample and the x values from looking up the p value in a given distribution and...
  8. trinker

    [R Graphics] Beautiful graphics thread

    https://github.com/GuangchuangYu/yyplot Not beautiful but clever: if (!require("pacman")) install.packages("pacman") pacman::p_load_current_gh('GuangchuangYu/yyplot') ggplot(mtcars, aes(x = mpg, y = hp)) + geom_cake()
  9. trinker

    Creating or editing Matrix

    Another approach if it's a diagonal matrix (off-diagonals are all zero): vv <- matrix(0, nrow=6, ncol=6, dimnames = lapply(1:2, function(i) c("EPA1", "EPA2", "EPA3", "EPA4", "EPA5", "EPA6")) ) diag(vv) <- c(2, 1, 5, 6, 9, 7) vv ## EPA1 EPA2 EPA3 EPA4 EPA5 EPA6 ## EPA1 2 0...
  10. trinker

    How to create a simple list

    What you have is a nested list of lists. So yes that's one way to make a list. ## Your data a <-list(name = "James", Courses = c("Math", "Physics", "Chemistry")) b <- list (name = "Peter", Courses = c("English", "History", "Sociology")) Student_Data = list(a,b) You can access your Courses...
  11. trinker

    Do you use `return`

    @Dason Yihui uses return like I do : https://yihui.name/en/2018/01/stop-early/
  12. trinker

    Replacing all instances of -99 to NA

    You can also set the missing values to NA when you read the data in. How did you get the data into R?
  13. trinker

    How's the new look?

    @quark I dig it...one small thing...when I hover over icons to figure out what they are the text comes up where the cursor is, making the text that pops up unreadable ....Though it's not the same for all computers I use
  14. trinker

    Do you use `return`

    Yeah but to me the return is more readable. Plus they can get nested. There may be 3-5 of these if() return() lines in there. It helps to avoid a bunch of nested if/elses.
  15. trinker

    Do you use `return`

    fun <- function(x, ...){ if (x < 5) return('Low') 'High' } fun(3) ## [1] "Low" fun(8) ## [1] "High"