search for: yearid

Displaying 10 results from an estimated 10 matches for "yearid".

2009 Dec 02
2
Extracting vectors from a matrix (err, I think) in RMySQL
I have a query which returns a data set like so: > salaries yearID POS pct 1 2009 RF 203 2 2009 DH 200 3 2009 1B 198 4 2009 3B 180 5 2009 LF 169 6 2009 SS 156 7 2009 CF 148 8 2009 2B 97 9 2009 C 86 10 2008 DH 234 11 2008 1B 199 12 2008 RF 197 13 2008 3B 191 14 2008 SS 180 15 2008 CF 164 16 2008 LF 156 17...
2020 Oct 03
1
Lahman Baseball Data Using R DBI Package
...;> Philip Heinrich >> >> *************************************************************************************************************************************************** >> tail(dbReadTable(Lahman,"batting")) >> >> ID playerID yearID stint teamID team_ID >> lgID G G_batting AB R H X2B X3B HR RBI SB >> 107414 107414 yastrmi01 2019 1 SFN 2920 >> NL 107 NA 371 64 101 22 3 21 >> 55 2 >> 107416 107416 ye...
2020 Oct 08
0
Lahman Baseball Data Using R DBI Package
...R-dataframe column named 2B or 3B with the familiar "$" notation, you'll get an error: > library(DBI) > library(RSQLite) > con2 <- dbConnect(SQLite(), "~/R_Dir/lahmansbaseballdb.sqlite") > Hack12Batting <- dbGetQuery(con2,"SELECT * FROM batting WHERE yearID = 2018 AND AB >600 ORDER BY AB DESC") > Hack12Batting$AB [1] 664 661 639 632 632 632 626 623 620 618 617 613 606 605 602 > Hack12Batting$3B Error: unexpected numeric constant in "Hack12Batting$3" How to handle? You can rename columns on-the-fly by piping. See reference [1]...
2020 Oct 08
1
Lahman Baseball Data Using R DBI Package
...; 2B or 3B with the familiar "$" notation, you'll get an error: > > > library(DBI) > > library(RSQLite) > > con2 <- dbConnect(SQLite(), "~/R_Dir/lahmansbaseballdb.sqlite") > > Hack12Batting <- dbGetQuery(con2,"SELECT * FROM batting WHERE yearID = > 2018 AND AB >600 ORDER BY AB DESC") > > Hack12Batting$AB > [1] 664 661 639 632 632 632 626 623 620 618 617 613 606 605 602 > > Hack12Batting$3B > Error: unexpected numeric constant in "Hack12Batting$3" > > How to handle? You can rename columns on-th...
2009 Dec 03
2
Formatting of numbers on y axis
Hello all. I have the following: plot(salaries$yearID, salaries$salary, type='n', xaxt='n', xlab='', yaxt='n', ylab='') axis(1, at=unique(salaries$yearID), labels=unique(salaries$yearID), lwd=.25, tck=-0.05) axis(2, axTicks(2), format(axTicks(2), scientific = F)) Which nicely creates the Y axis with the raw num...
2020 Oct 02
3
Lahman Baseball Data Using R DBI Package
...X3B. Can anyone give me some direction? Thanks, Philip Heinrich *************************************************************************************************************************************************** tail(dbReadTable(Lahman,"batting")) ID playerID yearID stint teamID team_ID lgID G G_batting AB R H X2B X3B HR RBI SB 107414 107414 yastrmi01 2019 1 SFN 2920 NL 107 NA 371 64 101 22 3 21 55 2 107416 107416 yelicch01 2019 1 MIL...
2006 Feb 23
2
Working with lists with numerical names
...working with some data I imported from a baseball database. Several of the database columns have numbers in them (2B, 3B), and when I try to use these vectors from the data frame, I get syntax errors, probably because it's interpreting the name as a number: > show(batting2005) playerID yearID stint teamID lgID G AB R H 2B 3B HR RBI SB CS BB 1 robleos01 2005 1 LAN NL 110 364 44 99 18 1 5 34 0 8 31 2 iguchta01 2005 1 CHA AL 135 511 74 142 25 6 15 71 15 5 47 3 molinya01 2005 1 SLN NL 114 385 36 97 15 1 8 49 2 3 23...
2009 Dec 02
0
Stacked bar chart help.
Can't figure this out. I have the following list of salary averages per year, per position. The dput output is: > dput(salaries) structure(list(yearID = c(2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008, 2008), AVG = c(8956855.61, 7886684.166126, 7534048.43102, 7406439.339471, 7219148.437934, 6697734.908336, 6400379.88398, 3765720.093796, 3630731.367928, 9022895.226432, 8441165.305623, 8102876....
2006 Apr 05
7
Archive monthly count for blog
I am creating a blog to learn ruby on rails. from the layout page i pass all the posts as a collection to _archive.rhtml <%= render :partial => "archive", :collection => @archive %> On _archive.rhtml i have access to the collection. I am then gone to render partial another page _archivecount.rhtml to display the number of posts for each month. Can anyone give a clue
2014 Aug 26
1
no visible binding for global variable for data sets in a package
I'm updating the Lahman package of baseball statistics to the 2013 release. In addition to the main data sets, the package also contains several convenience functions that make use of these data sets. These now trigger the notes below from R CMD check run with Win builder, R-devel. How can I avoid these? * using R Under development (unstable) (2014-08-25 r66471) * using platform: