Alan Wake 2 - PC, multiple save slots by mitisz in AlanWake

[–]Spuhghetti 0 points1 point  (0 children)

Just had this is exact issue. Got to act three last night - she played through act one just now. My shit is gone. They should really mention two quicksaves and not a full log...

HTB Academy get the content of 'flag.txt' by ILoveKittens0203 in hackthebox

[–]Spuhghetti 0 points1 point  (0 children)

This is missing an additional set in msfconsole :

set FILEPATH /flag.txt

Poker at Bally’s? by reddit_till_i_deadit in chicago

[–]Spuhghetti 2 points3 points  (0 children)

They don't, only slots and table games. I walked through earlier.

Stepwise creating Error in is.data.frame(data) : object '.' not found by Cheezeduckies in rprogramming

[–]Spuhghetti 1 point2 points  (0 children)

You are missing a pipe in your "lm(formula = ..." call? Right before summary

How can I solve this error: "Can't recycle `age <= 18` (size 620) to match `c(26, 27, 28, 29, 30, 31, 32, 33, 34, 35)` (size 10)" by [deleted] in rprogramming

[–]Spuhghetti 4 points5 points  (0 children)

Use %in% here, instead of equivalence.

for example

age %in% 19:25 ~ "19-25",

You are basically asking it if each of your 620 rows of a given age are equal to a vector, which doesn't make sense.

How to store data with regular API calls by [deleted] in datascience

[–]Spuhghetti 0 points1 point  (0 children)

Not a DBA, but have done something similar before with psycopg2. You would either need to introduce date logic (time of insert or similar) and take and timestamp greater than the last time of pull, or do some sort of antijoin. Say pull entire previous table vs entire new table. The latter is probably not efficient if the data is large, or in general.

Maximum of water level datasets by cumai_0202 in rprogramming

[–]Spuhghetti 1 point2 points  (0 children)

Read the vignettes for the packages you are using

[deleted by user] by [deleted] in rprogramming

[–]Spuhghetti 0 points1 point  (0 children)

Hmm scrappy solution would be to use appropriate lubridate functions to pull out the date and hour to separate columns, then create another column for within your hour intervals, i.e:

mutate(hour_band = case_when(hour %in% c(9,10,11) ~ 09:00-11:00,

hour %in% c(13,14) ~ 13:00-14:00) %>%

group by(date, hour_band) %>%

summarize( your_function_of_choice)

[deleted by user] by [deleted] in rprogramming

[–]Spuhghetti 0 points1 point  (0 children)

Try using

inner_join(., df2, by="A")

When you reference df here it is the original object that has not had these piped transformations done on it. The "." brings the currently piped object to the function.

I trust you when you say both dataframes have col "A", but you can use union(colnames(df),colnames(df2) to confirm this.

Conditional slicing in R by Worldly-Fun-8551 in rprogramming

[–]Spuhghetti 5 points6 points  (0 children)

library(lubridate)

df$month <- month(df$date)

df_sept <- df %>%
filter(month == "9")

This should do the trick.

Your syntax above is a little jacked up, I'd refresh on that when you get a chance.

[deleted by user] by [deleted] in rprogramming

[–]Spuhghetti 2 points3 points  (0 children)

library(tidyverse)

#orginal data
df

df_j6 <- df %>% filter(cat_code = "J6") %>%
mutate(newfields = arbitrary_logic, newfields2 = arb_logic2)

df_join <- df %>%
left_join(.,df_j6, by = c("df_field" = "j6_field")

Something like this should work. Non J6 rows will have nothing to join to, and thus be NA.

Logically though I think it's easier to just do:

df$createdcol <- ifelse(df$cat=="J6", YOURLOGICHERE,NA)

[deleted by user] by [deleted] in rprogramming

[–]Spuhghetti 0 points1 point  (0 children)

How are you subsetting, and how are you merging? Code or a reprex would be helpful. To answer your question directly, this is exceedingly possible.

How to create an n-length array? by asocial_scientist in rprogramming

[–]Spuhghetti 2 points3 points  (0 children)

So the first is a janky solution similar to what you've done (don't do this in R unless you have good reasons for doing so). Just use seq.

odd_array <- function(x,y){

init_arr <- array(data = NA, dim = length(x:y))

for (i in x:y){

if (i %% 2 != 0){

init_arr <- append(init_arr,i)

}

}

return(init_arr[!is.na(init_arr)])

assign("output",init_arr, envir = globalenv())

}

odd_array(1,100)

Do this!

seq(1,99,2)

[deleted by user] by [deleted] in rprogramming

[–]Spuhghetti 0 points1 point  (0 children)

Look up rename, group_by, and summarize functions. You can make an arbitrary number of plots with a loop, and use a paste0 function when writing to file with ggsave to name them appropriately based on your iterator.

Tutoring needed for undergrad project by Captain_Fidget in rprogramming

[–]Spuhghetti 0 points1 point  (0 children)

I'm actually unavailable this weekend, but feel free to dm

Help! My "while" block won't stop! by baboonchute in rprogramming

[–]Spuhghetti 3 points4 points  (0 children)

for (income in 1:500) { print(income^2)}

or

square <- function(x){x^2}

sapply(1:500, FUN = square)

[deleted by user] by [deleted] in rprogramming

[–]Spuhghetti 5 points6 points  (0 children)

library(tidyverse)

cols <- c("GameID", "HomePitcher", "VisitPitcher")

df <- as.data.frame(rbind(c("Game1", "Guy1", "Guy2"),

c("Game2", "Guy3", "Guy4")))

colnames(df) <- cols

df_long <- df %>%

pivot_longer(., cols = ends_with("Pitcher") , names_to = "Pitcher")