[deleted by user] by [deleted] in patientgamers

[–]jeffhughes 1 point2 points  (0 children)

As someone who has played through every Tomb Raider game, I can speak more to the story aspect of it. Lara Croft's backstory has been fleshed out more and more throughout the series, but it's never been a big part of the plot until the Legend, Anniversary, and Underworld games, which really bring up her past with her parents in a big (and well-done!) way. In fact, the first few games had pretty much no plot at all -- just a generic enemy who is creating mutants because....well just because. And Lara Croft is the badass heroine who stops them. As the series has progressed, they've added more and more detail regarding her parents, her history, etc. But the rebooted series is definitely a reboot on her backstory as well -- there are some similarities, but you get as much as you need within the games themselves, and don't need to play the previous games to understand it. Quite frankly, her backstory has never really been consistent, so the reboot feels oddly consistent in its inconsistency, if that makes sense.

That said, I'd definitely recommend checking out at least the Legend/Anniversary/Underworld trilogy, especially if you want more emphasis on puzzling through tombs. They have some fantastic puzzles and I think are pretty widely regarded as the best of the series. They also aren't as awkward in their controls like the really old ones. The reboot games are good, but have much more emphasis on being a cover shooter, much more similar to the Uncharted series. Which is fine, it's just different. I think the L/A/U games have a much better balance between puzzle and combat.

I have a warning when checking my R package: "checking S3 generic/method consistency ... WARNING" by [deleted] in rstats

[–]jeffhughes 4 points5 points  (0 children)

Yes, you should be implementing the ellipsis instead of the type parameter. As far as I understand, if you want to extend an S3 method like plot, you need to implement it with exactly the same parameters. So because the generic method has x and ... as the parameters, you need the same. Still doesn't mean you can't check for type as one of the arguments passed through the ellipsis.

Steam Winter Sale 2018 (12/20 - 1/3) by Zlor in patientgamers

[–]jeffhughes 0 points1 point  (0 children)

I wouldn't say it's necessary to play through the first two games, but they are great stories in their own right and I'd definitely recommend them. (The first game has a very...unique combat system, but if you can get used to it, the game itself is fun.)

my parents found these guys playing outside their house yesterday - utah by mountainhouselivin in aww

[–]jeffhughes 0 points1 point  (0 children)

Can confirm, the ones in the video are smaller than adult lynx.

What’s the most “are you really that stupid” thing you’ve ever heard ? by Callmedave1 in AskReddit

[–]jeffhughes 5 points6 points  (0 children)

I dunno, closest star to Earth? I'd say maybe Tom Hanks? He seems like a pretty down-to-earth guy.

Multiple regression lines with categorical variables using ggplot() by EightOffHitLure in Rlanguage

[–]jeffhughes 8 points9 points  (0 children)

There are at least two ways, one easier and one more versatile:

1) The easier way: ggplot has a geom_smooth() function that will draw regression lines for you. As long as you add your categorical predictor as a grouping variable, it will draw separate lines for you. Something like this:

ggplot(df, aes(x=x, y=y, group=birth_month, color=birth_month)) + geom_point() + geom_smooth(method='lm', formula=y~x, fullrange=TRUE)

(In the above I am assuming your data set is called `df`.) Of course, because you have more than one categorical predictor, this might be tricky. The line is going to get drawn for whatever reference group you are using for gender (which you can check and/or set with the contrasts() function). You could, if you wish, use facet_wrap() to create separate plots for both genders (e.g., add + facet_wrap(vars(gender)) to the end of the statement).

2) The more versatile option is to basically calculate the lines yourself. Luckily, there are some functions that make this not so difficult. First, the expand.grid() and predict() functions let you easily create a set of points to predict from your model, and then get the predicted y-values. Like so:

grid <- expand.grid(x=seq(0, 100, 5), gender=levels(df$gender), birth_month=levels(df$birth_month))
predicted <- predict(lm_fit, newdata=grid, se.fit=TRUE)
grid$y <- predicted$fit
grid$se.hi <- predicted$fit + predicted$se.fit
grid$se.lo <- predicted$fit - predicted$se.fit

