In this project, you’re given a text file with chess tournament results where the information has some structure. Your job is to create an R Markdown file that generates a .CSV file (that could for example be imported into a SQL database) with the following information for all of the players: Player’s Name, Player’s State, Total Number of Points, Player’s Pre-Rating, and Average Pre Chess Rating of Opponents For the first player, the information would be: Gary Hua, ON, 6.0, 1794, 1605 1605 was calculated by using the pre-tournament opponents’ ratings of 1436, 1563, 1600, 1610, 1649, 1663, 1716, and dividing by the total number of games played. If you have questions about the meaning of the data or the results, please post them on the discussion forum. Data science, like chess, is a game of back and forth… The chess rating system (invented by a Minnesota statistician named Arpad Elo) has been used in many other contexts, including assessing relative strength of employment candidates by human resource departments. You may substitute another text file (or set of text files, or data scraped from web pages) of similar or greater complexity, and create your own assignment and solution. You may work in a small team. All of your code should be in an R markdown file (and published to rpubs.com); with your data accessible for the person running the script.
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.4.4 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readr)
library(stringr)
library(jsonlite)
##
## Attaching package: 'jsonlite'
##
## The following object is masked from 'package:purrr':
##
## flatten
We will be begin by loading the dataset into a data frame that we will call chess_data
github_raw <- "https://github.com/Zcash95/DATA607-Project1/blob/main/tournamentinfo.txt"
chess_data <- read.delim(github_raw, header = TRUE, sep = "|", fill = TRUE)
## Warning in read.table(file = file, header = header, sep = sep, quote = quote, :
## incomplete final line found by readTableHeader on
## 'https://github.com/Zcash95/DATA607-Project1/blob/main/tournamentinfo.txt'
head(chess_data)
## [1] X.payload..allShortcutsEnabled.false.fileTree....items...name.DATA607.PROJECT1.Rmd.path.DATA607.PROJECT1.Rmd.contentType.file...name.DATA607.PROJECT1.html.path.DATA607.PROJECT1.html.contentType.file...name.README.md.path.README.md.contentType.file...name.chess_results.csv.path.chess_results.csv.contentType.file...name.tournamentinfo.txt.path.tournamentinfo.txt.contentType.file...totalCount.5...fileTreeProcessingTime.1.90587.foldersToFetch....repo..id.759539956.defaultBranch.main.name.DATA607.Project1.ownerLogin.Zcash95.currentUserCanPush.false.isFork.false.isEmpty.false.createdAt.2024.02.18T21.27.06.000Z.ownerAvatar.https...avatars.githubusercontent.com.u.157787210.v.4.public.true.private.false.isOrgOwned.false..symbolsExpanded.false.treeExpanded.true.refInfo..name.main.listCacheKey.v0.1708318585.0.canEdit.false.refType.branch.currentOid.ec5c3dba72265c08d7291b4cf7290ec21ca7a4d3..path.tournamentinfo.txt.currentUser.null.blob..rawLines............................................................................................r..Pair...Player.Name......................Total.Round.Round.Round.Round.Round.Round.Round...r..Num....USCF.ID...Rtg..Pre..Post..........Pts....1.....2.....3.....4.....5.....6.....7.....r...........................................................................................r.....1...GARY.HUA.........................6.0...W..39.W..21.W..18.W..14.W...7.D..12.D...4..r....ON...15445895...R..1794.....1817......N.2...W.....B.....W.....B.....W.....B.....W......r...........................................................................................r.....2...DAKSHESH.DARURI..................6.0...W..63.W..58.L...4.W..17.W..16.W..20.W...7..r....MI...14598900...R..1553.....1663......N.2...B.....W.....B.....W.....B.....W.....B......r...........................................................................................r.....3...ADITYA.BAJAJ.....................6.0...L...8.W..61.W..25.W..21.W..11.W..13.W..12..r....MI...14959604...R..1384.....1640......N.2...W.....B.....W.....B.....W.....B.....W......r...........................................................................................r.....4...PATRICK.H.SCHILLING..............5.5...W..23.D..28.W...2.W..26.D...5.W..19.D...1..r....MI...12616049...R..1716.....1744......N.2...W.....B.....W.....B.....W.....B.....B......r...........................................................................................r.....5...HANSHI.ZUO.......................5.5...W..45.W..37.D..12.D..13.D...4.W..14.W..17..r....MI...14601533...R..1655.....1690......N.2...B.....W.....B.....W.....B.....W.....B......r...........................................................................................r.....6...HANSEN.SONG......................5.0...W..34.D..29.L..11.W..35.D..10.W..27.W..21..r....OH...15055204...R..1686.....1687......N.3...W.....B.....W.....B.....B.....W.....B......r...........................................................................................r.....7...GARY.DEE.SWATHELL................5.0...W..57.W..46.W..13.W..11.L...1.W...9.L...2..r....MI...11146376...R..1649.....1673......N.3...W.....B.....W.....B.....B.....W.....W......r...........................................................................................r.....8...EZEKIEL.HOUGHTON.................5.0...W...3.W..32.L..14.L...9.W..47.W..28.W..19..r....MI...15142253...R..1641P17..1657P24...N.3...B.....W.....B.....W.....B.....W.....W......r...........................................................................................r.....9...STEFANO.LEE......................5.0...W..25.L..18.W..59.W...8.W..26.L...7.W..20..r....ON...14954524...R..1411.....1564......N.2...W.....B.....W.....B.....W.....B.....B......r...........................................................................................r....10...ANVIT.RAO........................5.0...D..16.L..19.W..55.W..31.D...6.W..25.W..18..r....MI...14150362...R..1365.....1544......N.3...W.....W.....B.....B.....W.....B.....W......r...........................................................................................r....11...CAMERON.WILLIAM.MC.LEMAN.........4.5...D..38.W..56.W...6.L...7.L...3.W..34.W..26..r....MI...12581589...R..1712.....1696......N.3...B.....W.....B.....W.....B.....W.....B......r...........................................................................................r....12...KENNETH.J.TACK...................4.5...W..42.W..33.D...5.W..38.H.....D...1.L...3..r....MI...12681257...R..1663.....1670......N.3...W.....B.....W.....B...........W.....B......r...........................................................................................r....13...TORRANCE.HENRY.JR................4.5...W..36.W..27.L...7.D...5.W..33.L...3.W..32..r....MI...15082995...R..1666.....1662......N.3...B.....W.....B.....B.....W.....W.....B......r...........................................................................................r....14...BRADLEY.SHAW.....................4.5...W..54.W..44.W...8.L...1.D..27.L...5.W..31..r....MI...10131499...R..1610.....1618......N.3...W.....B.....W.....W.....B.....B.....W......r...........................................................................................r....15...ZACHARY.JAMES.HOUGHTON...........4.5...D..19.L..16.W..30.L..22.W..54.W..33.W..38..r....MI...15619130...R..1220P13..1416P20...N.3...B.....B.....W.....W.....B.....B.....W......r...........................................................................................r....16...MIKE.NIKITIN.....................4.0...D..10.W..15.H.....W..39.L...2.W..36.U......r....MI...10295068...R..1604.....1613......N.3...B.....W...........B.....W.....B............r...........................................................................................r....17...RONALD.GRZEGORCZYK...............4.0...W..48.W..41.L..26.L...2.W..23.W..22.L...5..r....MI...10297702...R..1629.....1610......N.3...W.....B.....W.....B.....W.....B.....W......r...........................................................................................r....18...DAVID.SUNDEEN....................4.0...W..47.W...9.L...1.W..32.L..19.W..38.L..10..r....MI...11342094...R..1600.....1600......N.3...B.....W.....B.....W.....B.....W.....B......r...........................................................................................r....19...DIPANKAR.ROY.....................4.0...D..15.W..10.W..52.D..28.W..18.L...4.L...8..r....MI...14862333...R..1564.....1570......N.3...W.....B.....W.....B.....W.....W.....B......r...........................................................................................r....20...JASON.ZHENG......................4.0...L..40.W..49.W..23.W..41.W..28.L...2.L...9..r....MI...14529060...R..1595.....1569......N.4...W.....B.....W.....B.....W.....B.....W......r...........................................................................................r....21...DINH.DANG.BUI....................4.0...W..43.L...1.W..47.L...3.W..40.W..39.L...6..r....ON...15495066...R..1563P22..1562......N.3...B.....W.....B.....W.....W.....B.....W......r...........................................................................................r....22...EUGENE.L.MCCLURE.................4.0...W..64.D..52.L..28.W..15.H.....L..17.W..40..r....MI...12405534...R..1555.....1529......N.4...W.....B.....W.....B...........W.....B......r...........................................................................................r....23...ALAN.BUI.........................4.0...L...4.W..43.L..20.W..58.L..17.W..37.W..46..r....ON...15030142...R..1363.....1371............B.....W.....B.....W.....B.....W.....B......r...........................................................................................r....24...MICHAEL.R.ALDRICH................4.0...L..28.L..47.W..43.L..25.W..60.W..44.W..39..r....MI...13469010...R..1229.....1300......N.4...B.....W.....B.....B.....W.....W.....B......r...........................................................................................r....25...LOREN.SCHWIEBERT.................3.5...L...9.W..53.L...3.W..24.D..34.L..10.W..47..r....MI...12486656...R..1745.....1681......N.4...B.....W.....B.....W.....B.....W.....B......r...........................................................................................r....26...MAX.ZHU..........................3.5...W..49.W..40.W..17.L...4.L...9.D..32.L..11..r....ON...15131520...R..1579.....1564......N.4...B.....W.....B.....W.....B.....W.....W......r...........................................................................................r....27...GAURAV.GIDWANI...................3.5...W..51.L..13.W..46.W..37.D..14.L...6.U......r....MI...14476567...R..1552.....1539......N.4...W.....B.....W.....B.....W.....B............r...........................................................................................r....28...SOFIA.ADINA.STANESCU.BELLU.......3.5...W..24.D...4.W..22.D..19.L..20.L...8.D..36..r....MI...14882954...R..1507.....1513......N.3...W.....W.....B.....W.....B.....B.....W......r...........................................................................................r....29...CHIEDOZIE.OKORIE.................3.5...W..50.D...6.L..38.L..34.W..52.W..48.U......r....MI...15323285...R..1602P6...1508P12...N.4...B.....W.....B.....W.....W.....B............r...........................................................................................r....30...GEORGE.AVERY.JONES...............3.5...L..52.D..64.L..15.W..55.L..31.W..61.W..50..r....ON...12577178...R..1522.....1444............W.....B.....B.....W.....W.....B.....B......r...........................................................................................r....31...RISHI.SHETTY.....................3.5...L..58.D..55.W..64.L..10.W..30.W..50.L..14..r....MI...15131618...R..1494.....1444............B.....W.....B.....W.....B.....W.....B......r...........................................................................................r....32...JOSHUA.PHILIP.MATHEWS............3.5...W..61.L...8.W..44.L..18.W..51.D..26.L..13..r....ON...14073750...R..1441.....1433......N.4...W.....B.....W.....B.....W.....B.....W......r...........................................................................................r....33...JADE.GE..........................3.5...W..60.L..12.W..50.D..36.L..13.L..15.W..51..r....MI...14691842...R..1449.....1421............B.....W.....B.....W.....B.....W.....B......r...........................................................................................r....34...MICHAEL.JEFFERY.THOMAS...........3.5...L...6.W..60.L..37.W..29.D..25.L..11.W..52..r....MI...15051807...R..1399.....1400............B.....W.....B.....B.....W.....B.....W......r...........................................................................................r....35...JOSHUA.DAVID.LEE.................3.5...L..46.L..38.W..56.L...6.W..57.D..52.W..48..r....MI...14601397...R..1438.....1392............W.....W.....B.....W.....B.....B.....W......r...........................................................................................r....36...SIDDHARTH.JHA....................3.5...L..13.W..57.W..51.D..33.H.....L..16.D..28..r....MI...14773163...R..1355.....1367......N.4...W.....B.....W.....B...........W.....B......r...........................................................................................r....37...AMIYATOSH.PWNANANDAM.............3.5...B.....L...5.W..34.L..27.H.....L..23.W..61..r....MI...15489571...R...980P12..1077P17...............B.....W.....W...........B.....W......r...........................................................................................r....38...BRIAN.LIU........................3.0...D..11.W..35.W..29.L..12.H.....L..18.L..15..r....MI...15108523...R..1423.....1439......N.4...W.....B.....W.....W...........B.....B......r...........................................................................................r....39...JOEL.R.HENDON....................3.0...L...1.W..54.W..40.L..16.W..44.L..21.L..24..r....MI...12923035...R..1436P23..1413......N.4...B.....W.....B.....W.....B.....W.....W......r...........................................................................................r....40...FOREST.ZHANG.....................3.0...W..20.L..26.L..39.W..59.L..21.W..56.L..22..r....MI...14892710...R..1348.....1346............B.....B.....W.....W.....B.....W.....W......r...........................................................................................r....41...KYLE.WILLIAM.MURPHY..............3.0...W..59.L..17.W..58.L..20.X.....U.....U......r....MI...15761443...R..1403P5...1341P9..........B.....W.....B.....W........................r...........................................................................................r....42...JARED.GE.........................3.0...L..12.L..50.L..57.D..60.D..61.W..64.W..56..r....MI...14462326...R..1332.....1256............B.....W.....B.....B.....W.....W.....B......r...........................................................................................r....43...ROBERT.GLEN.VASEY................3.0...L..21.L..23.L..24.W..63.W..59.L..46.W..55..r....MI...14101068...R..1283.....1244............W.....B.....W.....W.....B.....B.....W......r...........................................................................................r....44...JUSTIN.D.SCHILLING...............3.0...B.....L..14.L..32.W..53.L..39.L..24.W..59..r....MI...15323504...R..1199.....1199..................W.....B.....B.....W.....B.....W......r...........................................................................................r....45...DEREK.YAN........................3.0...L...5.L..51.D..60.L..56.W..63.D..55.W..58..r....MI...15372807...R..1242.....1191............W.....B.....W.....B.....W.....B.....W......r...........................................................................................r....46...JACOB.ALEXANDER.LAVALLEY.........3.0...W..35.L...7.L..27.L..50.W..64.W..43.L..23..r....MI...15490981...R...377P3...1076P10.........B.....W.....B.....W.....B.....W.....W......r...........................................................................................r....47...ERIC.WRIGHT......................2.5...L..18.W..24.L..21.W..61.L...8.D..51.L..25..r....MI...12533115...R..1362.....1341............W.....B.....W.....B.....W.....B.....W......r...........................................................................................r....48...DANIEL.KHAIN.....................2.5...L..17.W..63.H.....D..52.H.....L..29.L..35..r....MI...14369165...R..1382.....1335............B.....W...........B...........W.....B......r...........................................................................................r....49...MICHAEL.J.MARTIN.................2.5...L..26.L..20.D..63.D..64.W..58.H.....U......r....MI...12531685...R..1291P12..1259P17.........W.....W.....B.....W.....B..................r...........................................................................................r....50...SHIVAM.JHA.......................2.5...L..29.W..42.L..33.W..46.H.....L..31.L..30..r....MI...14773178...R..1056.....1111............W.....B.....W.....B...........B.....W......r...........................................................................................r....51...TEJAS.AYYAGARI...................2.5...L..27.W..45.L..36.W..57.L..32.D..47.L..33..r....MI...15205474...R..1011.....1097............B.....W.....B.....W.....B.....W.....W......r...........................................................................................r....52...ETHAN.GUO........................2.5...W..30.D..22.L..19.D..48.L..29.D..35.L..34..r....MI...14918803...R...935.....1092......N.4...B.....W.....B.....W.....B.....W.....B......r...........................................................................................r....53...JOSE.C.YBARRA....................2.0...H.....L..25.H.....L..44.U.....W..57.U......r....MI...12578849...R..1393.....1359..................B...........W...........W............r...........................................................................................r....54...LARRY.HODGE......................2.0...L..14.L..39.L..61.B.....L..15.L..59.W..64..r....MI...12836773...R..1270.....1200............B.....B.....W...........W.....B.....W......r...........................................................................................r....55...ALEX.KONG........................2.0...L..62.D..31.L..10.L..30.B.....D..45.L..43..r....MI...15412571...R..1186.....1163............W.....B.....W.....B...........W.....B......r...........................................................................................r....56...MARISA.RICCI.....................2.0...H.....L..11.L..35.W..45.H.....L..40.L..42..r....MI...14679887...R..1153.....1140..................B.....W.....W...........B.....W......r...........................................................................................r....57...MICHAEL.LU.......................2.0...L...7.L..36.W..42.L..51.L..35.L..53.B......r....MI...15113330...R..1092.....1079............B.....W.....W.....B.....W.....B............r...........................................................................................r....58...VIRAJ.MOHILE.....................2.0...W..31.L...2.L..41.L..23.L..49.B.....L..45..r....MI...14700365...R...917......941............W.....B.....W.....B.....W...........B......r...........................................................................................r....59...SEAN.M.MC.CORMICK................2.0...L..41.B.....L...9.L..40.L..43.W..54.L..44..r....MI...12841036...R...853......878............W...........B.....B.....W.....W.....B......r...........................................................................................r....60...JULIA.SHEN.......................1.5...L..33.L..34.D..45.D..42.L..24.H.....U......r....MI...14579262...R...967......984............W.....B.....B.....W.....B..................r...........................................................................................r....61...JEZZEL.FARKAS....................1.5...L..32.L...3.W..54.L..47.D..42.L..30.L..37..r....ON...15771592...R...955P11...979P18.........B.....W.....B.....W.....B.....W.....B......r...........................................................................................r....62...ASHWIN.BALAJI....................1.0...W..55.U.....U.....U.....U.....U.....U......r....MI...15219542...R..1530.....1535............B..........................................r...........................................................................................r....63...THOMAS.JOSEPH.HOSMER.............1.0...L...2.L..48.D..49.L..43.L..45.H.....U......r....MI...15057092...R..1175.....1125............W.....B.....W.....B.....B..................r...........................................................................................r....64...BEN.LI...........................1.0...L..22.D..30.L..31.D..49.L..46.L..42.L..54..r....MI...15006561...R..1163.....1112............B.....W.....W.....B.....W.....B.....B......r............................................................................................stylingDirectives...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................csv.null.csvError.null.dependabotInfo..showConfigurationBanner.false.configFilePath.null.networkDependabotPath..Zcash95.DATA607.Project1.network.updates.dismissConfigurationNoticePath..settings.dismiss.notice.dependabot_configuration_notice.configurationNoticeDismissed.null.repoAlertsPath..Zcash95.DATA607.Project1.security.dependabot.repoSecurityAndAnalysisPath..Zcash95.DATA607.Project1.settings.security_analysis.repoOwnerIsOrg.false.currentUserCanAdminRepo.false..displayName.tournamentinfo.txt.displayUrl.https...github.com.Zcash95.DATA607.Project1.blob.main.tournamentinfo.txt.raw.true.headerInfo..blobSize.17.4.KB.deleteInfo..deleteTooltip.You.must.be.signed.in.to.make.or.propose.changes..editInfo..editTooltip.You.must.be.signed.in.to.make.or.propose.changes..ghDesktopPath.https...desktop.github.com.gitLfsPath.null.onBranch.true.shortPath.54c7c42.siteNavLoginPath..login.return_to.https.3A.2F.2Fgithub.com.2FZcash95.2FDATA607.Project1.2Fblob.2Fmain.2Ftournamentinfo.txt.isCSV.false.isRichtext.false.toc.null.lineInfo..truncatedLoc.196.truncatedSloc.196..mode.file..image.false.isCodeownersFile.null.isPlain.false.isValidLegacyIssueTemplate.false.issueTemplateHelpUrl.https...docs.github.com.articles.about.issue.and.pull.request.templates.issueTemplate.null.discussionTemplate.null.language.Text.languageID.372.large.false.loggedIn.false.newDiscussionPath..Zcash95.DATA607.Project1.discussions.new.newIssuePath..Zcash95.DATA607.Project1.issues.new.planSupportInfo..repoIsFork.null.repoOwnedByCurrentUser.null.requestFullPath..Zcash95.DATA607.Project1.blob.main.tournamentinfo.txt.showFreeOrgGatedFeatureMessage.null.showPlanSupportBanner.null.upgradeDataAttributes.null.upgradePath.null..publishBannersInfo..dismissActionNoticePath..settings.dismiss.notice.publish_action_from_dockerfile.releasePath..Zcash95.DATA607.Project1.releases.new.marketplace.true.showPublishActionBanner.false..rawBlobUrl.https...github.com.Zcash95.DATA607.Project1.raw.main.tournamentinfo.txt.renderImageOrRaw.false.richText.null.renderedFileInfo.null.shortPath.null.symbolsEnabled.true.tabSize.8.topBannersInfo..overridingGlobalFundingFile.false.globalPreferredFundingPath.null.repoOwner.Zcash95.repoName.DATA607.Project1.showInvalidCitationWarning.false.citationHelpUrl.https...docs.github.com.github.creating.cloning.and.archiving.repositories.creating.a.repository.on.github.about.citation.files.showDependabotConfigurationBanner.false.actionsOnboardingTip.null..truncated.false.viewable.true.workflowRedirectUrl.null.symbols..timed_out.false.not_analyzed.true.symbols......copilotInfo.null.copilotAccessAllowed.false.csrf_tokens...Zcash95.DATA607.Project1.branches..post.YahSqN5YgLTUf8OUfmNF4ugu2Zq9PdXSlmYwn.Z9bd.fNh2glxsIlY2Lr8nt5wtv9jNNnv5Per3tJmAphOCNyQ...repos.preferences..post.A_GQ6hLIG4SAVpGuY_h4wPIv0tHxlQAhvFW8lcPjX9RQpLevyTa1EhfRxB6MQEjnh86qgWSUTXWxAEGbXiarsQ....title.DATA607.Project1.tournamentinfo.txt.at.main...Zcash95.DATA607.Project1.
## <0 rows> (or 0-length row.names)
This data appeared in a format which was unstructured so we had to do some work to structure it properly (which took alot of brain power lol). This will give us the ability to analyze it accurately. Data that is unstructured is alot harder to work with so we started by identifying that we need to parse this data as it is JSON format. This is the process of extracting valuable information from data.
chess_data2 <- readLines(github_raw)
## Warning in readLines(github_raw): incomplete final line found on
## 'https://github.com/Zcash95/DATA607-Project1/blob/main/tournamentinfo.txt'
parsed_data <- fromJSON(chess_data2)
The next step in this process was extracting the relevant information from this text file and filtering out the irrelevant
rawLines <- parsed_data$payload$blob$rawLines
relevant_lines <- rawLines[grep("^\\s*\\d+\\s+\\|", rawLines)]
We will now create a new data frame “chessdf” by taking the relevant information and enter into a new data frame.
chessdf <- read.table(text = relevant_lines, header = FALSE, sep = "|", strip.white = TRUE)
We will then label the column names so we can refer back to the header to know what information we are looking at.
colnames(chessdf) <- c("Pair", "PlayerName", "Total", "Round1", "Round2", "Round3", "Round4", "Round5", "Round6", "Round7")
head(chessdf)
## Pair PlayerName Total Round1 Round2 Round3 Round4 Round5 Round6
## 1 1 GARY HUA 6.0 W 39 W 21 W 18 W 14 W 7 D 12
## 2 2 DAKSHESH DARURI 6.0 W 63 W 58 L 4 W 17 W 16 W 20
## 3 3 ADITYA BAJAJ 6.0 L 8 W 61 W 25 W 21 W 11 W 13
## 4 4 PATRICK H SCHILLING 5.5 W 23 D 28 W 2 W 26 D 5 W 19
## 5 5 HANSHI ZUO 5.5 W 45 W 37 D 12 D 13 D 4 W 14
## 6 6 HANSEN SONG 5.0 W 34 D 29 L 11 W 35 D 10 W 27
## Round7 NA
## 1 D 4 NA
## 2 W 7 NA
## 3 W 12 NA
## 4 D 1 NA
## 5 W 17 NA
## 6 W 21 NA
We will visualize the data frame. The next step will be calculating the Pre averages of opponents for all the players. After computing this we came to the conclusion that Gary Hua has the best in terms of points relative to his expected result.
view(chessdf)
We will now export the TXT file inro a CSV file from the data table that we have created.
write.csv(chessdf, "chess_results.csv", row.names = FALSE)