|
Post by greeme on Dec 22, 2020 12:09:35 GMT -8
one team for habes and one for howard? zero starting in feb objection
|
|
|
Post by greeme on Dec 22, 2020 12:09:57 GMT -8
|
|
|
Post by Stevie B on Dec 22, 2020 12:11:02 GMT -8
Pretty much everyone has been inactive. We all feed off of each other
|
|
|
Post by insane on Dec 22, 2020 12:11:19 GMT -8
Pretty much everyone has been inactive. We all feed off of each other GTFO
|
|
|
Post by Stevie B on Dec 22, 2020 12:11:47 GMT -8
Pretty much everyone has been inactive. We all feed off of each other GTFO Play PMs me more than he posts smfh
|
|
|
Post by insane on Dec 22, 2020 12:13:06 GMT -8
Play PMs me more than he posts smfh is morey about to get harden for u guys
|
|
|
Post by Lasagna and tears of failure on Dec 22, 2020 12:13:41 GMT -8
Pretty much everyone has been inactive. We all feed off of each other I post shitty articles and people dont vote, I post shitty posts and I also post amazing code that no one uses
|
|
|
Post by Stevie B on Dec 22, 2020 12:13:41 GMT -8
Play PMs me more than he posts smfh is morey about to get harden for u guys i hope so. I’m not sure I can watch another game where Ben passes up an open jumper
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 22, 2020 12:13:51 GMT -8
Pretty much everyone has been inactive. We all feed off of each other Gtfo
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 22, 2020 12:14:23 GMT -8
Pretty much everyone has been inactive. We all feed off of each other I post shitty articles and people dont vote, I post shitty posts and I also post amazing code that no one uses Vote on my shitty article
|
|
|
Post by Lasagna and tears of failure on Dec 22, 2020 12:15:42 GMT -8
I post shitty articles and people dont vote, I post shitty posts and I also post amazing code that no one uses Vote on my shitty article that's like asking "do bears shit in the woods?" cause I already have, I vote on 98% of all articles, occasionally I miss one though
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 22, 2020 12:16:13 GMT -8
Ok
|
|
|
Post by the original michael on Dec 22, 2020 12:33:42 GMT -8
|
|
|
Post by nybombers3 on Dec 22, 2020 12:34:56 GMT -8
Pretty much everyone has been inactive. We all feed off of each other I post shitty articles and people dont vote, I post shitty posts and I also post amazing code that no one uses I tried it but didn't work for me but I'm sure I did something wrong. Ill try it again when I get the chance.
|
|
|
Post by hf on Dec 22, 2020 12:35:42 GMT -8
How about the Timberwolves!!!
|
|
|
Post by Lasagna and tears of failure on Dec 22, 2020 12:36:35 GMT -8
I post shitty articles and people dont vote, I post shitty posts and I also post amazing code that no one uses I tried it but didn't work for me but I'm sure I did something wrong. Ill try it again when I get the chance. did the old code work for you? if so I have updated it again and need to post the code that fixes the per 36 too
|
|
|
Post by Lasagna and tears of failure on Dec 22, 2020 12:37:19 GMT -8
I post shitty articles and people dont vote, I post shitty posts and I also post amazing code that no one uses I tried it but didn't work for me but I'm sure I did something wrong. Ill try it again when I get the chance. also I added some functions that spells out exactly what to do as it has 3 teams in it now so you can see what needs to change
|
|
|
Post by nybombers3 on Dec 22, 2020 12:38:28 GMT -8
I tried it but didn't work for me but I'm sure I did something wrong. Ill try it again when I get the chance. did the old code work for you? if so I have updated it again and need to post the code that fixes the per 36 too Yeah the old one worked. I'm sure I just did something wrong.
|
|
|
Post by Lasagna and tears of failure on Dec 22, 2020 12:41:24 GMT -8
did the old code work for you? if so I have updated it again and need to post the code that fixes the per 36 too Yeah the old one worked. I'm sure I just did something wrong. it's only copy paste... so... unless I pasted the code wrong... but the new functions are easier to update
|
|
|
Post by Lasagna and tears of failure on Dec 22, 2020 12:42:06 GMT -8
did the old code work for you? if so I have updated it again and need to post the code that fixes the per 36 too Yeah the old one worked. I'm sure I just did something wrong. rm(list=ls()) options(stringsAsFactors = FALSE) options(digits=3) library('rvest')
path <- "https://bballsim2020.com/"
# ADD YEAR PLUS / FOR PAST SEASONS
teams <- c("Celtics", "Heat", "Nets", "Knicks", "Magic", "76ers", "Wizards", "Hawks", "Hornets", "Bulls", "Cavaliers", "Pistons", "Pacers", "Bucks", "Raptors", "Mavericks", "Nuggets", "Rockets", "Timberwolves", "Spurs", "Jazz", "Grizzlies", "Warriors", "Clippers", "Lakers", "Suns", "Trail Blazers", "Kings", "SuperSonics")
colMax <- function(data) sapply(data, max, na.rm = TRUE)
get_player_stats <- function(player, team, start=1, end=200, per36=2){
stats <- c()
for(i in 1:length(team)){ index <- which(team[i] == teams) url <- paste(path, "/rosters/roster", index, "sched.htm", sep="") webpage <- read_html(url) links <- html_attr(html_nodes(webpage, "a"), "href") links <- links[10:(length(links)-1)]
for(j in 1:length(links)){ url <- paste(path, substr(links[j], 3, nchar(links[j])), sep="") day <- as.numeric(substr(url, gregexpr("boxes/", url)[[1]][1]+6, gregexpr("-", url)[[1]][1]-1))
if(day >= start & day <= end){ full_box <- html_table(read_html(url), header=TRUE, fill=TRUE)
if(colnames(full_box[[2]])[1] == team[i]){ my_team_index <- 2 opp_team_index <- 3 } else{ my_team_index <- 3 opp_team_index <- 2 }
box <- full_box[[my_team_index]] box_team <- box[1:(nrow(box)-2), 1:(ncol(box)-1)] box_team[,3:16] <- lapply(box_team[,3:16], as.numeric) colnames(box_team)[6:7] <- c("X3P", "X3PA") if(colnames(box_team)[1] == team[i]){ index <- which(box_team[,1] == player) if(length(index) > 0){ colnames(box_team)[1] <- "Team" stats <- rbind(stats, box_team[index,]) } } } } }
if(is.null(stats)){ cat("No stats found.\n") } else if(nrow(stats) == 0){ cat("No stats found.\n") } else{
stats <- cbind.data.frame(GM=nrow(stats), stats[, 3:16])
cat("AVERAGES\n") averages <- colMeans(stats)
print(round(averages, digits=1))
if(per36 == 1){ cat("PER 36\n") constant <- (36 / averages[2]) for(i in 2:length(averages)){ averages[i] <- constant * averages[i] } print(round(averages, digits=1)) }
cat("PERCENTAGES\n") print(c(sum(stats$FG) / sum(stats$FGA), sum(stats$X3P) / sum(stats$X3PA), sum(stats$FT) / sum(stats$FTA))) } }
get_team_stats <- function(start=1, end=200, per36=2){ team_N <- "Celtics" player_N <- c("Michael Kidd-Gilchrist", "Otto Porter","DeJuan Blair" ,"Ronny Turiaf", "Mason Plumlee" , "John Henson" , "Marko Todorovic" , "Mike Scott" , "Chandler Parsons" , "Dennis Schroder", "Paccelis Morlende")
for (i in player_N) { print(i) get_player_stats(i, team_N , start , end, per36) cat("\n") cat("\n") }
}
get_king_stats <- function(start=1, end=200, per36=2){ team_N <- "Kings" player_N <- c("Rudy Gobert", "Josh Boone","Ben Wallace" ,"Andre Roberson", "P.J. Tucker" , "Thabo Sefolosha" , "Thaddeus Young" , "O.J. Mayo" , "Will Barton" , "Archie Goodwin", "J.J. Barea")
for (i in player_N) { print(i) get_player_stats(i, team_N , start , end, per36) cat("\n") cat("\n") }
}
get_brazs_stats <- function(start=1, end=200, per36=2){ team_N <- "Raptors" player_N <- c ("Draymond Green", "Chris Kaman" ,"Donatas Montiejunas" , "Samardo Samuels", "Boris Diaw" , "Kyrie Irving" , "Samuel Dalembert" )
for (i in player_N) { print(i) get_player_stats(i, team_N , start , end, per36) cat("\n") cat("\n") }
}
|
|
|
Post by the original michael on Dec 22, 2020 12:42:12 GMT -8
Pick up the sim and drop it right on my nuts
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 22, 2020 12:57:05 GMT -8
|
|
|
Post by Lasagna and tears of failure on Dec 22, 2020 12:57:35 GMT -8
Pick up the sim and drop it right on Mike's nuts
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 22, 2020 12:58:47 GMT -8
Ok
|
|
|
Post by Lasagna and tears of failure on Dec 22, 2020 12:59:05 GMT -8
got my XMas sweater yesterday
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 22, 2020 13:00:35 GMT -8
Damn you're hot
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 22, 2020 13:00:55 GMT -8
Imagine voting one on an article and never writing an article
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 22, 2020 13:01:29 GMT -8
Can I get yo numba
|
|
|
Post by Nanz on Dec 22, 2020 13:04:04 GMT -8
|
|
JR
Wait List
Wait List
Posts: 38,037
|
Post by JR on Dec 22, 2020 13:08:00 GMT -8
Taking a shit and it smells like baby shit oof
|
|