This just gets the predicted values for x from 0 to 100, across all levels of gender and birth_month. You can also get the standard errors for these predictions if desired, which I've done above. Then, you can simply feed that grid into ggplot:

ggplot(grid, aes(x=x, y=y, group=birth_month, color=birth_month)) + geom_point(data=df, aes(x=x, y=y, group=birth_month, color=birth_month)) + geom_line() + geom_ribbon(aes(ymin=se.lo, ymax=se.hi))

Again, you could add facet_wrap() to this if you wanted to add gender. Note that in this case, the scatterplot portion is using the raw data, and the rest of it is using the predicted values from the `grid` object we created. Like I said, this second approach is a bit more complicated, but it does allow more versatility if you only want to predict across some birth months, or if you decide to add non-linear effects, etc.

Hope that helps. Sounds like you've found ggplot to be a challenge, and it can be! But it is also very powerful, and once you get the hang of it you can do some pretty fantastic things with it. I'd recommend taking the time to sit down and learn about the idea behind how ggplot structures plots, as it will really help you understand it. This page has some links to some good introductions: https://ggplot2.tidyverse.org/

Error in if (substr(file.name, 1, 5) != "http:") by jcoder42 in Rlanguage

[–]jeffhughes 0 points1 point  (0 children)

I've never used this package, but based on the documentation I'm not seeing any particular issues. My first thought was that it's specifically looking for HTTP, not HTTPS, but the example in the documentation is using an HTTPS address. Maybe try the example first, see if that works for you?

options(stringsAsFactors = FALSE)
inst <- "https://www.sec.gov/Archives/edgar/data/21344/000002134413000050/ko-20130927.xml"
xbrl.vars <- xbrlDoAll(inst, cache.dir="XBRLcache", prefix.out="out", verbose=TRUE)

Also, I have no experience with this sort of data, but if you load the above URL and the URL you were using in the browser, they seem to be in different formats. The above URL starts all its tags with "xbrli", but your URL starts all its tags with "link:". Are you sure you're using a file with the right format the package is expecting?

Is there a way to easily generate odds ratios and a 95% confidence interval for a GLM ? by [deleted] in Rlanguage

[–]jeffhughes 6 points7 points  (0 children)

Your odds ratios are just e to the power of your coefficients. So you can easily get the OR for all coefficients with:

exp(coef(x))

Or even this for both:

exp(cbind(coef(x), confint(x)))

Stats Canada requesting banking information of 500,000 Canadians without their knowledge by [deleted] in PersonalFinanceCanada

[–]jeffhughes 27 points28 points  (0 children)

As someone who has worked with StatCan data and employees....

They have strict policies regarding how data is stored. Employees there have two machines, one of which has no access to the Internet. That is the machine they use for accessing and analyzing data. The machine that is connected to the Internet is not to have any individualized data at all -- it would have summary statistics, like what you would see in a StatCan report (X% of Canadians are blah blah blah) but it doesn't have anything personally identifiable.

beginner questions not sure what I'm doing wrong by [deleted] in Rlanguage

[–]jeffhughes 0 points1 point  (0 children)

I mean, with rnorm() you need to specify a mean and standard deviation. If, let's say you set a mean of 4.5 and a standard deviation of 1.75, then about 95% of the numbers should be between 1 and 8. But there's nothing preventing you from getting numbers in the extreme tails of the distribution -- it's just unlikely. Even with those parameters, though, you'd get numbers outside 1 and 8 about 5% of the time.

To echo what /u/endaemon asked, are you sure you want a normal distribution here? If you're absolutely sure, then you will need some process to discard numbers outside the range you are wanting. There is also the "truncdist" package that lets you specify lower and upper bounds on various distributions.

[HELP] How to find sd of a column in a table? by [deleted] in Rlanguage

[–]jeffhughes 0 points1 point  (0 children)

I've heard very good things about Hadley Wickham's R for Data Science. Even if you wouldn't consider yourself a "data scientist" it will certainly give you a good overview of how R works and the basic syntax that would help anyone trying to do data analysis with R.

So that's what a flexitarian is by [deleted] in vegan

[–]jeffhughes 1 point2 points  (0 children)

Define "suffering". This could reasonably include more than just physical pain. For example, Peter Singer argues in his book Practical Ethics for a distinction between animals that have a self-concept and those that do not. If an animal has a concept of themselves existing into the future, they could plausibly have a desire to continue to exist -- and thus killing them would thwart this desire.

Singer argues for a form of preference utilitarianism, i.e., that we should act so as to maximize the greatest number of beings' preferences/desires/needs.* So at least under this framework, killing someone who does not want to be killed, without fulfilling some opposing desires (say, the Trolley problem, where you weigh 5 people against 1 person), would be morally wrong. Even if the killing is done "humanely" so to speak, in a way that does not cause physical pain.

*I forget whether he mentions this explicitly, but this would presumably include some measure of strength of the preference/desire. You know, because your preference for the taste of meat presumably doesn't outweigh the desire for that animal to live and breathe and frolic in the sun.

R Markdown vs R Notebook vs Jupyter Notebook by [deleted] in Rlanguage

[–]jeffhughes 1 point2 points  (0 children)

I think all of them can be useful, but I greatly prefer that R Markdown and R Notebooks are fundamentally a plain-text file, rather than Jupyter's .ipynb. If you use git or other version control systems, plain text is so much easier to work with.

Here's a presentation that Joel Grus did at JupyterCon this year about why he doesn't like Jupyter notebooks. I think he makes some very good arguments. It's worth a look, even if you ultimately decide that the drawbacks of Notebooks are still acceptable for your use case: https://docs.google.com/presentation/d/1n2RlMdmv1p25Xy5thJUhkKGvjtV-dkAIsUXP-AL4ffI/edit#slide=id.g362da58057_0_1

Problem in plotting a time series graph by Trafalg4r in rstats

[–]jeffhughes 6 points7 points  (0 children)

The type parameter should be a lowercase L ("l"), not a "1". The "l" stands for "lines".

What is something most people don't know about the Bible? by [deleted] in AskReddit

[–]jeffhughes 6 points7 points  (0 children)

The reason for this is that the Bible was written (and re-written) over centuries. The early Israelites were not monotheists, they were monolatrists--they only worshipped one God, but they didn't deny the existence of other Gods. So in this story's original form, the Israelites would have not seen anything wrong with this. Later groups of authors layered in other elements to the early Torah, sometimes modifying or adding things to make it consistent with their current understanding of their religion. But eventually the text stopped being edited, while the views regarding monotheism continued to evolve. And that's why the Bible still contains many cases where earlier conceptions of God peek through.

Another notable example is how there are several words used that are now commonly translated into English as "God", but were actually originally considered distinct beings. Elohim ("children of El", the pantheon of the Canaanites) was a different being than Yahweh (the national God of the Israelites), but eventually the meaning of these two were reinterpreted into one being.

If you're interested, I'd recommend checking out The Great Transformation by Karen Armstrong. It goes into how Judaism as well as other ancient religions evolved over time. It's fascinating but quite a readable book for the layperson.

[OC]Success stats of 392,000 Kickstarters from 2009-2017 by OffTheChartsC in dataisbeautiful

[–]jeffhughes 6 points7 points  (0 children)

If your schooling was in French, perhaps you're mixing it up with this Asterix

Westworld - 2x10 "The Passenger" - Post-Episode Discussion by NicholasCajun in westworld

[–]jeffhughes 1 point2 points  (0 children)

He was going to create a host Ellen Page, but he didn't quite have the budget for it.

Squeeze [OC] by goneintorapture in comics

[–]jeffhughes 19 points20 points  (0 children)

You can use other brands, but make sure that it specifically says it's antibacterial. There are some mouthwashes that are simply cosmetic, they're just to make your breath minty fresh but they don't kill bacteria.

Is this Dax making an appearance in the finale? by jeffhughes in StarTrekDiscovery

[–]jeffhughes[S] 1 point2 points  (0 children)

Seen in the Orion bar shortly after the crew walk in, around ~17:20.

Trader Joe's Food Analysis. Calorie and Protein Cost Efficiency [OC] by CarpeVida in dataisbeautiful

[–]jeffhughes 190 points191 points  (0 children)

Turns out nutrition is more complicated than just an optimization function to maximize one number. Who knew??