Search results

1. 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. Submission of package to CRAN: problem grasping an Error

@giam Did you ever solve this?
3. 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. 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. Today I Learned: ____

@jamesmartinn Nice. Do you have the source code for this available that you'd be willing to share?
6. 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. 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. [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. 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. 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. Do you use return

@Dason Yihui uses return like I do : https://yihui.name/en/2018/01/stop-early/
12. 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. 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. 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. Do you use return

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

I use it in an if statement to keep it one line rather than an else
17. Monte Carlo Simulation for Predicting Agile Stories Completed

A team at work saw this post on using MC for predicting a forcast of stories completed: http://scrumage.com/blog/2015/09/agile-project-forecasting-the-monte-carlo-method/ I have a series of questions as I know of Monte Carlo Simulation but have not used them. 1. Is the basic gist: Get mean and...
18. How do I read github csv into R?

Let's say I got a csv on GitHub how do I read it into R?
19. Math notation break set into n length groups

I have a vector of length 26 and want to split it into groups of length 5. I can write it in code but what's the math notation for breaking a set up into n length groups keeping the elements consecutively ordered? Using what Bryan Goodrich wrote here...
20. Confidence intervals for proportions: approximating a discrete distribution with a co

I saw on this website http://onlinestatbook.com/2/estimation/proportion_ci.html The following quote about calculating a CI for a proportion: Giving: p \pm Z_{.95}\sqrt{\frac{p(1-p)}{N}} \pm \frac{.5}{N} Where (it appears) N is the sample size. Another website...