Displaying 20 results from an estimated 106 matches for "baseball".
2009 Apr 02
1
calculating drop1 R^2s
...es of linear models where each
term is dropped in turn. I can get the
RSS from drop1(), and the r.squared from summary() for a given model,
but don't know how to use the
result of drop1() to get the r.squared for each model with one term dropped.
Working example:
library(vcd) # for Baseball
library(car) # for vif/recode
data(Baseball)
# sal87 appears as a factor because missing is coded as '.' rather than NA
Baseball$sal87 <- as.numeric(recode(Baseball$sal87, "'.'=NA"))
Baseball$logsal <- log(Baseball$sal87)
base.mod <- lm(logsal ~ years+at...
2009 Sep 25
2
summarize-plyr package
Hi,I am using the amazing package 'plyr". I have one problem. I would
appreciate help to fix the following error: Thanks.
______________________________
> library(plyr)
> data(baseball)
> summarise(baseball,
+ duration = max(year) - min(year),
+ nteams = length(unique(team)))
Error: could not find function "summarise"
> ddply(baseball, "id", summarise,
+ duration = max(year) - min(year),
+ nteams = length(unique(team)))
Error in llply(.data = .data, .fun...
2006 May 02
4
ordering after a inject
...result = find_by_sql(sql)
count = result.inject({}) { |hsh, row| hsh[row[''name'']] =
row[''count''].to_i; hsh }
count
end
The "result" is in the proper alpha order:
=> [#<Tag:0x3606ab0 @attributes={"name"=>"baseball", "count"=>"2"}>,
#<Tag:0x360
6a68 @attributes={"name"=>"name", "count"=>"29"}>, #<Tag:0x3606900
@attributes={
"name"=>"new", "count"=>"3"}>, #<Tag:0x36065b8 @at...
2020 Oct 02
3
Lahman Baseball Data Using R DBI Package
I?m trying to pull data from one table (batting) in the Lahman Baseball database. Notice X2B for doubles and X3B for triples ? fourth and fifth from the right.
The dbGetQuery function runs fine when I leave there two out but I get error messages (in red) when I include 2B/3B or X2B/X3B.
Can anyone give me some direction?
Thanks,
Philip Heinrich
******************...
2020 Oct 03
1
Lahman Baseball Data Using R DBI Package
...at cox.net> wrote:
> The \?2B\? worked. Have no idea why. Can you point me somewhere that can
> explain this to me.
>
> Thanks,
> Philip
>
> *From:* Bill Dunlap
> *Sent:* Friday, October 2, 2020 3:54 PM
> *To:* Philip
> *Cc:* r-help
> *Subject:* Re: [R] Lahman Baseball Data Using R DBI Package
>
> Have you tried putting double quotes around 2B and 3B: "...2B, 3B, ..."
> -> "...\"2B\",\"3B\",..."?
>
> -Bill
>
> On Fri, Oct 2, 2020 at 3:49 PM Philip <herd_dog at cox.net> wrote:
>
>> I?m...
2008 Apr 14
7
[Bug 15495] New: does not render ESPN baseball gamecast correctly
http://bugs.freedesktop.org/show_bug.cgi?id=15495
Summary: does not render ESPN baseball gamecast correctly
Product: swfdec
Version: unspecified
Platform: Other
OS/Version: All
Status: NEW
Severity: normal
Priority: medium
Component: plugin
AssignedTo: swfdec at lists.freedesktop.org
Report...
2020 Oct 08
0
Lahman Baseball Data Using R DBI Package
...alized by now that R doesn't like column names that
start with a number. If you try to access an 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 "Ha...
2012 May 25
1
Correlograms: using boxes and different variables on rows and columns
I'm trying to make correlograms using corrgram. See below for a simple
example.
####
library(corrgram)
data(baseball)
vars1 <- c("Assists","Atbat","Errors","Hits","Homer","logSal")
vars2 <- c("Putouts","RBI","Runs","Walks","Years")
corrgram(baseball[,vars2],lower.panel=panel.shade, upper.panel=pane...
2020 Oct 08
1
Lahman Baseball Data Using R DBI Package
...9;t like column names that
> start with a number. If you try to access an 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: unexpecte...
2006 Sep 29
3
What is wrong with this input
...I know is there.
Thanks in advance
> library(foreign)
> hrout <- read.spss("c:\\hrab200.sav")
Error in read.spss("c:\\hrab200.sav") : unable to open file
> library(foreign)
> hrout <- read.spss("C:\Documents and Settings\David Kaplan\My
Documents\Baseball\Baseball Research\hr time series paper\new time
series hr paper\hrab200.sav")
Error in read.spss("C:Documents and SettingsDavid KaplanMy
DocumentsBaseballBaseball Researchhr time series paper\new time series
hr paperhrab200.sav") :
unable to open file
> library(foreig...
2006 Jan 13
2
newbie: access model inside a model
Hi everybody,
I''ve started to learn Ruby on Rails with the two books, of course I''m
experimenting outside
the examples in the book and walking against some things I didn''t learn
yet. so here''s the question:
Is it possible to access one model from within another? Actually I have
a Many to Many relationship
between tables and I''m trying to realize
2009 Nov 28
2
Orphaned R Packages (maybe this is too inside baseball?)
How do the R "powers that be" handle packages that are orphaned from CRAN?
Recently, I was looking for a function either part of the base functionality or an add-on package that mimicked the "poly" functionality from Octave (http://n4.nabble.com/Re-R-function-that-duplicates-Octave-s-poly-function-td901174.html)
Based on that post a helpful R user strongly encouraged me
2003 Nov 01
3
authentication question: pptp tunnels for cisco vpn 3000
...LDAP back end.
Anyway, I setup the VPN Concentrator to auth off of the samba box, and
when I test it with the test option, and it works, but when I try to
auth a pptp tunnel, it fails saying the password is wrong. Any ideas?
My vote is for the stupid concentrator to meet some thermite or a metal
baseball batt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba/attachments/20031031/3027eb72/attachment.bin
2001 Apr 15
5
User authentication tracing
Is it possible to trace Samba authenticated user?
That is, after a user has been authenticated versus a Samba acting
as PDC, is it possible to know if such user is still connected to the
Microsoft
network or they have been disconnected?
What I would like to do is to use Samba as authentication server in
order
to grant the access to other services (for example Internet navigation
through a proxy)
2012 Apr 19
2
Study design question; MLB; pay and performance.
Dear List Members,
I am in the process of designing a study examining pay and performance
in Major League Baseball across several seasons, and before I get too
deeply into it, I'd like to ask whether the group members think that
performance across seasons is independent, or if it needs to be treated
like a time-series variable so that lack of independence can be controlled.
Any ideas or considerations t...
2010 Aug 19
1
Correlograms and linear regression
Dear all,
I generated a Correlograms and used the panel.ellipse (confidence ellipse
and smoothed line) option. Is there a way to get instead of the smoothed
line the linear regression?
Thanks,
As hz
--
View this message in context: http://r.789695.n4.nabble.com/Correlograms-and-linear-regression-tp2331071p2331071.html
Sent from the R help mailing list archive at Nabble.com.
2007 Sep 07
3
Plotting lines to sets of points
I am using R to plot baseball spray charts from play-by-play data. I have
used the following command to plot the diamond:
plot (0:250, -250:0, type="n", bg="white")
lines(c(125,150,125,100,125),c(-210,-180,-150,-180,-210), col=c("black"))
I have also plotted different hit locations using command...
2010 Aug 26
3
Help with ddply to eliminate a for..loop
...quot;id" represents
repeated observations over "time" and I want to scale the "slope"
variable. The "out" variable shows the output I want. My for..loop
does the job but is probably very slow versus other methods. ddply
seems ideal, but despite playing with the baseball examples quite a bit
I can't figure out how to get it to work with my sample dataset.
TIA for any help, Roger
Here is the sample code:
dat <- data.frame(id=rep(letters[1:5],3),
time=c(rep(1,5),rep(2,5),rep(3,5)), slope=1:15)
dat
for (i in 1:3) {
mat <- dat[dat$time==i, ]
out...
2006 Feb 23
2
Working with lists with numerical names
Greetings!
I'm have a hard time 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...
2006 Mar 07
6
Can Ruby and PHP play nice together?
I''m busy trying to bang out a new version of the website for my fantasy
baseball league (www.ibl.org) and I''m torn as to what to do. I''m a PHP
coder by day (Zend Certified and everything) but like Rails too.
Now, the site is morphing into a "blog plus tools for league members"
site. A lot of those tools are already written in PHP and I don'&...