diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1d288326 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +locale/ diff --git a/README.md b/README.md index 5916bea0..3f6cef83 100644 --- a/README.md +++ b/README.md @@ -2,192 +2,45 @@ Please take a look at the [quickstart guide](quickstart.md) if you wish to make small contribution(s). -If you wish to contribute by translating some of the material, please make sure you comply with the [Guideline for Translators](TranslatorGuidelines.md). +Before translating any material, please make sure you comply with the [Guidelines for Translators](TranslatorGuidelines.md) and read the [Rules of Conduct](rules.md). -## Purpose of this repository +We encourage translators to [join our slack channel](https://r-wakalang.herokuapp.com/), #swcarpentry in the Tokyo.R workspace. This is a great place to ask any questions you may have about the workflow. -The repository is intended to host the files and tools need to facilitate translations of the Software Carpentry lessons -from English into other languages. This repository is intended to merge with the Multi-lingual versions of the lessons -in English and Spanish. We plan for these to be compatible to be hosted along with other languages on the main -Software Carpentry website and to maintain updated copies of the Japanese lessons with new releases of the -English lessons. Therefore: - -* Please do not remove the files for other languages (currently Spanish) from the repository. -These need to be retained to merge the lessons with the main i18n repository and existing lessons. - -* Please do not delete the archived files for translation of previous versions of the English lessons. - These will be needed to merge translations with updated English files for future releases of the - main Software Carpentry lessons. This means that we will only need to translate updated sections and - translations to sections that have not been updated will be migrated to new releases. - -* Please only submit changes specific to Japanese language translations to this repository as Pull Requests. - Please submit issues specific to the English lessons to the main lesson repository. If you have a suggestion - for a change to the content or examples, we cannot change these in the Japanese lesson and the main lessons - need to be updated in English. We ask that these changes be raised as an Issue in Japanese rather than a - Pull Request if you prefer not to submit an Issue or Pull Request in English. - -* Please contact us if you wish to join the core translation team. Any contributions to the Japanese lessons - are welcome as Pull Requests but please make sure you understand the English version of the lesson if - you are able to. - -* Please commit and push changes to a fork of the reposiory on your personal GitHub account and - submit a Pull Request. In this way, suggested changes can be reviewed and discussed. Please raise - any matters that you are unsure of or want help with when submitting a Pull Request. - -* Please track changes to all files needed to generate the translated lessons. This way we can combine - all changes from contributors and track our progress. All contributions will be attributed to each - contributor. - -* Please contact us via an Issue if anything is unclear in the guides to set up or use the - translation tools in this repository so we can update the README and guides. - -## How does this work? - -### Using git - -This repository uses the tool `git` via the command line. On Linux and Mas OS, the `bash` terminal should come pre-installed. `git` may be installed but if not it can be installed as follows: - -- Linux Ubuntu-based distros - -``` -sudo apt-get install git -``` - -- Linux Fedora - -``` -yum install git -``` - -or - -``` -sudo dnf install git-all -``` - -- Linux Install from Debian file - -Download the `.deb` file for your OS from here: - -https://pkgs.org/download/git - -``` -dpkg -i git_2.11.0-3+deb9u4_amd64.deb -``` - -- Linux Build from source - -Download the latest version of git: - -https://github.com/git/git/releases - -or - -https://mirrors.edge.kernel.org/pub/software/scm/git/ - -``` -tar -zxf git-2.0.0.tar.gz -cd git-2.0.0 -make configure -./configure --prefix=/usr -make all doc info -sudo make install install-doc install-html install-info -``` - -- Windows - -Download Git for Windows (Git-Bash) by following the instructions here: - -https://gitforwindows.org/ +## Purpose -or +The repository is intended to host the files and tools need to facilitate translations of the [Software Carpentry](https://software-carpentry.org/) lessons +from English into other languages (currently we are working on Japanese). This repository is intended to merge with the Multi-lingual versions of the lessons +in English and Spanish. We plan for these to be compatible to be hosted along with other languages on the main +Software Carpentry website and to maintain updated copies of the Japanese lessons with new releases of the +English lessons. -https://git-scm.com/ +We are translating (and keeping up-to-date) the Software Carpentry lessons, not revising original lesson material. +If you notice an issue with the lesson materials themselves, please send an issue for pull request to the English lesson materials. -- Mac OS +## About git -Install usiing homebrew (requires Xcode): https://docs.brew.sh/Installation +This assumes that you are familiar with using Git and GitHub. -``` -brew install git -``` +If you need help installing git, please see the [guide on installing git](git.md). -### Importing a lesson for the first time +## About PO files -If you wish to start a translation of a lesson that has not been translated in your language before, -please follow these instructions. See the instructions below for if your lesson has an exisiting -translation and you wish to submit changes or an update. +We use [PO files](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) for translation, rather than translating the text of each lesson directly. A PO file is a plain text file consisting of multiple entries, where each entry contains a short portion of the original text and its translation. There is one PO file for each original lesson. For example, the [Software Carpentry 'git novice' lesson](https://github.com/swcarpentry/git-novice), which consists of multiple markdown documents, has a single PO file called `git-novice.ja.po` for translating into Japanese. -1. Create a "Fork" for this repository on your personal GitHub account. (Click "Fork" in the top right - corner of the `https://github.com/swcarpentry-ja/i18n` webpage) +This way, we can keep track of the original text and know exactly what needs to be changed when the original lessons are updated, instead of manually tracking changes. -2. Clone this repository from your personal account (e.g., GitHubUser). This is your local copy to manage your version of - the translation files. +There are a number of free PO editors: [PoEdit](http://www.poedit.net), +[GTranslator](https://wiki.gnome.org/Apps/Gtranslator), [Lokalize](https://userbase.kde.org/Lokalize), to name a few. We recommend using one of these to edit the PO files. -``` -cd directory -git clone git@github.com:GitHubUser/i18n.git -cd i18n -``` +## Importing a lesson for the first time -If you already have a fork of translation repository, please pull changes for the current - version from the organisation repository: +Lessons are imported as submodules. This only needs to happen once per lesson, so most translators will not need to do this. If you want to import a new lesson, please see the [guide on importing](importing.md). -``` -git checkout ja -git remote add swc-ja git@github.com:swcarpentry-ja/i18n.git -git pull swc-ja ja -``` +## Contributing to a translation of an existing lesson +**This is the task that we need the most help with from translators!** -3. Add a submodule for the lessons that you want to translate - -``` -git submodule add https://github.com/swcarpentry/git-novice.git -``` - -4. Run `po4gitbook/update.sh` - That creates/updates the `po` directory with the `.pot` files to use in translations. - -5. Create a `po` file and start translating! - - copy `.pot` to `..po`. e.g., - ```bash - cd po - cp shell-novice.pot shell-novice.es.po - ``` - - Edit the file with your favourite po editor ([PoEdit](http://www.poedit.net), - [GTranslator](https://wiki.gnome.org/Apps/Gtranslator), [Lokalize](https://userbase.kde.org/Lokalize), ...) - Note: - - "`Language`" field is needed to add to the header (at least with gtranslator), the rest is put by the tool. - - "`Language-Team:`" needs the first letter in upper case (e.g., `Es` or `Ja`) - - Create `po/LINGUAS` - - run `po4gitbook/compile.sh` - This creates a `locale//` tree directory - -This generates a translated version of the lessons. Please do not create a git repository within - this repository. You can copy these files to another repository as described in the - "Guide for Translators" and submit changes to the PO files via Pull Request to GitHub. - -Please note that there are files shared between lesson repositories: -``` -CODE_OF_CONDUCT.md -CONTRIBUTING.md -LICENSE.md -README.md -``` -These will be hosted on the translated Git repository but will not be included in the - webpages once they are generated. Apart from the `README`, these are the same files - between each lesson. Please check that these files have not been already translated - for another lesson. If so you can copy these to ensure they are consistent. - -While these files appear at the beginning of the PO files (since files are sorted alphabetically), - they are not a priority to translate. Please skip to the beginning of the lesson, - following the README. - -### Contributing to a translation of an existing lesson - -Please see these instructions if you wish to contribute to a translation in progress - on the current version the main English lessons. This is for updating or translating - sections to a translation in progress. To import updates from a new release of - the main English lessons, please see the instructions below. +This assumes that the lesson has already been added to the `swcarpentry-ja/i18n` as a submodule as described in the [guide on importing](importing.md), and you would like to contribute translations for that lesson. 1. Create a "Fork" for this repository on your personal GitHub account. (Click "Fork" in the top right corner of the `https://github.com/swcarpentry-ja/i18n` webpage) @@ -201,64 +54,23 @@ git clone git@github.com:GitHubUser/i18n.git cd i18n ``` -If you already have a fork of translation repository, please pull changes for the current - version from the organisation repository: +3. Populate submodules. ``` -git checkout ja -git remote add swc-ja git@github.com:swcarpentry-ja/i18n.git -git pull swc-ja ja +git submodule init +git submodule update ``` -This repository should already contain a translation file for the lesson that you wish to contribute to - in the `po` directory ..po such as `git-novice.ja.po` +This repository should already contain a translation file for the lesson that you wish to contribute to in the `po` directory `..po` such as `git-novice.ja.po` ```bash cd po ls git-novice.ja.po ``` -3. Add and edit translations to the PO files. - - - Edit the file with your favourite po editor ([PoEdit](http://www.poedit.net), - [GTranslator](https://wiki.gnome.org/Apps/Gtranslator), [Lokalize](https://userbase.kde.org/Lokalize), ...) - Note: - - "`Language`" field is needed to add to the header (at least with gtranslator), the rest is put by the tool. - - "`Language-Team:`" needs the first letter in upper case (e.g., `Es`) - - Create `po/LINGUAS` - - Run `po4gitbook/compile.sh` - This creates a `locale//` tree directory - -This generates a translated version of the lessons with your changes. You can add and commit - changes to the PO files and submit changes as a Pull Request on GitHub as described in the - "Guide for Translators". - - Please do not create a git repository within this repository. You can copy these files to another repository - as described in the "Guide for Maintainers and Administrators" and submit changes to translated - lesson repository to update the webpages hosted on GitHub. - -### Contributing to translation of an updated lesson with a new release of the main English lessons - -If there is an existing (complete) translation of the lesson in your language but - there has a new release of the main English lessons, the new updated version - of the English lessons needs to be merged with the current translated. This way - the sections have not been changed and have already been translated will be migrated - to the new version of the lessons and only the sections that have been changed remain - to be translated. - -1. Create a "Fork" for this repository on your personal GitHub account. (Click "Fork" in the top right - corner of the `https://github.com/swcarpentry-ja/i18n` webpage) - -2. Clone this repository from your personal account (e.g., GitHubUser). This is your local copy to manage your version of - the translation files. - -``` -cd directory -git clone git@github.com:GitHubUser/i18n.git -cd i18n -``` +4. Edit the PO files. [As per the guidelines](rules.md), please commit your changes frequently and submit a pull request when you are satisfied with your work. -If you already have a fork of translation repository, please pull changes for the current - version from the organisation repository: +5. Your PR will be reviewed for accuracy. You may need to make edits so it can pass review. When doing so, always be sure to pull changes from the organisation repository first: ``` git checkout ja @@ -266,176 +78,34 @@ git remote add swc-ja git@github.com:swcarpentry-ja/i18n.git git pull swc-ja ja ``` -3. Import the current version of the main English lessons. - -Update the submodule for the lesson that you want to translate - -``` -git submodule add https://github.com/swcarpentry/git-novice.git -``` - -Alternatively, you can update the submodules for every lesson: - -``` -git submodule foreach git pull origin master -``` - -4. Create translation files for the updated version of the lessons - -Run `po4gitbook/update.sh` - That creates/updates the `po` directory with the `.pot` files to use in translations. - -For an update: existing translations will be merged into an updated file. -```bash -cd po -ls git-novice.ja.po -``` - -5. This creates an updated `po` file with updated sections ready to translate. - - - - Edit the file with your favourite po editor ([PoEdit](http://www.poedit.net), - [GTranslator](https://wiki.gnome.org/Apps/Gtranslator), [Lokalize](https://userbase.kde.org/Lokalize), ...) - Note: - - "`Language`" field is needed to add to the header (at least with gtranslator), the rest is put by the tool. - - "`Language-Team:`" needs the first letter in upper case (e.g., `Es`) - - Create `po/LINGUAS` - - Run `po4gitbook/compile.sh` - This creates a `locale//` tree directory - -This generates a translated version of the lessons with your changes. You can add and commit - changes to the PO files and submit changes as a Pull Request on GitHub as described in the - "Guide for Translators". - - Please do not create a git repository within this repository. You can copy these files to another repository - as described in the "Guide for Maintainers and Administrators" and submit changes to translated - lesson repository to update the webpages hosted on GitHub. - -## Guide for Translators - -This assumes that you are familiar with using Git and GitHub. -We are translating (and keeping up-to-date) the Software Carpentry notes. -If you notice an issue with the lesson materials themselves, please send an issue for pull request to the English lesson materials. - -### Resources for translations - -Please follow the following Guidelines for translators when editing the lessons: - -https://github.com/swcarpentry-ja/i18n/blob/ja/TranslatorGuidelines.md - -There is a list of technical terms to refer to for ensuring that terms are consistently used between lessons, please update and refer to this as needed: - -https://github.com/swcarpentry-ja/i18n/wiki/Glossary-for-technical-terms - -### To contribute to lesson materials - -Fork this repository on GitHub and clone the **forked repo** to your local machine: -```bash -git clone git@github.com:/i18n.git -``` - -Some of the above procedure has been performed for some lessons already. -These scripts can be used to initialise translation of a new lesson -or update a translation of a lesson in progress. +Repeat steps 4 and 5 until the PR passes review. -1. Import lesson as instructed above (or pull current version from organisation repo) +A few notes: -2. Check that lang.md has the assets in the correct language +Editing the PO file will not generate the translated website. That is left to the maintainers, as described in the [guide for maintainers and administrators](admin.md). -3. Translate sections (or check translations) and commit changes +If you want to see a translated MD file after editing the PO file, run `bash po4gitbook/compile.sh`. This generates a translated version of the lesson with your changes, which you can find at `locale//`, e.g., `locale/ja/git-novice`. -4. Push or your personal repo and send pull request to organisation repository +## Contributing to translation of an updated lesson with a new release of the main English lessons - a. Clone the swcarpentry-ja lesson with "lesson-name-ja" or create a new lesson repo to (if one does not exist already) to host the translated lessons. -You can push commit changes to the submodule of the lesson before translation or create a fresh repository with the translated files. +If there is an existing (complete) translation of the lesson but + there has a new release of the main English lessons, the updated version + of the English lessons needs to be merged with the current translated one. - b. Copy changes from from automatically generated lessons `rsync -u i18n/locale/ja/git-novice/ git-novice-ja` +Please see the [guide on updating lessons](updating.md). - c. Commit changes and push to GitHub +## Resources for translations - d. Create a Pull Request from your repo to `swcarpentry-ja` for the translated lesson repo AND the updated PO files in `i18n`. Please reference your lesson pull request #Number when creating a pull request to i18n. +Please follow [guidelines for translators](TranslatorGuidelines.md) when editing the lessons. -If you send a pull request of translated files, we can merge them into the lesson materials and generate the updated webpages. If you wish to generate a preview of these yourself on your local repo, please see the instructions below. +There is a [list of technical terms](https://github.com/swcarpentry-ja/i18n/wiki/Glossary-for-technical-terms) to refer to for ensuring that terms are consistently used between lessons. Please update and refer to this as needed. -5. Please commit often and discuss issues on github to ensure that we are not repeating each other +Please see the [culture notes](CultureNotes.md) for a standardized treatment of concepts that don't translate literally into Japanese to ensure consistency. -6. Update the `ChangeLog.md` and `CultureNotes.md` files accordingly +We have a [change log](ChangeLog.md) to track progress and goals. -ChangeLog.md is to track progress and goals. CultureNotes.md is a share record of non-literal translations to ensure consistency. +## Guide for maintainers and administrators -7. Add your name to the translation team if you wish (unless you want to remain anonymous) +Please see the [guide for maintainers and administrators](admin.md) Thank you for all your help. Even seemingly minor contributions will be appreciated! - -## Guide for Maintainers and Administrators - -### To update the GitHub pages lessons with Jekyll - -This assumes a high level of familiarity with Git, GitHub, and how these lessons have been configured. These tools can be used to - update the webpages hosted on the organisation repository or create a hosted webpage on your personal fork. - -Updates to the files can be managed by tracking changes to the PO files and translated lessons -can be viewed on the GitHub repository as Markdown files in the `_episodes` directory -of the respectve lesson repo. It is not necessary to update the webpages for every update to -the translations. This will be managed by lesson maintainers and organisers of the Japanese -language team. - -1. Run `po4gitbook/compile.sh` on updated PO files (commit and push changes to PO files to i18n) - -Note that in order for the lessons to compile the Credit line in the PO files HEADER - "# FULL NAME , YEAR." must match the contact details of the "Last-Translator". -Please fill in your details or keep these consistent in order to build the new translated lessons. - - -``` -git add -u po/*ja.po -git commit -m "update PO files" -git push origin ja -``` - -2. Clone the translated lesson repo (to a directory outside the i18n repository) -``` -git clone https://github.com/swcarpentry-ja/git-novice-ja.git -``` -Or pull to your copy of this repo -``` -git pull origin master -``` - -3. Move updated translated files to the cloned translated lesson -``` -rsync -ru i18n/locale/ja/git-novice/* git-novice-ja -``` - -4. Commit and push changes to the translated lesson -``` -git add -u * -git commit -m "update lesson files" -git push origin master -``` - -6. Clone or pull a copy of the original lesson repo (again outside any existing git repos) -``` -git clone https://github.com/swcarpentry-ja/git-novice.git -``` - -Or pull to your copy of this repo -``` -git pull origin gh-pages -``` - -6. Sync changes to (master branch of) the pushed submodule files to the original lesson repository -``` -git submodule foreach git pull origin master -``` - -7. Commit changes to the submodule to the original lesson -``` -git add -u -git commit -m "update Japanese lessons" -``` - -8. Push to the lesson repo (or send a pull request) -``` -git push origin gh-pages -``` - -Jekyll will update the "github.io" webpages once a new commit is pushed (but it will not see new commits to submodules unless these are pulled and committed) diff --git a/Translators.md b/Translators.md index 06bc78dc..8e4b2bc8 100644 --- a/Translators.md +++ b/Translators.md @@ -7,37 +7,37 @@ Team lead (co-ordinator) Members * [Riku Takei][takei_riku]: Assistant Research Fellow (University of Otago, Dunedin, New Zealand) - * Lesson organiser and reviewer (Git) + * Lesson organiser and moderator (Git) * GitHub: [@rikutakei](https://github.com/rikutakei) * Twitter: [@rikutakei](http://twitter.com/rikutakei) -* [Joel Nitta][nitta_joel]: Postdoctoral Researcher (National Museum of Nature and Science, Tsukuba, Japan) - * Reviewer and technical support +* [Joel Nitta][nitta_joel]: Postdoctoral Researcher (Smithsonian National Museum of Natural History, Washington DC, USA) + * Reveiwer and technical support * GitHub: [@joelnitta](https://github.com/joelnitta) * Twitter: [@joel_nitta](http://twitter.com/joel_nitta) * [Homepage](https://joelnitta.com) -* [Maki Arakaki][arakaki_maki] - * Lesson organiser (R gapminder) +* [Maki Arakaki][arakaki_maki] (Tokyo, Japan) + * Lesson organiser and moderator (R gapminder) * GitHub: [@rkkmk](https://github.com/rkkmk) -* [Daichi Saito][arakaki_maki] +* [Daichi Saito][saito_daichi] (Tokyo, Japan) * Lesson contributor (R gapminder) - * GitHub: [@rkkmk](https://github.com/DaichiSaitoAF) - * Twitter: [@daichibaa](http://githut.com/daichibaa) + * GitHub: [@DaichiSaitoAF](https://github.com/DaichiSaitoAF) + * Twitter: [@daichibaa](http://github.com/daichibaa) -* [Tomohiro Egawa][egawa_tomohiro] +* [Atsushi Yamamoto][yamamoto_atsushi] (Okayama, Japan) * Lesson contributor (R gapminder) - * GitHub: [@](https://github.com/) - * Twitter: [@bakamyudatri](http://twitter.com/bakamyudatri) + * GitHub: [@atusy](https://github.com/atusy) + * Twitter: [@Atsushi776](http://github.com/Atsushi776) -* [Kyoko Matsumura][matsumura_kyoko] - * Lesson organiser (Shell) +* [Kyoko Matsumura][matsumura_kyoko] (Tokyo, Japan) + * Lesson organiser and moderator (Shell) * GitHub: [@kyyonko](https://github.com/kyyonko) * Twitter: [@kyyonko](http://twitter.com/kyyonko) * [Kozo Nishida][nishida_kozo]: Technical Scientist (RIKEN BDR, Osaka, Japan) - * Lesson organiser (Python) + * Lesson organiser and moderator (Python) * GitHub: [@kozo2](https://github.com/kozo2) * Twitter: [@kozo2](http://twitter.com/kozo2) @@ -45,12 +45,21 @@ Members * Translation contributor and reviewer * GitHub: [@manabuishii](https://github.com/manabuishii) * Twitter: [@manabuishiirb](http://twitter.com/manabuishiirb) - -* [Koki Mimura][mimura_koki]: Postdoctoral Researcher (Tokyo University of Agriculture and Technology, Tokyo, Japan) + +* [Satoshi Yokota][yokota_sotashi]: Postdoctoral Scholar (Stanford University, School of Medicine, California, USA) * Translation contributor and reviewer + * GitHub: [@megane0-0](https://github.com/megane0-0) + * Twitter: [@megane0-0](http://twitter.com/megane0-0) + +* [Koki Mimura][mimura_koki]: Postdoctoral Researcher (Tokyo University of Agriculture and Technology, Tokyo, Japan) + * Advisor on organising events + * GitHub: [@kilometer0101](https://github.com/kilometer0101) * Twitter: [@kilometer00](http://twitter.com/kilometer00) Please include your GitHub account and any other detail that you wish to be public. * [GivenName FamilyName][family_given]: Job title (Affiliation, location) - [@GitHubUser](https://github.com/GitHubUser) + * Role + * GitHub: [@GitHubUser](https://github.com/GitHubUser) + * Twitter: [@handle](http://twitter.com/handle) + diff --git a/admin.md b/admin.md new file mode 100644 index 00000000..29f403e5 --- /dev/null +++ b/admin.md @@ -0,0 +1,74 @@ +## Information for Maintainers and Administrators + +### To update the GitHub pages lessons with Jekyll + +This assumes a high level of familiarity with Git, GitHub, and how these lessons have been configured. These tools can be used to + update the webpages hosted on the organisation repository or create a hosted webpage on your personal fork. + +Updates to the files can be managed by tracking changes to the PO files and translated lessons +can be viewed on the GitHub repository as Markdown files in the `_episodes` directory +of the respectve lesson repo. It is not necessary to update the webpages for every update to +the translations. This will be managed by lesson maintainers and organisers of the Japanese +language team. + +1. Run `po4gitbook/compile.sh` on updated PO files (commit and push changes to PO files to i18n) + +Note that in order for the lessons to compile the Credit line in the PO files HEADER + "# FULL NAME , YEAR." must match the contact details of the "Last-Translator". +Please fill in your details or keep these consistent in order to build the new translated lessons. + + +``` +git add -u po/*ja.po +git commit -m "update PO files" +git push origin ja +``` + +2. Clone the translated lesson repo (to a directory outside the i18n repository) +``` +git clone https://github.com/swcarpentry-ja/git-novice-ja.git +``` +Or pull to your copy of this repo +``` +git pull origin master +``` + +3. Move updated translated files to the cloned translated lesson +``` +rsync -ru i18n/locale/ja/git-novice/* git-novice-ja +``` + +4. Commit and push changes to the translated lesson +``` +git add -u * +git commit -m "update lesson files" +git push origin master +``` + +6. Clone or pull a copy of the original lesson repo (again outside any existing git repos) +``` +git clone https://github.com/swcarpentry-ja/git-novice.git +``` + +Or pull to your copy of this repo +``` +git pull origin gh-pages +``` + +6. Sync changes to (master branch of) the pushed submodule files to the original lesson repository +``` +git submodule foreach git pull origin master +``` + +7. Commit changes to the submodule to the original lesson +``` +git add -u +git commit -m "update Japanese lessons" +``` + +8. Push to the lesson repo (or send a pull request) +``` +git push origin gh-pages +``` + +Jekyll will update the "github.io" webpages once a new commit is pushed (but it will not see new commits to submodules unless these are pulled and committed) diff --git a/git.md b/git.md new file mode 100644 index 00000000..ed92c075 --- /dev/null +++ b/git.md @@ -0,0 +1,68 @@ +### Using git + +This repository uses the tool `git` via the command line. On Linux and Mas OS, the `bash` terminal should come pre-installed. `git` may be installed but if not it can be installed as follows: + +- Linux Ubuntu-based distros + +``` +sudo apt-get install git +``` + +- Linux Fedora + +``` +yum install git +``` + +or + +``` +sudo dnf install git-all +``` + +- Linux Install from Debian file + +Download the `.deb` file for your OS from here: + +https://pkgs.org/download/git + +``` +dpkg -i git_2.11.0-3+deb9u4_amd64.deb +``` + +- Linux Build from source + +Download the latest version of git: + +https://github.com/git/git/releases + +or + +https://mirrors.edge.kernel.org/pub/software/scm/git/ + +``` +tar -zxf git-2.0.0.tar.gz +cd git-2.0.0 +make configure +./configure --prefix=/usr +make all doc info +sudo make install install-doc install-html install-info +``` + +- Windows + +Download Git for Windows (Git-Bash) by following the instructions here: + +https://gitforwindows.org/ + +or + +https://git-scm.com/ + +- Mac OS + +Install usiing homebrew (requires Xcode): https://docs.brew.sh/Installation + +``` +brew install git +``` diff --git a/importing.md b/importing.md new file mode 100644 index 00000000..1182a9d6 --- /dev/null +++ b/importing.md @@ -0,0 +1,69 @@ +## Importing a lesson for the first time + +If you wish to start a translation of a lesson that has not been translated in your language before, +please follow these instructions. See the instructions below for if your lesson has an exisiting +translation and you wish to submit changes or an update. + +1. Create a "Fork" for this repository on your personal GitHub account. (Click "Fork" in the top right + corner of the `https://github.com/swcarpentry-ja/i18n` webpage) + +2. Clone this repository from your personal account (e.g., GitHubUser). This is your local copy to manage your version of + the translation files. + +``` +cd directory +git clone git@github.com:GitHubUser/i18n.git +cd i18n +``` + +If you already have a fork of translation repository, please pull changes for the current + version from the organisation repository: + +``` +git checkout ja +git remote add swc-ja git@github.com:swcarpentry-ja/i18n.git +git pull swc-ja ja +``` + + +3. Add a submodule for the lessons that you want to translate + +``` +git submodule add https://github.com/swcarpentry/git-novice.git +``` + +4. Run `po4gitbook/update.sh` - That creates/updates the `po` directory with the `.pot` files to use in translations. + +5. Create a `po` file and start translating! + - copy `.pot` to `..po`. e.g., + ```bash + cd po + cp shell-novice.pot shell-novice.es.po + ``` + - Edit the file with your favourite po editor ([PoEdit](http://www.poedit.net), + [GTranslator](https://wiki.gnome.org/Apps/Gtranslator), [Lokalize](https://userbase.kde.org/Lokalize), ...) + Note: + - "`Language`" field is needed to add to the header (at least with gtranslator), the rest is put by the tool. + - "`Language-Team:`" needs the first letter in upper case (e.g., `Es` or `Ja`) + - Create `po/LINGUAS` + - run `po4gitbook/compile.sh` - This creates a `locale//` tree directory + +This generates a translated version of the lessons. Please do not create a git repository within + this repository. You can copy these files to another repository as described in the + "Guide for Translators" and submit changes to the PO files via Pull Request to GitHub. + +Please note that there are files shared between lesson repositories: +``` +CODE_OF_CONDUCT.md +CONTRIBUTING.md +LICENSE.md +README.md +``` +These will be hosted on the translated Git repository but will not be included in the + webpages once they are generated. Apart from the `README`, these are the same files + between each lesson. Please check that these files have not been already translated + for another lesson. If so you can copy these to ensure they are consistent. + +While these files appear at the beginning of the PO files (since files are sorted alphabetically), + they are not a priority to translate. Please skip to the beginning of the lesson, + following the README. diff --git a/lang.md b/lang.md index 38cb94fd..ebd97101 100644 --- a/lang.md +++ b/lang.md @@ -15,18 +15,18 @@ contribute: "貢献します" source: "ソース" cite: "引用します" contact: "連絡します" -keypoints: "キーポイント" +keypoints: "要点" overview: "概要" break: "休止" -previous: "前に" +previous: "戻る" next: "次へ" episode: "エピソード" lessonHome: "レッスンのホーム" -teaching: "教えります" +teaching: "講義" exercises: "練習" min: "分" questions: "質問" -objectives: "目的" +objectives: "目標" downloadLesson: "レッスンの必要なファイルをダウンロードします" finish: "仕上がり" scheduleDisclaimer: "実際のスケジュールは、インストラクターが選択したトピックや演習によって若干異なる場合があります." diff --git a/po/git-novice.es.po b/po/git-novice.es.po index 867fdadd..89cd9a6c 100644 --- a/po/git-novice.es.po +++ b/po/git-novice.es.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# David Perez-Suarez , 2018. +# David Perez-Suarez , 2019. # msgid "" msgstr "" diff --git a/po/git-novice.ja.po b/po/git-novice.ja.po index e0472734..50be3014 100644 --- a/po/git-novice.ja.po +++ b/po/git-novice.ja.po @@ -1,7 +1,7 @@ # Japanese translation of the Software Carpentry Git Lesson -# Copyright (C) 2018 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the gitbook package. -# Riku Takei , 2018. +# Riku Takei , 2019. # msgid "" msgstr "" diff --git a/po/python-novice-gapminder.ja.po b/po/python-novice-gapminder.ja.po index 6a2a6307..230a979d 100644 --- a/po/python-novice-gapminder.ja.po +++ b/po/python-novice-gapminder.ja.po @@ -1,7 +1,7 @@ # Japanese translation of the Software Carpentry Plotting and Programming in Python Lesson -# Copyright (C) 2018 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. -# Software-Carpentry Japanese-Team , 2018. +# Software-Carpentry Japanese-Team , 2019. # msgid "" msgstr "" diff --git a/po/python-novice-inflammation.ja.po b/po/python-novice-inflammation.ja.po index a1edd5c5..a960f61a 100644 --- a/po/python-novice-inflammation.ja.po +++ b/po/python-novice-inflammation.ja.po @@ -1,7 +1,7 @@ # Japanese translation of the Software Carpentry Programming with Python Lesson -# Copyright (C) 2018 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. -# Software-Carpentry Japanese-Team , 2018. +# Software-Carpentry Japanese-Team , 2019. # msgid "" msgstr "" diff --git a/po/r-novice-gapminder.ja.po b/po/r-novice-gapminder.ja.po index 926c97c0..815f4bd7 100644 --- a/po/r-novice-gapminder.ja.po +++ b/po/r-novice-gapminder.ja.po @@ -1,14 +1,14 @@ # Japanese translation of the Software Carpentry R for Reproducible Scientific Analysis Lesson -# Copyright (C) 2018 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. -# Software-Carpentry Japanese-Team , 2018. +# Software-Carpentry Japanese-Team , 2019. # msgid "" msgstr "" "Project-Id-Version: i18n\n" "Report-Msgid-Bugs-To: https://github.com/haiwen/seafile-docs/issues\n" "POT-Creation-Date: 2018-09-15 22:59:57+0900\n" -"PO-Revision-Date: 2018-12-08 11:28+0900\n" +"PO-Revision-Date: 2019-08-09 06:17+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -16,7 +16,6 @@ msgstr "" "Last-Translator: \n" "Language-Team: Japanese \n" "Language: ja\n" -"X-Generator: Poedit 2.2\n" # Front Matter #: r-novice-gapminder/CODE_OF_CONDUCT.md:1 @@ -691,7 +690,6 @@ msgstr "" "======================================" #: r-novice-gapminder/README.md:7 -#, fuzzy msgid "" "An introduction to R for non-programmers using the [Gapminder][gapminder] data.\n" "Please see for a rendered version of this material,\n" @@ -927,9 +925,9 @@ msgid "" "control and project management." msgstr "" "このレッスンではRStudioを使います。RStudioは、無料であり、Rを組み込んだオープンソースの\n" -"開発環境です。RStudioには、全てのプラットフォーム(サーバーも含む)で起動できるエディタ\n" +"総合開発環境(IDE: Integrated Development Environment)です。RStudioは、全てのプラットフォーム(サーバーも含む)で起動できること、\n" "エディタが組み込まれていることや、プロジェクト管理やバージョン管理にも対応しているなど、\n" -"良いところがいっぱいあります。" +"良いところがいっぱいがあります。" #: r-novice-gapminder/_episodes/01-rstudio-intro.md:68 msgid "**Basic layout**" @@ -952,7 +950,7 @@ msgstr " * 環境/履歴(右上のタブ形式)" # unordered list #: r-novice-gapminder/_episodes/01-rstudio-intro.md:74 msgid " * Files/Plots/Packages/Help/Viewer (tabbed in lower right)" -msgstr " * ファイル/プロット/パッケージ/ヘルプ/ビューワー(右下のタブ形式)" +msgstr " * Files/Plots/Packages/Help/Viewer(右下のタブ形式)" #: r-novice-gapminder/_episodes/01-rstudio-intro.md:76 msgid "![RStudio layout](../fig/01-rstudio.png)" @@ -1663,7 +1661,7 @@ msgid "" "And R will print out the answer, with a preceding \"[1]\". Don't worry about this\n" "for now, we'll explain that later. For now think of it as indicating output." msgstr "" -"するとRは、「[1]」の後に回答を表示します。詳しくは後で説明するので、\n" +"するとRは、「[1]」の後に回答を表示します。「[1]」については後で説明するので、\n" "今は気にしなくても大丈夫です。今のところ、出力されたものを示すものだと思ってください。" #: r-novice-gapminder/_episodes/01-rstudio-intro.md:150 @@ -2188,6 +2186,7 @@ msgstr "" "> 以外では、2数の比較に決して `==` を使わないこと。\n" ">\n" "> コンピュータは、小数点以下の数を限られた精度でしか示せません。\n" + "> かもしれません。すると、二つの数がRで同じように表示されても\n" "> 実際は、その背後で異なる形で表されており、したがって\n" "> ごくわずかな誤差(機械の数値許容範囲)があるかもしれません。\n" @@ -2992,7 +2991,7 @@ msgid "" "network). R and RStudio have functionality for managing packages:" msgstr "" "パッケージを書くか、誰かが書いたパッケージを使って、Rに関数を加えることができます。\n" -"今現在CRAN (the comprehensive R archive network)上にある\n" +"今現在CRAN (the comprehensive R archive network)上にある\n" "10,000 を越えるパッケージが使用可能です。RとRStudioには、パッケージを管理する機能があります:" # unordered list @@ -3011,10 +3010,10 @@ msgid "" msgstr "" " `installed.packages()`\n" "* パッケージをインストールするには、`install.packages(\"packagename\")`を入力します\n" -" ここで、`packagename`は、用いる引用符付きのパッケージ名です。\n" -"* インストールしたパッケージの更新には、`update.packages()`を入力します。\n" -"* パッケージの削除には、`remove.packages(\"packagename\")`を入力します。\n" -"* 使用できるパッケージを用いるには、`library(packagename)`を入力します。" +" ここで、`packagename`は、用いる引用符付きのパッケージ名です\n" +"* インストールしたパッケージの更新には、`update.packages()`を入力します\n" +"* パッケージの削除には、`remove.packages(\"packagename\")`を入力します\n" +"* 使用できるパッケージを用いるには、`library(packagename)`を入力します" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/01-rstudio-intro.md:781 @@ -3303,7 +3302,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/02-project-intro.md:21 msgid "## Introduction" -msgstr "## Introduction" +msgstr "## はじめに" #: r-novice-gapminder/_episodes/02-project-intro.md:23 msgid "" @@ -3311,9 +3310,9 @@ msgid "" "start life as random notes, some code, then a manuscript, and\n" "eventually everything is a bit mixed together." msgstr "" -"The scientific process is naturally incremental, and many projects\n" -"start life as random notes, some code, then a manuscript, and\n" -"eventually everything is a bit mixed together." +"科学的なプロセスは、徐々に進んでいくものです。プロジェクトの多くは、\n" +"計画性のないメモやいくつかのコードから始まります。そして、原案ができ、\n" +"最終的に、全てが少しづつ混ざり合ってまとまっていくのです。" #: r-novice-gapminder/_episodes/02-project-intro.md:27 msgid "" @@ -3325,7 +3324,7 @@ msgstr "" #: r-novice-gapminder/_episodes/02-project-intro.md:30 msgid "Most people tend to organize their projects like this:" -msgstr "Most people tend to organize their projects like this:" +msgstr "大抵の人達は、次のようにプロジェクトを整理する傾向にあります:" #: r-novice-gapminder/_episodes/02-project-intro.md:32 msgid "![](../fig/bad_layout.png)" @@ -3333,12 +3332,12 @@ msgstr "![](../fig/bad_layout.png)" #: r-novice-gapminder/_episodes/02-project-intro.md:34 msgid "There are many reasons why we should *ALWAYS* avoid this:" -msgstr "There are many reasons why we should *ALWAYS* avoid this:" +msgstr "このようなことを*絶対*避けるべき理由はいくつもあります:" # ordered list #: r-novice-gapminder/_episodes/02-project-intro.md:36 msgid "1. It is really hard to tell which version of your data is" -msgstr "1. It is really hard to tell which version of your data is" +msgstr "1. データのどのバージョンが原本か修正版かを判別することが、とても難しくなります" #: r-novice-gapminder/_episodes/02-project-intro.md:37 msgid "" @@ -3349,26 +3348,25 @@ msgid "" "things, and relate the correct figures to the exact code\n" "that has been used to generate it;" msgstr "" -"the original and which is the modified;\n" -"2. It gets really messy because it mixes files with various\n" -"extensions together;\n" -"3. It probably takes you a lot of time to actually find\n" -"things, and relate the correct figures to the exact code\n" -"that has been used to generate it;" +"1. どれが原本でどれが修正した版のデータか判別するのがとても難しくなる\n" +"2. 幾つもの拡張子の異なるファイルを一緒に混ぜ合わせるため、\n" +"とてもごちゃごちゃしてくる\n" +"3. 探しているものを見つけたり、正しい図とその図を出力する\n" +"コードの対応が分かるようになるのに、時間がかかる" #: r-novice-gapminder/_episodes/02-project-intro.md:44 msgid "A good project layout will ultimately make your life easier:" -msgstr "A good project layout will ultimately make your life easier:" +msgstr "プロジェクトのレイアウトが良ければ、最終的に自分が楽になる" # unordered list #: r-novice-gapminder/_episodes/02-project-intro.md:46 msgid "* It will help ensure the integrity of your data;" -msgstr "* It will help ensure the integrity of your data;" +msgstr "* 自分のデータの整合性を保つ助けになる" # unordered list #: r-novice-gapminder/_episodes/02-project-intro.md:47 msgid "* It makes it simpler to share your code with someone else" -msgstr "* It makes it simpler to share your code with someone else" +msgstr "* 誰か(研究室の仲間、協力者または監督者)と、コードをシェアすることが簡単になります" #: r-novice-gapminder/_episodes/02-project-intro.md:48 msgid "" @@ -3376,18 +3374,17 @@ msgid "" "* It allows you to easily upload your code with your manuscript submission;\n" "* It makes it easier to pick the project back up after a break." msgstr "" -"(a lab-mate, collaborator, or supervisor);\n" -"* It allows you to easily upload your code with your manuscript submission;\n" -"* It makes it easier to pick the project back up after a break." +"* 原稿の提出と一緒に自分のコードを簡単にアップロードできる\n" +"* しばらく手をつけていなくても、簡単にプロジェクトを再開できる" # header #: r-novice-gapminder/_episodes/02-project-intro.md:52 msgid "## A possible solution" -msgstr "## A possible solution" +msgstr "## 考えられる解決策" #: r-novice-gapminder/_episodes/02-project-intro.md:54 msgid "Fortunately, there are tools and packages which can help you manage your work effectively." -msgstr "Fortunately, there are tools and packages which can help you manage your work effectively." +msgstr "幸いなことに、効果的な作業管理を助けるツールやパッケージがあります" #: r-novice-gapminder/_episodes/02-project-intro.md:56 msgid "" @@ -3395,14 +3392,13 @@ msgid "" "functionality. We'll be using this today to create a self-contained, reproducible\n" "project." msgstr "" -"One of the most powerful and useful aspects of RStudio is its project management\n" -"functionality. We'll be using this today to create a self-contained, reproducible\n" -"project." +"RStudioの最も有能て使えるもののひとつとして、プロジェクト管理機能が挙げられます。\n" +"今日では、必要なものが揃い、再現可能なプロジェクトを作成するために、これが使われているのでしょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:61 msgid "> ## Challenge: Creating a self-contained project" -msgstr "> ## Challenge: Creating a self-contained project" +msgstr "> ## チャレンジ:必要なものが揃ったプロジェクトを作成する" #: r-novice-gapminder/_episodes/02-project-intro.md:62 msgid "" @@ -3417,40 +3413,40 @@ msgid "" "> 6. Click the \"Create Project\" button." msgstr "" ">\n" -"> We're going to create a new project in RStudio:\n" +"> RStudioで新しいプロジェクトを作成しよう:\n" ">\n" -"> 1. Click the \"File\" menu button, then \"New Project\".\n" -"> 2. Click \"New Directory\".\n" -"> 3. Click \"Empty Project\".\n" -"> 4. Type in the name of the directory to store your project, e.g. \"my_project\".\n" -"> 5. If available, select the checkbox for \"Create a git repository.\"\n" -"> 6. Click the \"Create Project\" button." +"> 1. \"File\" メニューボタンをクリックし、\"New Project\"をクリック\n" +"> 2. \"New Directory\"をクリック\n" +"> 3. \"Empty Project\"をクリック\n" +"> 4. プロジェクトを保存するディレクトリの名前をタイプ(例 \"my_project\")\n" +"> 5. 可能なら、\"Create a git repository\"のチェックボックスを選択\n" +"> 6. \"Create Project\" ボタンをクリック" #: r-novice-gapminder/_episodes/02-project-intro.md:73 msgid "" "Now when we start R in this project directory, or open this project with RStudio,\n" "all of our work on this project will be entirely self-contained in this directory." msgstr "" -"Now when we start R in this project directory, or open this project with RStudio,\n" -"all of our work on this project will be entirely self-contained in this directory." +"このプロジェクトのディレクトリでRをスタートする、またはRStudioでこのプロジェクトを開けば、\n" +"このプロジェクトについての全てのファイルは、このディレクトリにこれで全て揃うことになります。" # header #: r-novice-gapminder/_episodes/02-project-intro.md:76 msgid "## Best practices for project organization" -msgstr "## Best practices for project organization" +msgstr "## プロジェクト管理の最適なやり方" #: r-novice-gapminder/_episodes/02-project-intro.md:78 msgid "" "Although there is no \"best\" way to lay out a project, there are some general\n" "principles to adhere to that will make project management easier:" msgstr "" -"Although there is no \"best\" way to lay out a project, there are some general\n" -"principles to adhere to that will make project management easier:" +"プロジェクトのレイアウトに「最適」な方法はありませんが、これを守れば、\n" +"プロジェクト管理が簡単になるだろうという一般的な原則がいくつかあります:" # header #: r-novice-gapminder/_episodes/02-project-intro.md:81 msgid "### Treat data as read only" -msgstr "### Treat data as read only" +msgstr "### データは読み込み専用にしましょう" #: r-novice-gapminder/_episodes/02-project-intro.md:83 msgid "" @@ -3460,16 +3456,16 @@ msgid "" "sure of where the data came from, or how it has been modified since collection.\n" "It is therefore a good idea to treat your data as \"read-only\"." msgstr "" -"This is probably the most important goal of setting up a project. Data is\n" -"typically time consuming and/or expensive to collect. Working with them\n" -"interactively (e.g., in Excel) where they can be modified means you are never\n" -"sure of where the data came from, or how it has been modified since collection.\n" -"It is therefore a good idea to treat your data as \"read-only\"." +"プロジェクトを始めるにあたって、これが多分一番重要なゴールかもしれません。\n" +"データ収集には、多くの時間と費用のいずれか、または両方が掛かることが多いものです。\n" +"データの修正も行える形で読込みも書込みもできる作業(例えば、エクセル)をすると、\n" +"データがどこからきたか、または収集されてからどう修正されてきたかが分からなくなります。\n" +"ですから、データは「読み込むだけ」のものと扱うのがよいというわけです。" # header #: r-novice-gapminder/_episodes/02-project-intro.md:89 msgid "### Data Cleaning" -msgstr "### Data Cleaning" +msgstr "### データクリーニング" #: r-novice-gapminder/_episodes/02-project-intro.md:91 msgid "" @@ -3479,24 +3475,24 @@ msgid "" "in a separate folder, and create a second \"read-only\" data folder to hold the\n" "\"cleaned\" data sets." msgstr "" -"In many cases your data will be \"dirty\": it will need significant preprocessing\n" -"to get into a format R (or any other programming language) will find useful. This\n" -"task is sometimes called \"data munging\". I find it useful to store these scripts\n" -"in a separate folder, and create a second \"read-only\" data folder to hold the\n" -"\"cleaned\" data sets." +"多くの場合、データは「汚れて」います:\n" +"R(または、他のプログラミング言語)が使える形にするためには、かなりの前処理が必要となるでしょう。\n" +"この作業は、「データ・マンジング」と呼ばれることもあります。 前処理で書いたコードは、\n" +"違うフォルダに保存し、「きれいにした」データセットをこのフォルダに\n" +"置くと便利です。" # header #: r-novice-gapminder/_episodes/02-project-intro.md:97 msgid "### Treat generated output as disposable" -msgstr "### Treat generated output as disposable" +msgstr "### 生成されたアウトプットを捨てても良いようにしましょう" #: r-novice-gapminder/_episodes/02-project-intro.md:99 msgid "" "Anything generated by your scripts should be treated as disposable: it should\n" "all be able to be regenerated from your scripts." msgstr "" -"Anything generated by your scripts should be treated as disposable: it should\n" -"all be able to be regenerated from your scripts." +"書いたものから生成されたものは、全て捨てても良いものにしましょう。\n" +"つまり、書いたものから生成できるようにしましょう。" #: r-novice-gapminder/_episodes/02-project-intro.md:102 msgid "" @@ -3506,16 +3502,15 @@ msgid "" "and don't end up being used in the final project, and some of the analyses\n" "get shared between projects." msgstr "" -"There are lots of different ways to manage this output. I find it useful to\n" -"have an output folder with different sub-directories for each separate\n" -"analysis. This makes it easier later, as many of my analyses are exploratory\n" -"and don't end up being used in the final project, and some of the analyses\n" -"get shared between projects." +"アウトプットを管理する方法は様々です。便利なのは、アウトプットフォルダを作り、\n" +"そこへ分析ごとに作ったサブディレクトリを保存する方法です。\n" +"そうすると後々楽になります。多くの分析は探索的なもので、\n" +"最終的なプロジェクトでは使われませんが、なかにはプロジェクト間で共有される分析もあるからです。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:108 msgid "> ## Tip: Good Enough Practices for Scientific Computing" -msgstr "> ## Tip: Good Enough Practices for Scientific Computing" +msgstr "> ## ヒント:科学的演算の良いと言えるやり方" #: r-novice-gapminder/_episodes/02-project-intro.md:109 msgid "" @@ -3530,23 +3525,23 @@ msgid "" ">" msgstr "" ">\n" -"> [Good Enough Practices for Scientific Computing](https://github.com/swcarpentry/good-enough-practices-in-scientific-computing/blob/gh-pages/good-enough-practices-for-scientific-computing.pdf) gives the following recommendations for project organization:\n" +"> [Good Enough Practices for Scientific Computing(科学的演算の良いと言えるやり方)](https://github.com/swcarpentry/good-enough-practices-in-scientific-computing/blob/gh-pages/good-enough-practices-for-scientific-computing.pdf) プロジェクトの整理について薦めていることは以下のとおりです。\n" ">\n" -"> 1. Put each project in its own directory, which is named after the project.\n" -"> 2. Put text documents associated with the project in the `doc` directory.\n" -"> 3. Put raw data and metadata in the `data` directory, and files generated during cleanup and analysis in a `results` directory.\n" -"> 4. Put source for the project's scripts and programs in the `src` directory, and programs brought in from elsewhere or compiled locally in the `bin` directory.\n" -"> 5. Name all files to reflect their content or function.\n" +"> 1. それぞれのプロジェクトを独自のディレクトリに置き、プロジェクトから取った名前をつける\n" +"> 2. プロジェクトに関連するテキスト文書を `doc` ディレクトリに置く\n" +"> 3. 生のデータとメタデータを`data`のディレクトリに置き、クリーンアップで生成されたファイルと分析に使ったファイルを `results` ディレクトリに置く\n" +"> 4. プロジェクトで書いたスクリプトとプログラムのソースは、`src` ディレクトリに、違うところから持ってきた、またはローカルで変換されたものは `bin` ディレクトリに置く\n" +"> 5. 全てのファイルを中身や機能を反映する形で名づけること\n" ">" # header #: r-novice-gapminder/_episodes/02-project-intro.md:120 msgid "### Separate function definition and application" -msgstr "### Separate function definition and application" +msgstr "### 関数の定義と適応を分けましょう" #: r-novice-gapminder/_episodes/02-project-intro.md:122 msgid "One of the more effective ways to work with R is to start by writing the code you want to run directly in an .R script, and then running the selected lines (either using the keyboard shortcuts in RStudio or clicking the \"Run\" button) in the interactive R console." -msgstr "One of the more effective ways to work with R is to start by writing the code you want to run directly in an .R script, and then running the selected lines (either using the keyboard shortcuts in RStudio or clicking the \"Run\" button) in the interactive R console." +msgstr "Rで作業するより効果的な方法のひとつは、まず走らせたいコードを直接.Rスクリプトに書き、それから選択した行をインタラクティブなRコンソールで(RStudioのショートカットキーを使うか、「Run」ボタンをクリックして)走らせることです。" #: r-novice-gapminder/_episodes/02-project-intro.md:124 msgid "" @@ -3556,16 +3551,14 @@ msgid "" "to store useful functions that you'll reuse across analyses and projects, and\n" "one to store the analysis scripts." msgstr "" -"When your project is in its early stages, the initial .R script file usually contains many lines\n" -"of directly executed code. As it matures, reusable chunks get pulled into their\n" -"own functions. It's a good idea to separate these functions into two separate folders; one\n" -"to store useful functions that you'll reuse across analyses and projects, and\n" -"one to store the analysis scripts." +"プロジェクトの初期段階では、最初の.Rスクリプトファイルには直接実行されるコードの行が多数あるものです。\n" +"プロジェクトが進むにつれて、何度も使える部分は、独自の関数としてまとめられます。\n" +"これらの関数を、色々なプロジェクトや分析で使える関数を保存するフォルダと、この分析のスクリプトを保存するフォルダの2つの異なるフォルダに分けるとよいでしょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:130 msgid "> ## Tip: avoiding duplication" -msgstr "> ## Tip: avoiding duplication" +msgstr "> ## ヒント: 重複を防ぐ" #: r-novice-gapminder/_episodes/02-project-intro.md:131 msgid "" @@ -3580,28 +3573,26 @@ msgid "" "> use the `mklink` command from the windows terminal." msgstr "" ">\n" -"> You may find yourself using data or analysis scripts across several projects.\n" -"> Typically you want to avoid duplication to save space and avoid having to\n" -"> make updates to code in multiple places.\n" +"> 複数のプロジェクトで、同じデータや分析のスクリプトを使っていることに気づくことがあるかもしれません\n" +"> 普通は、複数の場所でコードを更新しなければいけない状況を避ける、または省スペースのため、重複を避けようとするでしょう。\n" ">\n" -"> In this case I find it useful to make \"symbolic links\", which are essentially\n" -"> shortcuts to files somewhere else on a filesystem. On Linux and OS X you can\n" -"> use the `ln -s` command, and on Windows you can either create a shortcut or\n" -"> use the `mklink` command from the windows terminal." +"> この場合、ファイルシステム上で別の場所にあるファイルへのショートカットとして「symbolic links」を使うとよいでしょう。\n" +"> Linux 及び OS X では、`ln -s` コマンドで、Windowsでは、Windowsのターミナルから`mklink` コマンドで、\n" +"> ショートカットを作ることができます。" # header #: r-novice-gapminder/_episodes/02-project-intro.md:142 msgid "### Save the data in the data directory" -msgstr "### Save the data in the data directory" +msgstr "### データディレクトリにデータを保存しましょう" #: r-novice-gapminder/_episodes/02-project-intro.md:144 msgid "Now we have a good directory structure we will now place/save the data file in the `data/` directory." -msgstr "Now we have a good directory structure we will now place/save the data file in the `data/` directory." +msgstr "よいディレクトリ構造ができた後は、データファイルを `data/` ディレクトリに置く、または保管しましょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:147 msgid "> Download the gapminder data from [here](https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_wide.csv)." -msgstr "> Download the gapminder data from [here](https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_wide.csv)." +msgstr "> ギャップマインダーのデータを[ここから](https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_wide.csv)ダウンロードしましょう" #: r-novice-gapminder/_episodes/02-project-intro.md:148 msgid "" @@ -3613,46 +3604,46 @@ msgid "" "> We will load and inspect these data later." msgstr "" ">\n" -"> 1. Download the file (CTRL + S, right mouse click -> \"Save as\", or File -> \"Save page as\")\n" -"> 2. Make sure it's saved under the name `gapminder_data.csv`\n" -"> 3. Save the file in the `data/` folder within your project.\n" +"> 1. ファイルをダウンロードする(CTRL + S、右マウスクリック -> 「名前を付けて保存する」、またはファイル -> 「ページを名前を付けて保存する」)\n" +"> 2. 確実に `gapminder_data.csv` という名前で保存しましょう\n" +"> 3. プロジェクトの中にある `data/` フォルダに保存しましょう\n" ">\n" -"> We will load and inspect these data later." +"> このデータは後で読み込んで色々調べます" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:157 msgid "> It is useful to get some general idea about the dataset, directly from the" -msgstr "> It is useful to get some general idea about the dataset, directly from the" +msgstr "> Rに読み込む前に、コマンドラインから直接、データセットの概要を得ておくといいでしょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:158 msgid "> command line, before loading it into R. Understanding the dataset better" -msgstr "> command line, before loading it into R. Understanding the dataset better" +msgstr "> データセットをよりよく理解しておくと、データセットをどうRに読み込むか決める際に役に立ちます。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:159 msgid "> will come in handy when making decisions on how to load it in R. Use the command-line" -msgstr "> will come in handy when making decisions on how to load it in R. Use the command-line" +msgstr "> シェルのコマンドラインを使って、次の問題に答えて下さい:" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:160 msgid "> shell to answer the following questions:" -msgstr "> shell to answer the following questions:" +msgstr ">" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:161 msgid "> 1. What is the size of the file?" -msgstr "> 1. What is the size of the file?" +msgstr "> 1. ファイルのサイズは何ですか?" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:162 msgid "> 2. How many rows of data does it contain?" -msgstr "> 2. How many rows of data does it contain?" +msgstr "> 2. データは何列入っていますか?" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:163 msgid "> 3. What kinds of values are stored in this file?" -msgstr "> 3. What kinds of values are stored in this file?" +msgstr "> 3. ファイルには、どのような値が保存されていますか?" #: r-novice-gapminder/_episodes/02-project-intro.md:164 msgid "" @@ -3712,9 +3703,9 @@ msgid "" "> > {: .output}" msgstr "" ">\n" -"> > ## Solution to Challenge 2\n" +"> > ## チャレンジ2の解答\n" "> >\n" -"> > By running these commands in the shell:\n" +"> > 以下のコマンドをシェルで実行すれば答えられます:\n" "> > \n" "> > ~~~\n" "> > ls -lh data/gapminder_data.csv\n" @@ -3728,7 +3719,7 @@ msgstr "" "> > -rw-r--r-- 1 naupaka staff 80K Sep 2 15:54 data/gapminder_data.csv\n" "> > ~~~\n" "> > {: .output}\n" -"> > The file size is 80K.\n" +"> > ファイルサイズは、80K\n" "> > \n" "> > ~~~\n" "> > wc -l data/gapminder_data.csv\n" @@ -3742,7 +3733,7 @@ msgstr "" "> > 1705 data/gapminder_data.csv\n" "> > ~~~\n" "> > {: .output}\n" -"> > There are 1705 lines. The data looks like:\n" +"> > 1705行あり、データは次のような形をしています:\n" "> > \n" "> > ~~~\n" "> > head data/gapminder_data.csv\n" @@ -3769,7 +3760,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/02-project-intro.md:221 msgid "> ## Tip: command line in R Studio" -msgstr "> ## Tip: command line in R Studio" +msgstr "> ## ヒント:R Studioのコマンドライン" #: r-novice-gapminder/_episodes/02-project-intro.md:222 msgid "" @@ -3777,16 +3768,16 @@ msgid "" "> You can quickly open up a shell in RStudio using the **Tools -> Shell...** menu item." msgstr "" ">\n" -"> You can quickly open up a shell in RStudio using the **Tools -> Shell...** menu item." +"> RStudioでは、メニュー項目の**Tools -> Shell...**を使って、シェルを素早く開くことができます。" # header #: r-novice-gapminder/_episodes/02-project-intro.md:226 msgid "### Version Control" -msgstr "### Version Control" +msgstr "### バージョン・コントロール" #: r-novice-gapminder/_episodes/02-project-intro.md:228 msgid "It is important to use version control with projects. Go [here for a good lesson which describes using Git with RStudio](https://swcarpentry.github.io/git-novice/14-supplemental-rstudio/)." -msgstr "It is important to use version control with projects. Go [here for a good lesson which describes using Git with RStudio](https://swcarpentry.github.io/git-novice/14-supplemental-rstudio/)." +msgstr "プロジェクトでは、バージョン・コントロールを使うことが重要です。 [RStudioでGitを使う良いレッスン](https://swcarpentry.github.io/git-novice/14-supplemental-rstudio/)を参照して下さい。" # Front Matter #: r-novice-gapminder/_episodes/03-seeking-help.md:1 @@ -3828,7 +3819,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/03-seeking-help.md:20 msgid "## Reading Help files" -msgstr "## Reading Help files" +msgstr "## ヘルプファイルを読む" #: r-novice-gapminder/_episodes/03-seeking-help.md:22 msgid "" @@ -3836,9 +3827,9 @@ msgid "" "function, \"function_name\", from a specific function that is in a package loaded into your\n" "namespace (your interactive R session):" msgstr "" -"R, and every package, provide help files for functions. The general syntax to search for help on any\n" -"function, \"function_name\", from a specific function that is in a package loaded into your\n" -"namespace (your interactive R session):" +"R、そしてその他のパッケージには、関数のヘルプファイルが用意されています。\n" +"一般的な関数のヘルプを検索する構文は、(インタラクティブなRセッションで)自分の名前空間に読み込まれた\n" +"パッケージに存在する特定の関数名、「function_name」を以下のように使って下さい:" # code block #: r-novice-gapminder/_episodes/03-seeking-help.md:27 @@ -3855,55 +3846,55 @@ msgstr "" #: r-novice-gapminder/_episodes/03-seeking-help.md:33 msgid "This will load up a help page in RStudio (or as plain text in R by itself)." -msgstr "This will load up a help page in RStudio (or as plain text in R by itself)." +msgstr "これで、RStudioにヘルプページ(Rの場合は、画面に簡素なテキスト)が表示されます" #: r-novice-gapminder/_episodes/03-seeking-help.md:35 msgid "Each help page is broken down into sections:" -msgstr "Each help page is broken down into sections:" +msgstr "それぞれのヘルプページは、セクションに分けられます:" # unordered list #: r-novice-gapminder/_episodes/03-seeking-help.md:37 msgid " - Description: An extended description of what the function does." -msgstr " - Description: An extended description of what the function does." +msgstr " - Description(説明):関数がすることの詳しい説明" # unordered list #: r-novice-gapminder/_episodes/03-seeking-help.md:38 msgid " - Usage: The arguments of the function and their default values." -msgstr " - Usage: The arguments of the function and their default values." +msgstr " - Usage(使い方):関数の引数及びデフォルトの値" # unordered list #: r-novice-gapminder/_episodes/03-seeking-help.md:39 msgid " - Arguments: An explanation of the data each argument is expecting." -msgstr " - Arguments: An explanation of the data each argument is expecting." +msgstr " - Arguments(引数):それぞれの引数が取りうるデータの説明" # unordered list #: r-novice-gapminder/_episodes/03-seeking-help.md:40 msgid " - Details: Any important details to be aware of." -msgstr " - Details: Any important details to be aware of." +msgstr " - Details(詳細):気を付けるべき重要な詳細" # unordered list #: r-novice-gapminder/_episodes/03-seeking-help.md:41 msgid " - Value: The data the function returns." -msgstr " - Value: The data the function returns." +msgstr " - Value(値):関数が返すデータ" # unordered list #: r-novice-gapminder/_episodes/03-seeking-help.md:42 msgid " - See Also: Any related functions you might find useful." -msgstr " - See Also: Any related functions you might find useful." +msgstr " - See Also(ついでにこっちも):他に役立ちそうな関連する関数" # unordered list #: r-novice-gapminder/_episodes/03-seeking-help.md:43 msgid " - Examples: Some examples for how to use the function." -msgstr " - Examples: Some examples for how to use the function." +msgstr " - Examples(例):関数の使い方の例" #: r-novice-gapminder/_episodes/03-seeking-help.md:45 msgid "Different functions might have different sections, but these are the main ones you should be aware of." -msgstr "Different functions might have different sections, but these are the main ones you should be aware of." +msgstr "関数によって、違うセクションがあるかもしれませんが、知っておくべき主要なものは以上でしょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:47 msgid "> ## Tip: Reading help files" -msgstr "> ## Tip: Reading help files" +msgstr "> ## ヒント:ヘルプファイルを読む" #: r-novice-gapminder/_episodes/03-seeking-help.md:48 msgid "" @@ -3914,19 +3905,18 @@ msgid "" "> mean you don't have to!" msgstr "" ">\n" -"> One of the most daunting aspects of R is the large number of functions\n" -"> available. It would be prohibitive, if not impossible to remember the\n" -"> correct usage for every function you use. Luckily, the help files\n" -"> mean you don't have to!" +"> Rの気が滅入る点は、多くの関数があるという点です。\n" +"> 自分が使う全ての関数の正しい使い方を覚えるのは不可能とまでは言いませんが、かなり大変でしょう。\n" +"> ありがたいことに、ヘルプファイルのおかげで、そんなことをせずに済むのです。" # header #: r-novice-gapminder/_episodes/03-seeking-help.md:55 msgid "## Special Operators" -msgstr "## Special Operators" +msgstr "## 特別な演算子" #: r-novice-gapminder/_episodes/03-seeking-help.md:57 msgid "To seek help on special operators, use quotes:" -msgstr "To seek help on special operators, use quotes:" +msgstr "特別な演算子を検索するためには、引用符を使いましょう:" # code block #: r-novice-gapminder/_episodes/03-seeking-help.md:60 @@ -3942,7 +3932,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/03-seeking-help.md:65 msgid "## Getting help on packages" -msgstr "## Getting help on packages" +msgstr "## パッケージについてのヘルプを入手する" #: r-novice-gapminder/_episodes/03-seeking-help.md:67 msgid "" @@ -3951,27 +3941,25 @@ msgid "" "`vignette(package=\"package-name\")` will list all available vignettes for\n" "`package-name`, and `vignette(\"vignette-name\")` will open the specified vignette." msgstr "" -"Many packages come with \"vignettes\": tutorials and extended example documentation.\n" -"Without any arguments, `vignette()` will list all vignettes for all installed packages;\n" -"`vignette(package=\"package-name\")` will list all available vignettes for\n" -"`package-name`, and `vignette(\"vignette-name\")` will open the specified vignette." +"多くのパッケージには、「ビニエット(vignette)」があります。これは、使い方の説明や詳細な例を掲載する資料です。\n" +"引数なしに、`vignette()` と入力すると、インストールされているパッケージの全てのビニエットの一覧が表示されます。\n" +"`vignette(package=\"package-name\")` と入力すると、`package-name`についての全てのビニエットの一覧が表示され、\n" +"`vignette(\"vignette-name\")` と入力すると、指定されたビニエットが開きます。" #: r-novice-gapminder/_episodes/03-seeking-help.md:72 msgid "" "If a package doesn't have any vignettes, you can usually find help by typing\n" "`help(\"package-name\")`." -msgstr "" -"If a package doesn't have any vignettes, you can usually find help by typing\n" -"`help(\"package-name\")`." +msgstr "もしパッケージにビニエットがひとつもない場合、通常 `help(\"package-name\")` と入力するとヘルプが表示されます。" # header #: r-novice-gapminder/_episodes/03-seeking-help.md:75 msgid "## When you kind of remember the function" -msgstr "## When you kind of remember the function" +msgstr "## うすら覚えの関数の場合" #: r-novice-gapminder/_episodes/03-seeking-help.md:77 msgid "If you're not sure what package a function is in, or how it's specifically spelled you can do a fuzzy search:" -msgstr "If you're not sure what package a function is in, or how it's specifically spelled you can do a fuzzy search:" +msgstr "関数がどのパッケージに入っているか、またはスペルが定かではないとき、あいまい検索をすることもできます:" # code block #: r-novice-gapminder/_episodes/03-seeking-help.md:80 @@ -3987,7 +3975,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/03-seeking-help.md:85 msgid "## When you have no idea where to begin" -msgstr "## When you have no idea where to begin" +msgstr "## どうしていいか分からない場合" #: r-novice-gapminder/_episodes/03-seeking-help.md:87 msgid "" @@ -3996,15 +3984,14 @@ msgid "" "is a specially maintained list of packages grouped into\n" "fields. This can be a good starting point." msgstr "" -"If you don't know what function or package you need to use\n" -"[CRAN Task Views](http://cran.at.r-project.org/web/views)\n" -"is a specially maintained list of packages grouped into\n" -"fields. This can be a good starting point." +"関数やパッケージが分からない場合、[CRAN Task Views](http://cran.at.r-project.org/web/views)という\n" +"分野ごとにまとめられたパッケージのリストがあります。\n" +"このページから探し始めるといいかもしれません。" # header #: r-novice-gapminder/_episodes/03-seeking-help.md:92 msgid "## When your code doesn't work: seeking help from your peers" -msgstr "## When your code doesn't work: seeking help from your peers" +msgstr "## コードがうまく動作しない:仲間の助けが必要な場合" #: r-novice-gapminder/_episodes/03-seeking-help.md:94 msgid "" @@ -4013,18 +4000,17 @@ msgid "" "[Stack Overflow](http://stackoverflow.com/). You can search using\n" "the `[r]` tag." msgstr "" -"If you're having trouble using a function, 9 times out of 10,\n" -"the answers you are seeking have already been answered on\n" -"[Stack Overflow](http://stackoverflow.com/). You can search using\n" -"the `[r]` tag." +"関数がうまく動かない場合、十中八九、探している問の答えは、\n" +"[Stack Overflow](http://stackoverflow.com/)に掲載されいます。\n" +"`[r]` タグを使って検索ができます。" #: r-novice-gapminder/_episodes/03-seeking-help.md:99 msgid "" "If you can't find the answer, there are a few useful functions to\n" "help you ask a question from your peers:" msgstr "" -"If you can't find the answer, there are a few useful functions to\n" -"help you ask a question from your peers:" +"もし答えが見つからない場合、仲間に質問をする際に\n" +"役に立つ関数がいくつかあります:" # code block #: r-novice-gapminder/_episodes/03-seeking-help.md:103 @@ -4042,8 +4028,8 @@ msgid "" "Will dump the data you're working with into a format so that it can\n" "be copy and pasted by anyone else into their R session." msgstr "" -"Will dump the data you're working with into a format so that it can\n" -"be copy and pasted by anyone else into their R session." +"これで、あなたが使っているデータを誰にでもコピー・アンド・ペーストしてRセッションで使える\n" +"形式にすることができます。" # code block #: r-novice-gapminder/_episodes/03-seeking-help.md:112 @@ -4111,9 +4097,8 @@ msgid "" "have loaded. This can be useful for others to help reproduce and debug\n" "your issue." msgstr "" -"Will print out your current version of R, as well as any packages you\n" -"have loaded. This can be useful for others to help reproduce and debug\n" -"your issue." +"これは、現在使っている R のバージョン、そして読み込まれている全てのパッケージを表示させる関数です。\n" +"他の人が問題点を再現し、バグを見つける際にこの情報が役立つこともあります。" #: r-novice-gapminder/_episodes/03-seeking-help.md:148 msgid "" @@ -4135,8 +4120,8 @@ msgid "" "> > the numeric values are \"coerced\" to be characters." msgstr "" ">\n" -"> Look at the help for the `c` function. What kind of vector do you\n" -"> expect you will create if you evaluate the following:\n" +"> それでは、`c` 関数のヘルプを見てみましょう。以下を演算した際、\n" +"> どのようなベクトルが作成されると思いますか:\n" "> \n" "> ~~~\n" "> c(1, 2, 3)\n" @@ -4146,10 +4131,10 @@ msgstr "" "> {: .language-r}\n" "> > ## Solution to Challenge 1\n" "> >\n" -"> > The `c()` function creates a vector, in which all elements are the\n" -"> > same type. In the first case, the elements are numeric, in the\n" -"> > second, they are characters, and in the third they are characters:\n" -"> > the numeric values are \"coerced\" to be characters." +"> > この `c()` 関数は、全ての要素が同じ型になるようにベクトルを生成します。\n" +"> > 最初の事例では、要素は整数型で、二番目の例では文字列型、\n" +"> > 三番目の例は文字列です。つまり、整数値は「強制的に」\n" +"> > 文字列に変換されるのです。" #: r-novice-gapminder/_episodes/03-seeking-help.md:168 msgid "" @@ -4233,26 +4218,25 @@ msgid "" "> > examples, or try `example('paste')`.)" msgstr "" ">\n" -"> Look at the help for the `paste` function. You'll need to use this later.\n" -"> What is the difference between the `sep` and `collapse` arguments?\n" +"> `paste` 関数のヘルプを見てみましょう。後でこれが必要になります。\n" +"> `sep` と `collapse` の引数の違いは何でしょうか?\n" ">\n" -"> > ## Solution to Challenge 2\n" +"> > ## チャレンジ2の解答\n" "> >\n" -"> > To look at the help for the `paste()` function, use:\n" +"> > `paste()` 関数のヘルプを見るには、以下を使いましょう:\n" "> > \n" "> > ~~~\n" "> > help(\"paste\")\n" "> > ?paste\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > The difference between `sep` and `collapse` is a little\n" -"> > tricky. The `paste` function accepts any number of arguments, each of which\n" -"> > can be a vector of any length. The `sep` argument specifies the string\n" -"> > used between concatenated terms — by default, a space. The result is a\n" -"> > vector as long as the longest argument supplied to `paste`. In contrast,\n" -"> > `collapse` specifies that after concatenation the elements are *collapsed*\n" -"> > together using the given separator, the result being a single string.\n" -"> > e.g. \n" +"> > `sep` と `collapse` の違いは、少しややこしいです。\n" +"> > `paste`の関数は、それぞれの長さには関係なく、引数をいくつも受け入れることができます。\n" +"> > `sep` の引数は、結合した文字の間に入る文字列を指定するもので、デフォルトはスペースです。\n" +"> > その結果、`paste` に与えられた一番長い引数の長さを持つベクトルが表示されます。\n" +"> > 一方、`collapse` は、指定された区切り値を用いて、結合された後の要素が*連結される*ことを指します。\n" +"> > その結果、一つの文字列が表示されます。\n" +"> > 例: \n" "> > \n" "> > ~~~\n" "> > paste(c(\"a\",\"b\"), \"c\")\n" @@ -4307,49 +4291,49 @@ msgstr "" "> > [1] \"a,c|b,c\"\n" "> > ~~~\n" "> > {: .output}\n" -"> > (For more information,\n" -"> > scroll to the bottom of the `?paste` help page and look at the\n" -"> > examples, or try `example('paste')`.)" +"> > (より詳細な情報は、\n" +"> > `?paste` のヘルプページの最下部にある例を参照するか、\n" +"> > `example('paste')`を試してみましょう)" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:250 msgid "> Use help to find a function (and its associated parameters) that you could" -msgstr "> Use help to find a function (and its associated parameters) that you could" +msgstr "> ヘルプを使って、列が「\t」(タブ)で区切られ、小数点が「.」(ピリオド)で分けられているcsvファイルを読み込む関数(及び関連する母数)を見つけて下さい。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:251 msgid "> use to load data from a csv file in which columns are delimited with \"\\t\"" -msgstr "> use to load data from a csv file in which columns are delimited with \"\\t\"" +msgstr "> csv fileファイルからデータを読み込むもので、列が「\\t」(タブ)で分けられていて、" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:252 msgid "> (tab) and the decimal point is a \".\" (period). This check for decimal" -msgstr "> (tab) and the decimal point is a \".\" (period). This check for decimal" +msgstr "> 国によって小数点を表す記号(コンマかピリオドか)が違うため、" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:253 msgid "> separator is important, especially if you are working with international" -msgstr "> separator is important, especially if you are working with international" +msgstr "> 小数点以下を分けている記号をチェックするのは、" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:254 msgid "> colleagues, because different countries have different conventions for the" -msgstr "> colleagues, because different countries have different conventions for the" +msgstr "> 様々な国の人達と作業をする際など、特に重要になります。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:255 msgid "> decimal point (i.e. comma vs period)." -msgstr "> decimal point (i.e. comma vs period)." +msgstr "> (つまり、コンマかピリオドかの違う)からです。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:256 msgid "> hint: use `??csv` to lookup csv related functions." -msgstr "> hint: use `??csv` to lookup csv related functions." +msgstr "> ヒント:csvに関係する関数として `??csv` を使いましょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:257 msgid "> > ## Solution to Challenge 3" -msgstr "> > ## Solution to Challenge 3" +msgstr "> > ## チャレンジ3の解答" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:258 @@ -4359,37 +4343,37 @@ msgstr "> >" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:259 msgid "> > The standard R function for reading tab-delimited files with a period" -msgstr "> > The standard R function for reading tab-delimited files with a period" +msgstr "> > 小数点がピリオドのタブで区切られたファイルを読む標準的なR関数は、" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:260 msgid "> > decimal separator is read.delim(). You can also do this with" -msgstr "> > decimal separator is read.delim(). You can also do this with" +msgstr "> > read.delim() です。他にも、" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:261 msgid "> > `read.table(file, sep=\"\\t\")` (the period is the *default* decimal" -msgstr "> > `read.table(file, sep=\"\\t\")` (the period is the *default* decimal" +msgstr "> > `read.table(file, sep=\"\\t\")` を使うことができます。`read.table()`では、ピリオドが、" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:262 msgid "> > separator for `read.table()`, although you may have to change" -msgstr "> > separator for `read.table()`, although you may have to change" +msgstr "> > *デフォルト*となっていますが、データにハッシュ(#)の文字がある場合などは、`comment.char` の引数を変更する必要があることもあります。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:263 msgid "> > the `comment.char` argument as well if your data file contains" -msgstr "> > the `comment.char` argument as well if your data file contains" +msgstr "> > 例えば、データにハッシュ(#)の文字がある場合" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/03-seeking-help.md:264 msgid "> > hash (#) characters" -msgstr "> > hash (#) characters" +msgstr "> > などです。" # header #: r-novice-gapminder/_episodes/03-seeking-help.md:268 msgid "## Other ports of call" -msgstr "## Other ports of call" +msgstr "## その他の参照先" # unordered list #: r-novice-gapminder/_episodes/03-seeking-help.md:270 @@ -4457,9 +4441,8 @@ msgid "" "such as you may already have in a spreadsheet or a CSV file. Let's start by\n" "making a toy dataset in your `data/` directory, called `feline-data.csv`:" msgstr "" -"One of R's most powerful features is its ability to deal with tabular data -\n" -"such as you may already have in a spreadsheet or a CSV file. Let's start by\n" -"making a toy dataset in your `data/` directory, called `feline-data.csv`:" +"Rのすごい特徴のひとつは、表形式のデータ(既に手元にあるようなスプレッドシートやCSVファイル)が扱えることです。\n" +"まず、 `data/` ディレクトリに `feline-data.csv` というお試しのデータセットを作ってみましょう。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:29 @@ -4484,7 +4467,7 @@ msgid "" "The contents of the new file, `feline-data.csv`:" msgstr "" "{: .language-r}\n" -"The contents of the new file, `feline-data.csv`:" +"新しいファイル `feline-data.csv` の内容:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:38 @@ -4506,7 +4489,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/04-data-structures-part1.md:46 msgid "> ## Tip: Editing Text files in R" -msgstr "> ## Tip: Editing Text files in R" +msgstr "> ## ヒント:Rを使ったテキスト形式のファイルの編集" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:47 msgid "" @@ -4515,12 +4498,12 @@ msgid "" "> or within RStudio with the **File -> New File -> Text File** menu item." msgstr "" ">\n" -"> Alternatively, you can create `data/feline-data.csv` using a text editor (Nano),\n" -"> or within RStudio with the **File -> New File -> Text File** menu item." +"> あるいは、テキストエディタ(Nano)またはをRStudioのメニューから**File -> New File -> Text File**を使って\n" +"> `data/feline-data.csv` を作成することができます。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:52 msgid "We can load this into R via the following:" -msgstr "We can load this into R via the following:" +msgstr "以下を使って作ったデータをRへ読み込ませることができます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:55 @@ -4565,23 +4548,23 @@ msgid "" "the most commonly used. If needed it is possible to override the default \n" "delimiting punctuation marks for both `read.csv` and `read.delim`." msgstr "" -"The `read.table` function is used for reading in tabular data stored in a text\n" -"file where the columns of data are separated by punctuation characters such as\n" -"CSV files (csv = comma-separated values). Tabs and commas are the most common\n" -"punctuation characters used to separate or delimit data points in csv files. \n" -"For convenience R provides 2 other versions of `read.table`. These are: `read.csv`\n" -"for files where the data are separated with commas and `read.delim` for files\n" -"where the data are separated with tabs. Of these three functions `read.csv` is\n" -"the most commonly used. If needed it is possible to override the default \n" -"delimiting punctuation marks for both `read.csv` and `read.delim`." +"この`read.table`関数は、CSVファイル(csv = comma-separated values)のように、\n" +"データの列が区読文字で分けられたテキストファイルに収められた表形式データを\n" +"読み込むために使われます。\n" +"タブとコンマは、csvファイルでデータ点を区切る、又は分けるために使われる\n" +"最も一般的な句読文字です。\n" +"便宜上、Rでは、他に2つの`read.table`のバージョンが提供されています。\n" +"ひとつは、データがコンマで分けられているファイルのための `read.csv` 、\n" +"データがタブで分けられているファイルのための `read.delim` です。\n" +"これら3つの関数のうち、`read.csv` が最も広く使われています。\n" +"必要であれば、 `read.csv` と `read.delim`、両方の\n" +"デフォルトの句読記号を置き換えることができます。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:82 msgid "" "We can begin exploring our dataset right away, pulling out columns by specifying\n" "them using the `$` operator:" -msgstr "" -"We can begin exploring our dataset right away, pulling out columns by specifying\n" -"them using the `$` operator:" +msgstr "演算子 `$` を使って列を指定し、列を抜き出すことで、すぐにデータセットの探索を始めることができます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:86 @@ -4634,7 +4617,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:113 msgid "We can do other operations on the columns:" -msgstr "We can do other operations on the columns:" +msgstr "列に他の操作をすることもできます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:116 @@ -4645,7 +4628,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"## Say we discovered that the scale weighs two Kg light:\n" +"## 計測器が実際の重さより2キロ少なく測っていることが分かったとしたら:\n" "cats$weight + 2\n" "~~~" @@ -4684,7 +4667,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:143 msgid "But what about" -msgstr "But what about" +msgstr "でも、こうしたらどうだろう" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:146 @@ -4723,12 +4706,12 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:166 msgid "Understanding what happened here is key to successfully analyzing data in R." -msgstr "Understanding what happened here is key to successfully analyzing data in R." +msgstr "ここで何が起こったかを理解することが、データをRでうまく分析する鍵となります。" # header #: r-novice-gapminder/_episodes/04-data-structures-part1.md:168 msgid "## Data Types" -msgstr "## Data Types" +msgstr "## データ型" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:170 msgid "" @@ -4737,10 +4720,9 @@ msgid "" "important concept in programming called *data types*. We can ask what type of\n" "data something is:" msgstr "" -"If you guessed that the last command will return an error because `2.1` plus\n" -"`\"black\"` is nonsense, you're right - and you already have some intuition for an\n" -"important concept in programming called *data types*. We can ask what type of\n" -"data something is:" +"最後のコマンドがエラーを返すのは `2.1` 足す `\"black\"` はナンセンスだからだろうと思ったとしたら、\n" +"それは正解で、既にプログラミングにおける*データ型*という重要な概念をある程度分かっていると言えます。\n" +"データ型が何かを知るには、以下を使います:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:176 @@ -4768,7 +4750,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:188 msgid "There are 5 main types: `double`, `integer`, `complex`, `logical` and `character`." -msgstr "There are 5 main types: `double`, `integer`, `complex`, `logical` and `character`." +msgstr "主な型は5つあります:`double(浮動小数点型)`、`integer(整数型)`、`complex(複素数型)`、`logical(論理型)`、そして`character(文字型)`。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:191 @@ -4789,7 +4771,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"typeof(1L) # The L suffix forces the number to be an integer, since by default R uses float numbers\n" +"typeof(1L) # Rはデフォルトでは浮動小数を使いますが、Lの接尾辞により、この数は整数型になります\n" "~~~" # code block @@ -4883,17 +4865,17 @@ msgid "" "complicated our analyses become, all data in R is interpreted as one of these\n" "basic data types. This strictness has some really important consequences." msgstr "" -"No matter how\n" -"complicated our analyses become, all data in R is interpreted as one of these\n" -"basic data types. This strictness has some really important consequences." +"どんなに分析が複雑になっても、\n" +"Rにある全てのデータは、この基本データ型のいずれかとして解釈されます。\n" +"この厳格性によって、とても重要なことが後々起こることもあります。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:263 msgid "" "A user has added details of another cat. This information is in the file\n" "`data/feline-data_v2.csv`." msgstr "" -"A user has added details of another cat. This information is in the file\n" -"`data/feline-data_v2.csv`." +"あるユーザーが他の猫の詳細を加えたとします。\n" +"情報は `data/feline-data_v2.csv` ファイルにあるものです。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:268 @@ -4930,8 +4912,8 @@ msgid "" "Load the new cats data like before, and check what type of data we find in the\n" "`weight` column:" msgstr "" -"Load the new cats data like before, and check what type of data we find in the\n" -"`weight` column:" +"先ほどのように、この新しい猫の情報を読み込み、 `weight` の列が、\n" +"どんなデータ型が確認してみましょう。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:287 @@ -4951,8 +4933,8 @@ msgid "" "Oh no, our weights aren't the double type anymore! If we try to do the same math\n" "we did on them before, we run into trouble:" msgstr "" -"Oh no, our weights aren't the double type anymore! If we try to do the same math\n" -"we did on them before, we run into trouble:" +"なんと、この weight はdouble型ではないじゃありませんか! 前と同じように計算をしようとすると、\n" +"やっかいなことになります:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:304 @@ -4997,17 +4979,16 @@ msgid "" "structure* - that is, a structure which R knows how to build out of the basic\n" "data types." msgstr "" -"What happened? When R reads a csv file into one of these tables, it insists that\n" -"everything in a column be the same basic type; if it can't understand\n" -"*everything* in the column as a double, then *nobody* in the column gets to be a\n" -"double. The table that R loaded our cats data into is something called a\n" -"*data.frame*, and it is our first example of something called a *data\n" -"structure* - that is, a structure which R knows how to build out of the basic\n" -"data types." +"何が起こったのでしょう?Rは、csvファイルを読み込む際、\n" +"列にある全てのものが同じ基本の型であるべきだと主張します。もし、列の*全て*が、\n" +"double型であることが確認できない場合、その列の*だれも*double型にならないのです。\n" +"Rが読み込んだ猫のデータ表は、*data.frame(データフレーム)*と呼ばれるもので、\n" +"*data structure(データ構造)*、つまりRが基本的なデータ型から構築できるデータの最初の例です。\n" +"どう作成すればよいか知っているものでした。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:331 msgid "We can see that it is a *data.frame* by calling the `class` function on it:" -msgstr "We can see that it is a *data.frame* by calling the `class` function on it:" +msgstr "*data.frame*であることを確かめるには、`class`関数を使います:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:334 @@ -5037,9 +5018,9 @@ msgid "" "data structures are, and how they behave. For now, let's remove that extra line\n" "from our cats data and reload it, while we investigate this behavior further:" msgstr "" -"In order to successfully use our data in R, we need to understand what the basic\n" -"data structures are, and how they behave. For now, let's remove that extra line\n" -"from our cats data and reload it, while we investigate this behavior further:" +"データをうまくRで使うためには、基礎的なデータ構造、そしてその構造がどう作用するか\n" +"を理解する必要があります。より理解を深めるために、とりあえず猫のデータから\n" +"追加した1行を削除し、再読み込みしましょう。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:350 msgid "feline-data.csv:" @@ -5064,7 +5045,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:359 msgid "And back in RStudio:" -msgstr "And back in RStudio:" +msgstr "RStudioに戻ります:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:362 @@ -5080,15 +5061,13 @@ msgstr "" # header #: r-novice-gapminder/_episodes/04-data-structures-part1.md:370 msgid "## Vectors and Type Coercion" -msgstr "## Vectors and Type Coercion" +msgstr "## ベクトル及び型強制" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:372 msgid "" "To better understand this behavior, let's meet another of the data structures:\n" "the *vector*." -msgstr "" -"To better understand this behavior, let's meet another of the data structures:\n" -"the *vector*." +msgstr "この動作をより理解するために、もう一つのデータ構造*ベクトル*を紹介します。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:376 @@ -5121,10 +5100,10 @@ msgid "" "you don't choose the datatype, it'll default to `logical`; or, you can declare\n" "an empty vector of whatever type you like." msgstr "" -"A vector in R is essentially an ordered list of things, with the special\n" -"condition that *everything in the vector must be the same basic data type*. If\n" -"you don't choose the datatype, it'll default to `logical`; or, you can declare\n" -"an empty vector of whatever type you like." +"Rのベクトルは、本来、*ベクトルの中の全てのものは同じ基本データ型でなければいけない*という特別な条件のある、\n" +"順番を付けられたもののリストです。\n" +"もし、データ型を選ばなければ、デフォルトで`logical`になりますが、好きなデータ型を持つ空のベクトルを\n" +"宣言することもできます。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:396 @@ -5152,7 +5131,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:409 msgid "You can check if something is a vector:" -msgstr "You can check if something is a vector:" +msgstr "以下を使えばベクトルかどうかを確かめられます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:412 @@ -5184,11 +5163,10 @@ msgid "" "case `[1:3]`; and a few examples of what's actually in the vector - in this case\n" "empty character strings. If we similarly do" msgstr "" -"The somewhat cryptic output from this command indicates the basic data type\n" -"found in this vector - in this case `chr`, character; an indication of the\n" -"number of things in the vector - actually, the indexes of the vector, in this\n" -"case `[1:3]`; and a few examples of what's actually in the vector - in this case\n" -"empty character strings. If we similarly do" +"このコマンドから出てきた暗号みたいなアウトプットによると、このベクトルの基本データ型(ここでは `chr` (文字型))、\n" +"数(実際には、ベクトルの添字、この場合 `[1:3]` )、\n" +"そして中身のいくつかの例示(この場合、空の文字列)が示されています。\n" +"`cats$weight`に同じようなことをすると:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:431 @@ -5220,14 +5198,14 @@ msgid "" "data.frames are all vectors*, and that's the root of why R forces everything in\n" "a column to be the same basic data type." msgstr "" -"we see that `cats$weight` is a vector, too - *the columns of data we load into R\n" -"data.frames are all vectors*, and that's the root of why R forces everything in\n" -"a column to be the same basic data type." +"ここで`cats$weight` もまたベクトルであることが分かります。 \n" +"*Rのデータフレームに読み込まれたデータの列は全てベクトル*で、\n" +"Rが全ての列を同じ基本データ型にする理由です。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/04-data-structures-part1.md:447 msgid "> ## Discussion 1" -msgstr "> ## Discussion 1" +msgstr "> ## 議論1" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:448 msgid "" @@ -5245,17 +5223,16 @@ msgid "" "> > our lives easier in R." msgstr "" ">\n" -"> Why is R so opinionated about what we put in our columns of data?\n" -"> How does this help us?\n" +"> なぜRは、データの列に何を置くのかについて意固地なのでしょう。\n" +"> これがどう役立つのでしょう?\n" ">\n" -"> > ## Discussion 1\n" +"> > ## 議論1\n" "> >\n" -"> > By keeping everything in a column the same, we allow ourselves to make simple\n" -"> > assumptions about our data; if you can interpret one entry in the column as a\n" -"> > number, then you can interpret *all* of them as numbers, so we don't have to\n" -"> > check every time. This consistency is what people mean when they talk about \n" -"> > *clean data*; in the long run, strict consistency goes a long way to making \n" -"> > our lives easier in R." +"> > 列の全てを同じにすることで、データについて簡単に仮定することができます。\n" +"> > 列のひとつを数値と解釈できたら、 *全て* を数値と解釈することができるのです。\n" +"> > つまり、毎回確認する必要がないのです。\n" +"> > 人々が*きれいなデータ*と話している時は、このように整合性のあるデータであることを意味しているのです。\n" +"> > 長期的には、この厳格な整合性が後にRを使うのが楽になることに繋がります。 " # SC/DC Template label #: r-novice-gapminder/_episodes/04-data-structures-part1.md:461 @@ -5264,7 +5241,7 @@ msgstr "{: .discussion}" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:463 msgid "You can also make vectors with explicit contents with the combine function:" -msgstr "You can also make vectors with explicit contents with the combine function:" +msgstr "合成関数で明確な内容を持つベクトルを作ることもできます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:466 @@ -5292,7 +5269,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:479 msgid "Given what we've learned so far, what do you think the following will produce?" -msgstr "Given what we've learned so far, what do you think the following will produce?" +msgstr "これまで学んだことを踏まえて、以下は何を生み出すでしょうか。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:482 @@ -5313,11 +5290,10 @@ msgid "" "be combined into a single vector, it will force them all to be the same\n" "type. Consider:" msgstr "" -"This is something called *type coercion*, and it is the source of many surprises\n" -"and the reason why we need to be aware of the basic data types and how R will\n" -"interpret them. When R encounters a mix of types (here numeric and character) to\n" -"be combined into a single vector, it will force them all to be the same\n" -"type. Consider:" +"これは、*型強制*と言われるものです。これが多くの驚きの素であり、\n" +"なぜ起こるのか、理解するには基本データ型とRがそれをどう解釈するかを知っておく必要があります。\n" +"Rが複数の型(ここでは、数値と文字型)がひとつのベクトルに合わさる場面に遭遇した際、\n" +"全てを強制的に同じ型にします。例えば:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:494 @@ -5373,9 +5349,9 @@ msgid "" "`character`, where -> can be read as *are transformed into*. You can try to\n" "force coercion against this flow using the `as.` functions:" msgstr "" -"The coercion rules go: `logical` -> `integer` -> `numeric` -> `complex` ->\n" -"`character`, where -> can be read as *are transformed into*. You can try to\n" -"force coercion against this flow using the `as.` functions:" +"強制化のルールは、`logical` -> `integer` -> `numeric` -> `complex` ->\n" +"`character` です。ここで、 -> は、*~が変換されるのは~*という意味です。\n" +"この流れに逆らう強制化も、`as.` 関数を使ってできます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:527 @@ -5457,11 +5433,10 @@ msgid "" "may well be to blame; make sure everything is the same type in your vectors and\n" "your columns of data.frames, or you will get nasty surprises!" msgstr "" -"As you can see, some surprising things can happen when R forces one basic data\n" -"type into another! Nitty-gritty of type coercion aside, the point is: if your\n" -"data doesn't look like what you thought it was going to look like, type coercion\n" -"may well be to blame; make sure everything is the same type in your vectors and\n" -"your columns of data.frames, or you will get nasty surprises!" +"ご覧のとおり、Rがある基本のデータ型を他へ変換すると、驚くことが起こります。\n" +"型強制の核心はさておき、ポイントは:もし、データが思っていたものと違っている場合、\n" +"型強制が原因かもしれないという事です。ベクトルの中、データフレームの列を全て同じ型にすること、\n" +"さもなくば、いやなサプライズに会う羽目になるかもしれません。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:576 msgid "" @@ -5472,12 +5447,10 @@ msgid "" "exactly what our data represents. We can 'coerce' this column to be `logical` by\n" "using the `as.logical` function:" msgstr "" -"But coercion can also be very useful! For example, in our `cats` data\n" -"`likes_string` is numeric, but we know that the 1s and 0s actually represent\n" -"`TRUE` and `FALSE` (a common way of representing them). We should use the\n" -"`logical` datatype here, which has two states: `TRUE` or `FALSE`, which is\n" -"exactly what our data represents. We can 'coerce' this column to be `logical` by\n" -"using the `as.logical` function:" +"しかし、型強制が役に立つこともあります。例えば、あの猫のデータの中にある、\n" +"`likes_string` は数値型ですが、私達は1と0が 一般的に`TRUE` と `FALSE`を示すことを知っています。\n" +"ここで、データが将に意味するところの`TRUE` 又は `FALSE` を持つ `logical` データ型を使ったほうがいいに決まっています。 \n" +" `as.logical` 関数を使い、この列を `logical` へ 「強制」 できます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:584 @@ -5527,7 +5500,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:611 msgid "The combine function, `c()`, will also append things to an existing vector:" -msgstr "The combine function, `c()`, will also append things to an existing vector:" +msgstr "合成関数 `c()`は、既存のベクトルに追加することもできます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:614 @@ -5579,7 +5552,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:642 msgid "You can also make series of numbers:" -msgstr "You can also make series of numbers:" +msgstr "数列を作ることもできます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:645 @@ -5653,7 +5626,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:692 msgid "We can ask a few questions about vectors:" -msgstr "We can ask a few questions about vectors:" +msgstr "ベクトルについて、いくつか質問することもできます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:695 @@ -5747,7 +5720,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:764 msgid "Finally, you can give names to elements in your vector:" -msgstr "Finally, you can give names to elements in your vector:" +msgstr "ベクトルの要素に名前を付けることもできます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:767 @@ -5817,11 +5790,11 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Start by making a vector with the numbers 1 through 26.\n" -"> Multiply the vector by 2, and give the resulting vector\n" -"> names A through Z (hint: there is a built in vector called `LETTERS`)\n" +"> 1から26までの数値を持つベクトルを作るところから始め、\n" +"> ベクトルに2を掛けましょう。そして、そのベクトルにAからZまでの名前を\n" +"> 与えます(ヒント:`LETTERS` という備え付けのベクトルがあります)\n" ">\n" -"> > ## Solution to Challenge 1\n" +"> > ## チャレンジ1の解答\n" "> >\n" "> > \n" "> > ~~~\n" @@ -5834,11 +5807,11 @@ msgstr "" # header #: r-novice-gapminder/_episodes/04-data-structures-part1.md:815 msgid "## Data Frames" -msgstr "## Data Frames" +msgstr "## データフレーム" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:817 msgid "We said that columns in data.frames were vectors:" -msgstr "We said that columns in data.frames were vectors:" +msgstr "先ほどお伝えしたとおり、データフレームの列はベクトルです:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:834 @@ -5864,7 +5837,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:846 msgid "These make sense. But what about" -msgstr "These make sense. But what about" +msgstr "これは納得といったところでしょうが、次はどうでしょう" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:849 @@ -5893,7 +5866,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:861 #: r-novice-gapminder/_episodes/05-data-structures-part2.md:166 msgid "## Factors" -msgstr "## Factors" +msgstr "## 順序なし因数" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:863 msgid "" @@ -5902,10 +5875,9 @@ msgid "" "example, let's make a vector of strings labelling cat colorations for all the\n" "cats in our study:" msgstr "" -"Another important data structure is called a *factor*. Factors usually look like\n" -"character data, but are typically used to represent categorical information. For\n" -"example, let's make a vector of strings labelling cat colorations for all the\n" -"cats in our study:" +"もうひとつの重要なデータ構造として、*順序なし因子(factor)*があります。\n" +"順序なし因子は、文字型データのように見えますが、一般的にはカテゴリー情報を表すために使われます。\n" +"例えば、我々の研究の全ての猫の毛色にラベル付けする文字列のベクトルを作ってみましょう:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:869 @@ -5957,7 +5929,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:897 msgid "We can turn a vector into a factor like so:" -msgstr "We can turn a vector into a factor like so:" +msgstr "ベクトルを順序なし因子に変換するには:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:900 @@ -6013,11 +5985,10 @@ msgid "" "with numbered indices under the hood, this is necessary as many statistical\n" "calculations utilise such numerical representations for categorical data:" msgstr "" -"Now R has noticed that there are three possible categories in our data - but it\n" -"also did something surprising; instead of printing out the strings we gave it,\n" -"we got a bunch of numbers instead. R has replaced our human-readable categories\n" -"with numbered indices under the hood, this is necessary as many statistical\n" -"calculations utilise such numerical representations for categorical data:" +"ここでRは、我々のデータに3つのカテゴリーが存在することに気づきました。\n" +"しかし、それと同時に意外なこともしました。入力した文字列が表示される代わりに、\n" +"数字の羅列が出てきました。Rは、人が読めるカテゴリーを、 内部で番号を振られた添字に変換したのです。\n" +"こうする必要があるのは、統計的な計算で、カテゴリーデータをこのように数字として表して扱うからです。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:934 @@ -6075,14 +6046,14 @@ msgid "" "> > even if they aren't sure." msgstr "" ">\n" -"> Is there a factor in our `cats` data.frame? what is its name?\n" -"> Try using `?read.csv` to figure out how to keep text columns as character\n" -"> vectors instead of factors; then write a command or two to show that the factor\n" -"> in `cats` is actually a character vector when loaded in this way.\n" +"> 我々の `cats` データフレームには、順序なし因子がありますか?列の名前は何ですか?\n" +"> `?read.csv` を使って、どうしたら文字の列を順序なし因子ではなく、文字型ベクトルのまま\n" +"> 読み込む方法を見つけ出して下さい。そして、`cats`の中の順序なし因子がこの方法で読み込まれたとき、\n" +"> 順序なし因子ではなく文字型ベクトルであることを証明するコマンドを、ひとつかふたつ書いて下さい。\n" ">\n" -"> > ## Solution to Challenge 2\n" +"> > ## チャレンジ2の解答\n" "> >\n" -"> > One solution is use the argument `stringAsFactors`:\n" +"> > 一つ目の解答は、`stringAsFactors` を引数として使うことです。\n" "> >\n" "> > \n" "> > ~~~\n" @@ -6091,8 +6062,8 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > Another solution is use the argument `colClasses`\n" -"> > that allow finer control.\n" +"> > もう一つの解答は、更に洗練した操作ができる引数 `colClasses` \n" +"> > を使うことです。\n" "> >\n" "> > \n" "> > ~~~\n" @@ -6101,9 +6072,8 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > Note: new students find the help files difficult to understand; make sure to let them know\n" -"> > that this is typical, and encourage them to take their best guess based on semantic meaning,\n" -"> > even if they aren't sure." +"> > 補足:初めての方は、ヘルプファイルを難しく感じるかもしれません。これはよくあることですので、\n" +"> > 自信がなくても、書かれたことの意味をうまく予測してみるようにしましょう。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:994 msgid "" @@ -6111,9 +6081,9 @@ msgid "" "is assumed to be the first factor, but by default factors are labelled in\n" "alphabetical order. You can change this by specifying the levels:" msgstr "" -"In modelling functions, it's important to know what the baseline levels are. This\n" -"is assumed to be the first factor, but by default factors are labelled in\n" -"alphabetical order. You can change this by specifying the levels:" +"モデリングの関数を使う際、基準となっている水準の順位がどれかを知っておくことが大事です。\n" +"最初の順序なし因子が基準値であると仮定されていますが、デフォルトでは、順序なし因子は\n" +"アルファベット順に並べられています。水準の順位を指定することで、順序なし因子の順位を変更できます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:999 @@ -6147,14 +6117,13 @@ msgid "" "\"case\" by 2. This designation can be very important for interpreting the\n" "results of statistical models!" msgstr "" -"In this case, we've explicitly told R that \"control\" should represented by 1, and\n" -"\"case\" by 2. This designation can be very important for interpreting the\n" -"results of statistical models!" +"ここでは、 \"control\" は1、\"case\" は2で表されるべきであるとRにはっきり示しています。\n" +"この指定が、統計モデルの結果を解釈する際、とても重要になります。" # header #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1017 msgid "## Lists" -msgstr "## Lists" +msgstr "## リスト" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1019 msgid "" @@ -6162,9 +6131,9 @@ msgid "" "is simpler in some ways than the other types, because you can put anything you\n" "want in it:" msgstr "" -"Another data structure you'll want in your bag of tricks is the `list`. A list\n" -"is simpler in some ways than the other types, because you can put anything you\n" -"want in it:" +"覚えておきたいもう一つのデータ構造は、 `list` です。\n" +"リストは、他の種類よりも、ある意味シンプルです。その理由は、入れたいものを\n" +"なんでも入れることができるからです:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1024 @@ -6250,7 +6219,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1069 msgid "We can now understand something a bit surprising in our data.frame; what happens if we run:" -msgstr "We can now understand something a bit surprising in our data.frame; what happens if we run:" +msgstr "これで、data.frameの驚くべき特徴を理解することができます。もし以下を走らせたらどうなるでしょう:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1072 @@ -6285,20 +6254,19 @@ msgid "" "columns together into a familiar table. In other words, a `data.frame` is a\n" "special list in which all the vectors must have the same length." msgstr "" -"We see that data.frames look like lists 'under the hood' - this is because a\n" -"data.frame is really a list of vectors and factors, as they have to be - in\n" -"order to hold those columns that are a mix of vectors and factors, the\n" -"data.frame needs something a bit more flexible than a vector to put all the\n" -"columns together into a familiar table. In other words, a `data.frame` is a\n" -"special list in which all the vectors must have the same length." +"data.frame は、 実際のところリストと同じように見えます。data.frame は、\n" +"実際のところベクトルと順序なし因子のリストであり、これらから形成しなければならないからです。\n" +"data.frame が、ベクトルと順序なし因子が混ざった列を含む全ての列をひとまとめにし、\n" +"なじみのある表にするためには、ベクトルよりも柔軟な構造が必要だったのです。\n" +"つまり、 `data.frame` は、全てのベクトルの長さが同じでなければならない特別なリストなのです。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1091 msgid "" "In our `cats` example, we have an integer, a double and a logical variable. As\n" "we have seen already, each column of data.frame is a vector." msgstr "" -"In our `cats` example, we have an integer, a double and a logical variable. As\n" -"we have seen already, each column of data.frame is a vector." +"我々の `cats` の例では、整数型(integer)、浮動小数型(double)、論理型(logical)の変数があります。\n" +"既に見たように、data.frame のそれぞれの列はベクトルです。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1110 @@ -6338,8 +6306,8 @@ msgid "" "Each row is an *observation* of different variables, itself a data.frame, and\n" "thus can be composed of elements of different types." msgstr "" -"Each row is an *observation* of different variables, itself a data.frame, and\n" -"thus can be composed of elements of different types." +"それぞれの行は、異なる変数の *observation(観測値)* であり、それ自体が data.frame であるため、\n" +"異なる種類の要素で構成されることができます。" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1155 @@ -6539,8 +6507,7 @@ msgid "" "> values in the first row." msgstr "" ">\n" -"> There are several subtly different ways to call variables, observations and\n" -"> elements from data.frames:\n" +"> data.frame から、変数、観測値、要素を呼び出す方法はいくつかあります:\n" ">\n" "> - `cats[1]`\n" "> - `cats[[1]]`\n" @@ -6550,11 +6517,11 @@ msgstr "" "> - `cats[, 1]`\n" "> - `cats[1, ]`\n" ">\n" -"> Try out these examples and explain what is returned by each one.\n" +"> 上記の例を試してみて、それぞれの例で何が返ってくるかを説明してみましょう。\n" ">\n" -"> *Hint:* Use the function `typeof()` to examine what is returned in each case.\n" +"> *ヒント:* どういった値が返ってくるかを確かめるために、関数 `typeof()` を使いましょう。\n" ">\n" -"> > ## Solution to Challenge 3\n" +"> > ## チャレンジ3の解答\n" "> > \n" "> > ~~~\n" "> > cats[1]\n" @@ -6570,9 +6537,9 @@ msgstr "" "> > 3 tabby\n" "> > ~~~\n" "> > {: .output}\n" -"> > We can think of a data frame as a list of vectors. The single brace `[1]`\n" -"> returns the first slice of the list, as another list. In this case it is the\n" -"> first column of the data frame.\n" +"> > データフレームを、ベクトルのリストと考えることができます。この角括弧 `[1]`\n" +"> は、リストの最初の一切れを別のリストとして返します。ここでは、\n" +"> データフレームの最初の列となっています。\n" "> > \n" "> > ~~~\n" "> > cats[[1]]\n" @@ -6586,8 +6553,8 @@ msgstr "" "> > Levels: black calico tabby\n" "> > ~~~\n" "> > {: .output}\n" -"> > The double brace `[[1]]` returns the contents of the list item. In this case\n" -"> it is the contents of the first column, a _vector_ of type _factor_.\n" +"> > この二重角括弧 `[[1]]` は、リスト項目の内容を返します。ここでは、\n" +"> 最初の列の内容、_順序なし因子_ の種類の_ベクトル_です。\n" "> > \n" "> > ~~~\n" "> > cats$coat\n" @@ -6601,8 +6568,8 @@ msgstr "" "> > Levels: black calico tabby\n" "> > ~~~\n" "> > {: .output}\n" -"> > This example uses the `$` character to address items by name. _coat_ is the\n" -"> first column of the data frame, again a _vector_ of type _factor_.\n" +"> > この例では、 `$` 記号を、項目を名前で呼ぶために使っています\n" +"> _coat_ が、データフレームの最初の列であり、これもまた_順序なし因子_ の種類の_ベクトル_です。\n" "> > \n" "> > ~~~\n" "> > cats[\"coat\"]\n" @@ -6618,8 +6585,8 @@ msgstr "" "> > 3 tabby\n" "> > ~~~\n" "> > {: .output}\n" -"> > Here we are using a single brace `[\"coat\"]` replacing the index number with\n" -"> the column name. Like example 1, the returned object is a _list_.\n" +"> > ここでは、列の名前の要素番号の代わりに角括弧 `[\"coat\"]` を使っています。\n" +"> 例1のように、返ってくるオブジェクトは、_リスト_です。\n" "> > \n" "> > ~~~\n" "> > cats[1, 1]\n" @@ -6633,10 +6600,10 @@ msgstr "" "> > Levels: black calico tabby\n" "> > ~~~\n" "> > {: .output}\n" -"> > This example uses a single brace, but this time we provide row and column\n" -"> coordinates. The returned object is the value in row 1, column 1. The object\n" -"> is an _integer_ but because it is part of a _vector_ of type _factor_, R\n" -"> displays the label \"calico\" associated with the integer value.\n" +"> > この例は、角括弧を使っていますが、ここでは行と列の座標を指定します。\n" +"> 返ってくるオブジェクトは、行1、列1の値です。このオブジェクトは、\n" +"> _整数_ ですが、_順序なし因数_の一種の_ベクトル_の一部なので、Rは、\n" +"> 整数値と紐づけられた「calico」のラベルを表示します。 \n" "> > \n" "> > ~~~\n" "> > cats[, 1]\n" @@ -6650,9 +6617,9 @@ msgstr "" "> > Levels: black calico tabby\n" "> > ~~~\n" "> > {: .output}\n" -"> > Like the previous example we use single braces and provide row and column\n" -"> coordinates. The row coordinate is not specified, R interprets this missing\n" -"> value as all the elements in this _column_ _vector_.\n" +"> >前の例と同じように、角括弧を使い、行と列の座標を指定します。\n" +"> 行の座標は指定されていません。Rは、この欠けている値を、\n" +"> この_列_の_ベクトル_の全ての要素と解釈します。\n" "> > \n" "> > ~~~\n" "> > cats[1, ]\n" @@ -6666,18 +6633,18 @@ msgstr "" "> > 1 calico 2.1 TRUE\n" "> > ~~~\n" "> > {: .output}\n" -"> > Again we use the single brace with row and column coordinates. The column\n" -"> coordinate is not specified. The return value is a _list_ containing all the\n" -"> values in the first row." +"> > 同じ様に、行と列の座標の入った角括弧を使っています。列の座標は\n" +"> 指定されていません。返ってくる値は、最初の行にある全ての値の_リスト_\n" +"> です。" # header #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1334 msgid "## Matrices" -msgstr "## Matrices" +msgstr "## 行列" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1336 msgid "Last but not least is the matrix. We can declare a matrix full of zeros:" -msgstr "Last but not least is the matrix. We can declare a matrix full of zeros:" +msgstr "最後に、行列を紹介します。全てが0の行列を宣言できます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1339 @@ -6711,7 +6678,7 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1355 msgid "And similar to other data structures, we can ask things about our matrix:" -msgstr "And similar to other data structures, we can ask things about our matrix:" +msgstr "そして、他のデータ構造と同様に、行列に関することを尋ねることもできます:" # code block #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1358 @@ -6868,14 +6835,14 @@ msgid "" "> > gives you the total number of elements in the matrix." msgstr "" ">\n" -"> What do you think will be the result of\n" +"> 次の結果は何になるでしょうか。\n" "> `length(matrix_example)`?\n" -"> Try it.\n" -"> Were you right? Why / why not?\n" +"> 試してみて下さい。\n" +"> 合っていましたか?なぜ答えが合っていた・合っていなかったのでしょうか?\n" ">\n" -"> > ## Solution to Challenge 4\n" +"> > ## チャレンジ4の解答\n" "> >\n" -"> > What do you think will be the result of\n" +"> > 次の結果は何になるでしょうか。\n" "> > `length(matrix_example)`?\n" "> >\n" "> > \n" @@ -6892,8 +6859,8 @@ msgstr "" "> > ~~~\n" "> > {: .output}\n" "> >\n" -"> > Because a matrix is a vector with added dimension attributes, `length`\n" -"> > gives you the total number of elements in the matrix." +"> > 行列は、次元が追加されたベクトルですので、`length`は\n" +"> > 行列の総要素数を教えてくれます。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1473 msgid "" @@ -6922,21 +6889,21 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Make another matrix, this time containing the numbers 1:50,\n" -"> with 5 columns and 10 rows.\n" -"> Did the `matrix` function fill your matrix by column, or by\n" -"> row, as its default behaviour?\n" -"> See if you can figure out how to change this.\n" -"> (hint: read the documentation for `matrix`!)\n" +"> もう一つ行列を作ってみましょう、今回は、1:50の数を含むもので、\n" +"> 5行、10列を持つ行列にしましょう。\n" +"> この `matrix` 関数は、デフォルトでは、行か列、どちらから\n" +"> 行列を埋めましたか?\n" +"> どうしたらこのデフォルト動作を変更できるか探してみて下さい。\n" +">(ヒント: `matrix` のドキュメントを読んでみましょう!)\n" ">\n" -"> > ## Solution to Challenge 5\n" +"> > ## チャレンジ5の解答\n" "> >\n" -"> > Make another matrix, this time containing the numbers 1:50,\n" -"> > with 5 columns and 10 rows.\n" -"> > Did the `matrix` function fill your matrix by column, or by\n" -"> > row, as its default behaviour?\n" -"> > See if you can figure out how to change this.\n" -"> > (hint: read the documentation for `matrix`!)\n" +"> > もう一つ行列を作ってみましょう、今回は、1:50の数を含むもので、\n" +"> > 5行、10列を持つ行列にしましょう。\n" +"> > この `matrix` 関数は、デフォルトでは、行か列、どちらから\n" +"> > 行列を埋めましたか?\n" +"> > これがどう変化したか理解したか確認してみましょう。\n" +"> > (ヒント: `matrix` のドキュメントを読んでみましょう!)\n" "> >\n" "> > \n" "> > ~~~\n" @@ -6949,12 +6916,12 @@ msgstr "" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1500 #: r-novice-gapminder/_episodes/06-data-subsetting.md:1236 msgid "> ## Challenge 6" -msgstr "> ## Challenge 6" +msgstr "> ## チャレンジ6" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1501 msgid "> Create a list of length two containing a character vector for each of the sections in this part of the workshop:" -msgstr "> Create a list of length two containing a character vector for each of the sections in this part of the workshop:" +msgstr "> ワークショップの現パート、それぞれのセクションのために、二つの文字型ベクトルが含まれるリストを作って下さい:" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1502 msgid "" @@ -6979,13 +6946,13 @@ msgid "" "> >" msgstr "" ">\n" -"> - Data types\n" -"> - Data structures\n" +"> - データ型\n" +"> - データ構造\n" ">\n" -"> Populate each character vector with the names of the data types and data\n" -"> structures we've seen so far.\n" +"> それぞれの文字ベクトルをこれまでみてきたデータ型と\n" +"> データ構造で埋めてください。\n" ">\n" -"> > ## Solution to Challenge 6\n" +"> > ## チャレンジ6の解答\n" "> > \n" "> > ~~~\n" "> > dataTypes <- c('double', 'complex', 'integer', 'character', 'logical')\n" @@ -6993,16 +6960,16 @@ msgstr "" "> > answer <- list(dataTypes, dataStructures)\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > Note: it's nice to make a list in big writing on the board or taped to the wall\n" -"> > listing all of these types and structures - leave it up for the rest of the workshop\n" -"> > to remind people of the importance of these basics.\n" +"> > 補足:ボードや壁に、全ての型と構造を大きな文字で列挙したものを\n" +"> > 貼っておくのは良い方法です -これらの基本の重要性をみなさんに繰り返し伝えるため、\n" +"> > ワークショップが終わるまで残しておきましょう。\n" "> >" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1525 #: r-novice-gapminder/_episodes/06-data-subsetting.md:1358 msgid "> ## Challenge 7" -msgstr "> ## Challenge 7" +msgstr "> ## チャレンジ7" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1526 msgid "" @@ -7017,7 +6984,7 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> Consider the R output of the matrix below:\n" +"> 下記の行列のRアウトプットを見てみましょう:\n" "> \n" "> ~~~\n" "> [,1] [,2]\n" @@ -7043,17 +7010,17 @@ msgstr "> {: .output}" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1536 msgid "> What was the correct command used to write this matrix? Examine" -msgstr "> What was the correct command used to write this matrix? Examine" +msgstr "> この行列を書くために使ったコマンドは何でしたか?" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1537 msgid "> each command and try to figure out the correct one before typing them." -msgstr "> each command and try to figure out the correct one before typing them." +msgstr "> それぞれのコマンドを確かめて、打ち込む前に正しいものが何か分かるようにしましょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1538 msgid "> Think about what matrices the other commands will produce." -msgstr "> Think about what matrices the other commands will produce." +msgstr "> 他のコマンドでは、どのような行列が作られるかを考えてみましょう。" #: r-novice-gapminder/_episodes/04-data-structures-part1.md:1539 msgid "" @@ -7089,9 +7056,9 @@ msgstr "" "> 3. `matrix(c(4, 9, 10, 1, 5, 7), nrow = 2)`\n" "> 4. `matrix(c(4, 1, 9, 5, 10, 7), ncol = 2, byrow = TRUE)`\n" ">\n" -"> > ## Solution to Challenge 7\n" +"> > ## チャレンジ7の解答\n" "> >\n" -"> > Consider the R output of the matrix below:\n" +"> > 下記の行列のRアウトプットを見てみましょう:\n" "> > \n" "> > ~~~\n" "> > [,1] [,2]\n" @@ -7100,9 +7067,9 @@ msgstr "" "> > [3,] 10 7\n" "> > ~~~\n" "> > {: .output}\n" -"> > What was the correct command used to write this matrix? Examine\n" -"> > each command and try to figure out the correct one before typing them.\n" -"> > Think about what matrices the other commands will produce.\n" +"> > この行列を書くために使ったコマンドは何でしたか?\n" +"> > それぞれのコマンドを確かめて、打ち込む前に正しいものが何か分かるようにしましょう。\n" +"> > 他のコマンドでは、どのような行列が作られるかを考えてみましょう。\n" "> > \n" "> > ~~~\n" "> > matrix(c(4, 1, 9, 5, 10, 7), ncol = 2, byrow = TRUE)\n" @@ -7173,15 +7140,15 @@ msgid "" "those tools. But most of the time, the star of the show is the data frame—the table that we created by loading information from a csv file. In this lesson, we'll learn a few more things\n" "about working with data frames." msgstr "" -"At this point, you've seen it all: in the last lesson, we toured all the basic\n" -"data types and data structures in R. Everything you do will be a manipulation of\n" -"those tools. But most of the time, the star of the show is the data frame—the table that we created by loading information from a csv file. In this lesson, we'll learn a few more things\n" -"about working with data frames." +"これでRの基礎を全て見たことになります。このレッスンで、Rの基本的なデータ型、データ構造を習いました。\n" +"これからすることの全ては、これらの道具を用いた操作となります。\n" +"しかし大抵の場合、主演はデータフレーム(CSVファイルから情報を読み込み作成した表)です。\n" +"このレッスンでは、データフレームを使ってどう作業していくかについて更に学んでいきましょう。" # header #: r-novice-gapminder/_episodes/05-data-structures-part2.md:35 msgid "## Adding columns and rows in data frames" -msgstr "## Adding columns and rows in data frames" +msgstr "## データフレームに行と列を追加する" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:37 msgid "" @@ -7189,9 +7156,8 @@ msgid "" "data are consistent in type throughout the columns. As such, if we want to add a\n" "new column, we can start by making a new vector:" msgstr "" -"We already learned that the columns of a data frame are vectors, so that our\n" -"data are consistent in type throughout the columns. As such, if we want to add a\n" -"new column, we can start by making a new vector:" +"既に学んだとおり、データフレームの列はベクトルですから、列にあるデータには一貫性があります。\n" +"ですので、新しい列を加えたい場合は、新しいベクトルを作ることから始めることになります:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:44 @@ -7208,7 +7174,7 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:60 msgid "We can then add this as a column via:" -msgstr "We can then add this as a column via:" +msgstr "そして、これを以下を使って列に加えます:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:63 @@ -7240,7 +7206,7 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:78 msgid "Note that if we tried to add a vector of ages with a different number of entries than the number of rows in the dataframe, it would fail:" -msgstr "Note that if we tried to add a vector of ages with a different number of entries than the number of rows in the dataframe, it would fail:" +msgstr "もし、データフレームの行の数と一致しない年齢のベクトルを追加しようとすると、失敗します:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:81 @@ -7294,9 +7260,7 @@ msgstr "" msgid "" "Why didn't this work? Of course, R wants to see one element in our new column\n" "for every row in the table:" -msgstr "" -"Why didn't this work? Of course, R wants to see one element in our new column\n" -"for every row in the table:" +msgstr "なぜダメだったのでしょうか?もちろん、Rは新しい列のひとつの要素を、表の中にある全ての行について参照したがるものです。" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:113 @@ -7333,7 +7297,7 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:139 msgid "So for it to work we need to have `nrow(cats)` = `length(age)`. Let's overwite the content of cats with our new data frame." -msgstr "So for it to work we need to have `nrow(cats)` = `length(age)`. Let's overwite the content of cats with our new data frame." +msgstr "ですから、そうするために、 `nrow(cats)` = `length(age)` である必要があるのです。猫の内容を新しいデータフレームで上書きしましょう。" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:142 @@ -7352,9 +7316,7 @@ msgstr "" msgid "" "Now how about adding rows? We already know that the rows of a\n" "data frame are lists:" -msgstr "" -"Now how about adding rows? We already know that the rows of a\n" -"data frame are lists:" +msgstr "新しい行を加えてみてはどうでしょうか?既に知っているとおり、データフレームの行はリストです:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:152 @@ -7384,7 +7346,7 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:168 msgid "Here is another thing to look out for: in a `factor`, each different value represents what is called a `level`. In our case, the `factor` \"coat\" has 3 levels: \"black\", \"calico\", and \"tabby\". R will only accept values that match one of the levels. If you add a new value, it will become `NA`." -msgstr "Here is another thing to look out for: in a `factor`, each different value represents what is called a `level`. In our case, the `factor` \"coat\" has 3 levels: \"black\", \"calico\", and \"tabby\". R will only accept values that match one of the levels. If you add a new value, it will become `NA`." +msgstr "ここで、もうひとつ気を付けなければいけないことは、`順序なし因子型(factor)`の中で、それぞれの値に`水準(level)` と呼ばれるものが付されているということです。つまり、この例では、`順序なし因子型`である「coat(毛皮)」には、「black(黒)」、「calico(三毛)」、「tabby(ぶち)」の3つの水準(level) があり、Rは、この水準のいずれかに一致する値でなければ、受け付けないというわけです。新しい値を加えようとすると、それは`NA`になります。" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:170 msgid "" @@ -7394,11 +7356,10 @@ msgid "" "those variables are not factors. To successfully add a cat with a\n" "\"tortoiseshell\" *coat*, add \"tortoiseshell\" as a *level* of the factor:" msgstr "" -"The warning is telling us that we unsuccessfully added \"tortoiseshell\" to our\n" -"*coat* factor, but 3.3 (a numeric), TRUE (a logical), and 9 (a numeric) were\n" -"successfully added to *weight*, *likes_string*, and *age*, respectively, since\n" -"those variables are not factors. To successfully add a cat with a\n" -"\"tortoiseshell\" *coat*, add \"tortoiseshell\" as a *level* of the factor:" +"この注意は、順序なし因子型である「coat(毛皮)」に、「tortoiseshell(錆)」をちゃんと加えられなかった\n" +"ことを伝えているのです。しかし、3.3 (数値型)、TRUE(論理型)、9(数値型)については、\n" +"順序なし因子型ではないため、*weight*、*likes_string*、*age*にそれぞれ正しく加えられています。\n" +"「tortoiseshell」の猫について、*coat*をちゃんと加えるために、「tortoiseshell」をこの順序なし因子の*水準(level)*に加えましょう:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:177 @@ -7441,9 +7402,9 @@ msgid "" "handy categories of the factor, but we can subsequently add any word we want to the\n" "column without babysitting the factor levels:" msgstr "" -"Alternatively, we can change a factor into a character vector; we lose the\n" -"handy categories of the factor, but we can subsequently add any word we want to the\n" -"column without babysitting the factor levels:" +"あるいは、順序なし因子型を文字型のベクトルに変えることもできます。\n" +"すると、順序なし因子型の便利な分類を失いますが、順序なし因子の水準を\n" +"管理する必要なく、列に好きな語句を追加できます:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:202 @@ -7510,22 +7471,22 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/05-data-structures-part2.md:238 msgid "> Let's imagine that 1 human year is equivalent to 7 cat years. " -msgstr "> Let's imagine that 1 human year is equivalent to 7 cat years. " +msgstr "> 人の1年は、猫の7年と同じだと想像してみましょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/05-data-structures-part2.md:239 msgid "> 1. Create a vector called `human_age` by multiplying `cats$age` by 7." -msgstr "> 1. Create a vector called `human_age` by multiplying `cats$age` by 7." +msgstr "> 1. `cats$age`を7倍にした、`human_age(人の年齢)`というベクトルを作りましょう" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/05-data-structures-part2.md:240 msgid "> 2. Convert `human_age` to a factor." -msgstr "> 2. Convert `human_age` to a factor." +msgstr "> 2. `human_age`を順序なし因子型に変換しましょう" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/05-data-structures-part2.md:241 msgid "> 3. Convert `human_age` back to a numeric vector using the `as.numeric()` function. Now divide it by 7 to get the original ages back. Explain what happened." -msgstr "> 3. Convert `human_age` back to a numeric vector using the `as.numeric()` function. Now divide it by 7 to get the original ages back. Explain what happened." +msgstr "> 3. `human_age` を、`as.numeric()` 関数を用いて、数値型に戻しましょう。そして、もともとの年に戻すために7で割りましょう。何が起こったか説明して下さい。" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:242 msgid "" @@ -7536,15 +7497,15 @@ msgid "" "> > 3. `as.numeric(human_age)` yields `1 2 3 4 4` because factors are stored as integers (here, 1:4), each of which is associated with a label (here, 28, 35, 56, and 63). Converting the factor to a numeric vector gives us the underlying integers, not the labels. If we want the original numbers, we need to convert `human_age` to a character vector and then to a numeric vector (why does this work?). This comes up in real life when we accidentally include a character somewhere in a column of a .csv file supposed to only contain numbers, and forget to set `stringsAsFactors=FALSE` when we read in the data." msgstr "" ">\n" -"> > ## Solution to Challenge 1\n" +"> > ## チャレンジ1の解答\n" "> > 1. `human_age <- cats$age * 7`\n" -"> > 2. `human_age <- factor(human_age)`. `as.factor(human_age)` works just as well.\n" -"> > 3. `as.numeric(human_age)` yields `1 2 3 4 4` because factors are stored as integers (here, 1:4), each of which is associated with a label (here, 28, 35, 56, and 63). Converting the factor to a numeric vector gives us the underlying integers, not the labels. If we want the original numbers, we need to convert `human_age` to a character vector and then to a numeric vector (why does this work?). This comes up in real life when we accidentally include a character somewhere in a column of a .csv file supposed to only contain numbers, and forget to set `stringsAsFactors=FALSE` when we read in the data." +"> > 2. `human_age <- factor(human_age)`. `as.factor(human_age)` でもうまくいきます\n" +"> > 3. `as.numeric(human_age)` からは、`1 2 3 4 4` が返ってきます。なぜなら、順序なし文字型は、それぞれが、ラベル(ここでは、28、35、56、63)に紐づけられた整数型(ここでは、1:4)として蓄積されているからです。順序なし文字型を数値型に変換する際は、ラベルの値ではなく、裏にある整数に変換されるのです。もとの数が欲しい場合は、`human_age`を文字ベクトルにしてから、数値ベクトルにする必要があります(なぜこれでうまくいくのでしょう?)。この問題は、csvファイルの中で数だけを持つはずの列のどこかにうっかり文字を入れてしまい、データを読み込むとき`stringsAsFactors=FALSE`を設定し忘れてしまったときなどに起こります。" # header #: r-novice-gapminder/_episodes/05-data-structures-part2.md:250 msgid "## Removing rows" -msgstr "## Removing rows" +msgstr "## 行の削除" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:252 msgid "" @@ -7552,9 +7513,8 @@ msgid "" "first attempt to add a \"tortoiseshell\" cat to the data frame we have accidentally\n" "added a garbage row:" msgstr "" -"We now know how to add rows and columns to our data frame in R—but in our\n" -"first attempt to add a \"tortoiseshell\" cat to the data frame we have accidentally\n" -"added a garbage row:" +"Rのデータフレームに行列を加える方法は分かりましたが、猫データフレームに\"tortoiseshell\"を加える最初の試みで、\n" +"うっかり不要な行を加えてしまいました。" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:257 @@ -7590,7 +7550,7 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:274 msgid "We can ask for a data frame minus this offending row:" -msgstr "We can ask for a data frame minus this offending row:" +msgstr "この問題の行を除くようにデータフレームに頼みましょう:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:277 @@ -7625,19 +7585,17 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:293 msgid "Notice the comma with nothing after it to indicate that we want to drop the entire fourth row." -msgstr "Notice the comma with nothing after it to indicate that we want to drop the entire fourth row." +msgstr "コンマの後に何もないのは、4番目の行の全部を削除して欲しいということを示している点に留意しましょう。" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:295 msgid "" "Note: we could also remove both new rows at once by putting the row numbers\n" "inside of a vector: `cats[c(-4,-5), ]`" -msgstr "" -"Note: we could also remove both new rows at once by putting the row numbers\n" -"inside of a vector: `cats[c(-4,-5), ]`" +msgstr "注意:ベクトルの中に行番号を入れれば、新しく追加した行を両方削除することもできす:`cats[c(-4,-5), ]`" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:298 msgid "Alternatively, we can drop all rows with `NA` values:" -msgstr "Alternatively, we can drop all rows with `NA` values:" +msgstr "または、`NA`の値がある全ての行を除くこともできます:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:301 @@ -7652,7 +7610,7 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:317 msgid "Let's reassign the output to `cats`, so that our changes will be permanent:" -msgstr "Let's reassign the output to `cats`, so that our changes will be permanent:" +msgstr "変更した内容を今後も使えるように、この結果を再度`cats` に入れましょう:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:320 @@ -7668,11 +7626,11 @@ msgstr "" # header #: r-novice-gapminder/_episodes/05-data-structures-part2.md:325 msgid "## Removing columns " -msgstr "## Removing columns " +msgstr "## 列の削除 " #: r-novice-gapminder/_episodes/05-data-structures-part2.md:327 msgid "We can also remove columns in our data frame. What if we want to remove the column \"age\". We can remove it in two ways, by variable number or by index. " -msgstr "We can also remove columns in our data frame. What if we want to remove the column \"age\". We can remove it in two ways, by variable number or by index. " +msgstr "データフレームから列を削除することもできます。列「age」を削除したい場合、どうすれば削除できるのでしょう。この場合、要素番号か見出しを使う2つの方法があります。" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:330 @@ -7707,11 +7665,11 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:346 msgid "Notice the comma with nothing before it, indicating we want to keep all of the rows. " -msgstr "Notice the comma with nothing before it, indicating we want to keep all of the rows. " +msgstr "全ての行を持っていたいということを示すため、コンマの前に何も入っていない点に留意しましょう。" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:348 msgid "Alternatively, we can drop the column by using the index name. " -msgstr "Alternatively, we can drop the column by using the index name. " +msgstr "または、要素番号の名前を使って列を削除することもできます:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:351 @@ -7729,7 +7687,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/05-data-structures-part2.md:368 msgid "## Appending to a data frame" -msgstr "## Appending to a data frame" +msgstr "## データフレームへの追加" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:370 msgid "" @@ -7737,9 +7695,8 @@ msgid "" "vectors and rows are lists.* We can also glue two data frames\n" "together with `rbind`:" msgstr "" -"The key to remember when adding data to a data frame is that *columns are\n" -"vectors and rows are lists.* We can also glue two data frames\n" -"together with `rbind`:" +"データフレームにデータを加えるときに覚えておくべき重要なことは、*列はベクトルで、行はリスト* であることです。\n" +"2つのデータフレームを `rbind` を使ってくっつけることもできます:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:375 @@ -7785,9 +7742,7 @@ msgstr "" msgid "" "But now the row names are unnecessarily complicated. We can remove the rownames,\n" "and R will automatically re-name them sequentially:" -msgstr "" -"But now the row names are unnecessarily complicated. We can remove the rownames,\n" -"and R will automatically re-name them sequentially:" +msgstr "しかし、いまや行の名前は必要以上に複雑です。この列名は削除することができます。削除すると、Rは自動的に連続する名称をつけます。" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:399 @@ -7863,7 +7818,7 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> You can create a new data frame right from within R with the following syntax:\n" +"> 新しいデータフレームを、以下の構文で、Rで正しく作成できます:\n" "> \n" "> ~~~\n" "> df <- data.frame(id = c(\"a\", \"b\", \"c\"),\n" @@ -7872,16 +7827,16 @@ msgstr "" "> stringsAsFactors = FALSE)\n" "> ~~~\n" "> {: .language-r}\n" -"> Make a data frame that holds the following information for yourself:\n" +"> 自分で、以下の情報を持つデータフレームを作ってみましょう:\n" ">\n" "> - first name\n" "> - last name\n" "> - lucky number\n" ">\n" -"> Then use `rbind` to add an entry for the people sitting beside you.\n" -"> Finally, use `cbind` to add a column with each person's answer to the question, \"Is it time for coffee break?\"\n" +"> そして `rbind` を使って、隣に座っている人の入力したものを加えましょう\n" +"> 最後に `cbind` を使って、「コーヒーブレイクの時間ですか?」という質問への各自の回答を加えましょう\n" ">\n" -"> > ## Solution to Challenge 2\n" +"> > ## チャレンジ2の解答\n" "> > \n" "> > ~~~\n" "> > df <- data.frame(first = c(\"Grace\"),\n" @@ -7896,7 +7851,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/05-data-structures-part2.md:454 msgid "## Realistic example" -msgstr "## Realistic example" +msgstr "## 現実的な例" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:455 msgid "" @@ -7904,9 +7859,9 @@ msgid "" "now let's use those skills to digest a more realistic dataset. Let's read in the\n" "`gapminder` dataset that we downloaded previously:" msgstr "" -"So far, you have seen the basics of manipulating data frames with our cat data;\n" -"now let's use those skills to digest a more realistic dataset. Let's read in the\n" -"`gapminder` dataset that we downloaded previously:" +"これまで、猫のデータフレームで基本的なデータ操作を見てきました。\n" +"ここからは、もっと現実的なデータセットで学んだスキルを試してみましょう。\n" +"前にダウンロードした `gapminder` のデータセットを読み込みましょう:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:460 @@ -7922,7 +7877,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/05-data-structures-part2.md:465 msgid "> ## Miscellaneous Tips" -msgstr "> ## Miscellaneous Tips" +msgstr "> ## いろいろなヒント" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:466 msgid "" @@ -7950,11 +7905,11 @@ msgid "" "> converting them to plain text first by using the [readxl](https://cran.r-project.org/web/packages/readxl/index.html) package." msgstr "" ">\n" -"> * Another type of file you might encounter are tab-separated value files (.tsv). To specify a tab as a separator, use `\"\\\\t\"` or `read.delim()`.\n" +"> * もう一つの遭遇するかもしれないファイルの種類は、タブで分けられた値のファイル(.tsv)です。タブを値を分けるものとして指定するためには、`\"\\\\t\"` または`read.delim()`を使いましょう。\n" ">\n" -"> * Files can also be downloaded directly from the Internet into a local\n" -"> folder of your choice onto your computer using the `download.file` function.\n" -"> The `read.csv` function can then be executed to read the downloaded file from the download location, for example,\n" +"> * ファイルは、`download.file` 関数を使って、インターネットから直接、自分のコンピューターの\n" +"> お好みのローカルフォルダへダウンロードすることもできます。\n" +"> `read.csv` 関数は、ダウンロードされたファイルをダウンロードされた場所から読み込む形で実行されます。例えば、\n" "> \n" "> ~~~\n" "> download.file(\"https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_data.csv\", destfile = \"data/gapminder_data.csv\")\n" @@ -7962,23 +7917,23 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> * Alternatively, you can also read in files directly into R from the Internet by replacing the file paths with a web address in `read.csv`. One should note that in doing this no local copy of the csv file is first saved onto your computer. For example,\n" +"> * または、`read.csv` のファイルパスをウェブアドレスに置き換えることで、インターネットからRへ直接読み込むこともできます。こうすると、csvファイルのローカルコピーが、最初に自分のコンピューターに保存されないことに留意する必要があります。例えば、\n" "> \n" "> ~~~\n" "> gapminder <- read.csv(\"https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_data.csv\")\n" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> * You can read directly from excel spreadsheets without\n" -"> converting them to plain text first by using the [readxl](https://cran.r-project.org/web/packages/readxl/index.html) package." +"> * エクセルのシートからテキスト形式に変換することなく、直接読み込むことも、\n" +"> [readxl](https://cran.r-project.org/web/packages/readxl/index.html) パッケージで可能です。" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:490 msgid "" "Let's investigate gapminder a bit; the first thing we should always do is check\n" "out what the data looks like with `str`:" msgstr "" -"Let's investigate gapminder a bit; the first thing we should always do is check\n" -"out what the data looks like with `str`:" +"gapminderを少し見てみましょう。いつも、まずしなければいけないことは、\n" +"データがどうなっているかを`str`で見てみることです:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:494 @@ -8019,7 +7974,7 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:512 msgid "We can also examine individual columns of the data frame with our `typeof` function:" -msgstr "We can also examine individual columns of the data frame with our `typeof` function:" +msgstr "データフレームのそれぞれの列を `typeof` 関数で調べることもできます:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:515 @@ -8071,9 +8026,9 @@ msgid "" "remembering that `str(gapminder)` said there were 1704 observations of 6\n" "variables in gapminder, what do you think the following will produce, and why?" msgstr "" -"We can also interrogate the data frame for information about its dimensions;\n" -"remembering that `str(gapminder)` said there were 1704 observations of 6\n" -"variables in gapminder, what do you think the following will produce, and why?" +"データフレームの次元について見てみることもできます。\n" +" `str(gapminder)` が、gapminderには、6変数について1704の標本があると言っていたことを念頭に置き、\n" +"以下から何が出てくると思いますか?それはなぜですか?" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:560 @@ -8092,9 +8047,8 @@ msgid "" "number of rows it has (1704), but this is not the case; remember, a data frame\n" "is a *list of vectors and factors*:" msgstr "" -"A fair guess would have been to say that the length of a data frame would be the\n" -"number of rows it has (1704), but this is not the case; remember, a data frame\n" -"is a *list of vectors and factors*:" +"予想としては、データフレームの長さは行数(1704)だと思うものですが、実はそうではありません。\n" +"データフレームは、*ベクトルと順序なし因子型のリストである*ということを思い出しましょう:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:577 @@ -8112,8 +8066,8 @@ msgid "" "When `length` gave us 6, it's because gapminder is built out of a list of 6\n" "columns. To get the number of rows and columns in our dataset, try:" msgstr "" -"When `length` gave us 6, it's because gapminder is built out of a list of 6\n" -"columns. To get the number of rows and columns in our dataset, try:" +"`length`が、6と返ってくるのは、gapminderは、6つの列のリストから成っているからです。\n" +"データセットで、行と列の数を知るためには、こうしてみましょう:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:593 @@ -8150,7 +8104,7 @@ msgstr "" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:619 msgid "Or, both at once:" -msgstr "Or, both at once:" +msgstr "または、両方を同時に:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:622 @@ -8181,9 +8135,7 @@ msgstr "" msgid "" "We'll also likely want to know what the titles of all the columns are, so we can\n" "ask for them later:" -msgstr "" -"We'll also likely want to know what the titles of all the columns are, so we can\n" -"ask for them later:" +msgstr "全ての列のタイトルを知りたいと思うことも多いと思うので、後で聞いてみましょう:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:638 @@ -8217,20 +8169,18 @@ msgid "" "interprets data, and the importance of *strict consistency* in how we record our\n" "data." msgstr "" -"At this stage, it's important to ask ourselves if the structure R is reporting\n" -"matches our intuition or expectations; do the basic data types reported for each\n" -"column make sense? If not, we need to sort any problems out now before they turn\n" -"into bad surprises down the road, using what we've learned about how R\n" -"interprets data, and the importance of *strict consistency* in how we record our\n" -"data." +"この段階で、Rが伝える構造が自分の直感や予想と合っているかを自問することが大切です。\n" +"それぞれの列の基本的なデータ型は、思った通りのデータ型になってますか?もしなっていないのなら、今後、予想外の事態を引き起こさないように、\n" +"今の時点で、問題を解決しておく必要があります。そのためには、これまでに学んだ、Rがどのようにデータを解釈するか、\n" +"そしてデータを記録する際の*厳格な整合性*の重要性といった知識を活かしましょう。" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:657 msgid "" "Once we're happy that the data types and structures seem reasonable, it's time\n" "to start digging into our data proper. Check out the first few lines:" msgstr "" -"Once we're happy that the data types and structures seem reasonable, it's time\n" -"to start digging into our data proper. Check out the first few lines:" +"データ型と構造に満足することができたら、データを詳しく見始めることができます。\n" +"最初のいくつかの行を見てみましょう:" # code block #: r-novice-gapminder/_episodes/05-data-structures-part2.md:661 @@ -8294,12 +8244,12 @@ msgid "" "> > {: .r}" msgstr "" ">\n" -"> It's good practice to also check the last few lines of your data and some in the middle. How would you do this?\n" +"> 最後と中間のいくつかの行を確認するのは良い習慣です。どうしたらこれらの行を見ることができるのでしょう?\n" ">\n" -"> Searching for ones specifically in the middle isn't too hard but we could simply ask for a few lines at random. How would you code this?\n" +"> ちょうど真ん中にあるものを探すことは、難しくはありません。しかし、いくつかの行を無作為に尋ねることもできます。これはどうコードにすればよいでしょうか。\n" ">\n" -"> > ## Solution to Challenge 3\n" -"> > To check the last few lines it's relatively simple as R already has a function for this:\n" +"> > ## チャレンジ3の解答\n" +"> > 最後のいくつかの行を調べるのは、比較的簡単です。Rには既に関数があるからです:\n" "> > \n" "> > ~~~\n" "> > tail(gapminder)\n" @@ -8307,10 +8257,10 @@ msgstr "" "> > ~~~\n" "> > {: .r}\n" "> > \n" -"> > What about a few arbitrary rows just for sanity (or insanity depending on your view)?\n" -"> > ## Tip: There are several ways to achieve this.\n" -"> > The solution here presents one form using nested functions. i.e. a function passed as an argument to another function. This might sound like a new concept but you are already using it in fact.\n" -"> > Remember my_dataframe[rows, cols] will print to screen your data frame with the number of rows and columns you asked for (although you might have asked for a range or named columns for example). How would you get the last row if you don't know how many rows your data frame has? R has a function for this. What about getting a (pseudorandom) sample? R also has a function for this.\n" +"> > すっきりするために(人によっては、もやっとするかもしれませんが)、いくつかの任意の行については、どうでしょうか。\n" +"> > ## ヒント:これには、いくつか方法があります。\n" +"> > ここでの解答は、関数を入れ子にしたもの(つまり、他の関数に、因数として渡される関数)です。新しい概念のように聞こえるかもしれませんが、実はもう使っています。\n" +"> > my_dataframe[rows, cols] は、(範囲または名前が付いた列を例えば聞いていたかもしれないとしても)質問した行と列の数と共にデータフレームを画面に表示させます。もし、データフレームに、いくつ行があるか知らない場合、どう最後の行を得るのでしょうか。Rには、そのための関数があります。では(疑似ランダム)サンプルを得るにはどうすればよいでしょうか。Rには、そのための関数もあります。\n" "> > ~~~\n" "> > gapminder[sample(nrow(gapminder), 5), ]\n" "> > ~~~\n" @@ -8320,9 +8270,7 @@ msgstr "" msgid "" "To make sure our analysis is reproducible, we should put the code\n" "into a script file so we can come back to it later." -msgstr "" -"To make sure our analysis is reproducible, we should put the code\n" -"into a script file so we can come back to it later." +msgstr "分析を再現可能にするためには、後で使えるようにコードをスクリプトファイルに置く必要があります。" #: r-novice-gapminder/_episodes/05-data-structures-part2.md:710 msgid "" @@ -8350,22 +8298,22 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Go to file -> new file -> R script, and write an R script\n" -"> to load in the gapminder dataset. Put it in the `scripts/`\n" -"> directory and add it to version control.\n" +"> まず、file -> new file -> R scriptへ行き、gapminder データセットを\n" +"> 読み込むR scriptを書きましょう。それを、 `scripts/` ディレクトリに置き、\n" +"> バージョン管理に追加しましょう。\n" ">\n" -"> Run the script using the `source` function, using the file path\n" -"> as its argument (or by pressing the \"source\" button in RStudio).\n" +"> そのスクリプトを `source` 関数を使って走らせましょう。ファイルパスを引数にしましょう\n" +"> (または、RStudioで「source」ボタンを押しましょう).\n" ">\n" -"> > ## Solution to Challenge 4\n" -"> > The contents of `scripts/load-gapminder.R`:\n" +"> > ## チャレンジ4の解答\n" +"> > `scripts/load-gapminder.R`の内容:\n" "> > \n" "> > ~~~\n" "> > download.file(\"https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages/_episodes_rmd/data/gapminder_data.csv\", destfile = \"data/gapminder_data.csv\")\n" "> > gapminder <- read.csv(file = \"data/gapminder_data.csv\")\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > To run the script and load the data into the `gapminder` variable:\n" +"> > `gapminder` 変数にデータを読み込みスクリプトを走らせるためには:\n" "> > \n" "> > ~~~\n" "> > source(file = \"scripts/load-gapminder.R\")\n" @@ -8390,18 +8338,18 @@ msgid "" "> >" msgstr "" ">\n" -"> Read the output of `str(gapminder)` again;\n" -"> this time, use what you've learned about factors, lists and vectors,\n" -"> as well as the output of functions like `colnames` and `dim`\n" -"> to explain what everything that `str` prints out for gapminder means.\n" -"> If there are any parts you can't interpret, discuss with your neighbors!\n" +"> `str(gapminder)` の結果を再び読みましょう。\n" +"> 今度は、順序なし因数、リスト、ベクトルについて学んだことを使いましょう。\n" +"> gapminder が何を意味するか `str` が表示する全てのことを説明するために、\n" +"> `colnames` や `dim` などの出力関数を使いましょう。\n" +"> 理解できないところがあれば、近くの人と話し合ってみましょう。\n" ">\n" -"> > ## Solution to Challenge 5\n" +"> > ## チャレンジ5の解答\n" "> >\n" -"> > The object `gapminder` is a data frame with columns\n" -"> > - `country` and `continent` are factors.\n" -"> > - `year` is an integer vector.\n" -"> > - `pop`, `lifeExp`, and `gdpPercap` are numeric vectors.\n" +"> > `gapminder` というオブジェクトは、データフレームで、\n" +"> > - `country` と `continent` という順序なし因子型、\n" +"> > - `year` という整数型のベクトル、\n" +"> > - `pop`、 `lifeExp`、 `gdpPercap` という数値型のベクトルの行を持っています。\n" "> >" # Front Matter @@ -8454,8 +8402,8 @@ msgid "" "R has many powerful subset operators. Mastering them will allow you to\n" "easily perform complex operations on any kind of dataset." msgstr "" -"R has many powerful subset operators. Mastering them will allow you to\n" -"easily perform complex operations on any kind of dataset." +"Rには、かなり使える部分集合の演算子があります。もし、それをマスターできたら、\n" +"どんなデータセットにも複雑な演算を簡単にすることができます。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:27 msgid "" @@ -8467,7 +8415,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:30 msgid "Let's start with the workhorse of R: a simple numeric vector." -msgstr "Let's start with the workhorse of R: a simple numeric vector." +msgstr "Rの働き頭から始めましょう:簡単な数値ベクトル" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:33 @@ -8500,7 +8448,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:48 msgid "> ## Atomic vectors" -msgstr "> ## Atomic vectors" +msgstr "> ## 原子ベクトル" #: r-novice-gapminder/_episodes/06-data-subsetting.md:49 msgid "" @@ -8508,28 +8456,24 @@ msgid "" "> In R, simple vectors containing character strings, numbers, or logical values are called *atomic* vectors because they can't be further simplified." msgstr "" ">\n" -"> In R, simple vectors containing character strings, numbers, or logical values are called *atomic* vectors because they can't be further simplified." +"> Rでは、文字列、数値、論理値を含む単純なベクトルは、*原子(atomic)* ベクトルと呼ばれています。その理由は、原子ベクトルはそれ以上単純化できないからです。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:53 msgid "" "So now that we've created a dummy vector to play with, how do we get at its\n" "contents?" -msgstr "" -"So now that we've created a dummy vector to play with, how do we get at its\n" -"contents?" +msgstr "ちょっと触ってみるためのダミーベクトルを作ることができたのですが、どうやってベクトルの中身を使うのでしょう?" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:56 msgid "## Accessing elements using their indices" -msgstr "## Accessing elements using their indices" +msgstr "## 要素番号で要素を使う" #: r-novice-gapminder/_episodes/06-data-subsetting.md:58 msgid "" "To extract elements of a vector we can give their corresponding index, starting\n" "from one:" -msgstr "" -"To extract elements of a vector we can give their corresponding index, starting\n" -"from one:" +msgstr "ベクトルの要素を抽出するためには、対応する1から始まる要素番号を使います:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:62 @@ -8585,12 +8529,12 @@ msgid "" "It may look different, but the square brackets operator is a function. For vectors\n" "(and matrices), it means \"get me the nth element\"." msgstr "" -"It may look different, but the square brackets operator is a function. For vectors\n" -"(and matrices), it means \"get me the nth element\"." +"違うふうに見えるかもしれませんが、各括弧の演算子は、関数なのです。ベクトル(及び行列)の場合は、\n" +"「n番目の要素をちょうだい」ということを意味しています。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:92 msgid "We can ask for multiple elements at once:" -msgstr "We can ask for multiple elements at once:" +msgstr "複数の要素を一度に頼むこともできます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:95 @@ -8619,7 +8563,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:108 msgid "Or slices of the vector:" -msgstr "Or slices of the vector:" +msgstr "または、ベクトルのスライスを頼むこともできます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:111 @@ -8647,7 +8591,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:124 msgid "the `:` operator creates a sequence of numbers from the left element to the right." -msgstr "the `:` operator creates a sequence of numbers from the left element to the right." +msgstr "この演算子 `:` は、左から右の要素の一連番号を作ります。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:126 @@ -8685,7 +8629,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:153 msgid "We can ask for the same element multiple times:" -msgstr "We can ask for the same element multiple times:" +msgstr "同じ要素を何度も頼むこともできます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:156 @@ -8713,7 +8657,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:169 msgid "If we ask for an index beyond the length of the vector, R will return a missing value:" -msgstr "If we ask for an index beyond the length of the vector, R will return a missing value:" +msgstr "もしベクトルの長さ以上の要素番号を頼んだ場合、Rは、欠測値を返します:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:171 @@ -8741,11 +8685,11 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:184 msgid "This is a vector of length one containing an `NA`, whose name is also `NA`." -msgstr "This is a vector of length one containing an `NA`, whose name is also `NA`." +msgstr "これは、 `NA` を含む、`NA` という名前の長さ1のベクトルです。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:186 msgid "If we ask for the 0th element, we get an empty vector:" -msgstr "If we ask for the 0th element, we get an empty vector:" +msgstr "もし、0番目の要素を頼んだ場合、空ベクトルが返ってきます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:189 @@ -8772,7 +8716,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:201 msgid "> ## Vector numbering in R starts at 1" -msgstr "> ## Vector numbering in R starts at 1" +msgstr "> ## Rのベクトル番号は、1から始まる" #: r-novice-gapminder/_episodes/06-data-subsetting.md:202 msgid "" @@ -8781,21 +8725,21 @@ msgid "" "> element of a vector has an index of 0. In R, the first element is 1." msgstr "" ">\n" -"> In many programming languages (C and Python, for example), the first\n" -"> element of a vector has an index of 0. In R, the first element is 1." +"> 多くのプログラミング言語(例えば、C、Python)では、ベクトルの最初の\n" +"> 要素の要素番号は0です。Rでは、最初の要素番号は1なのです。" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:207 msgid "## Skipping and removing elements" -msgstr "## Skipping and removing elements" +msgstr "## 要素を飛ばす、削除する" #: r-novice-gapminder/_episodes/06-data-subsetting.md:209 msgid "" "If we use a negative number as the index of a vector, R will return\n" "every element *except* for the one specified:" msgstr "" -"If we use a negative number as the index of a vector, R will return\n" -"every element *except* for the one specified:" +"もし、負の番号をベクトルの要素番号として使った場合、Rは指定された番号\n" +" *以外の* 全ての要素を返します:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:213 @@ -8823,7 +8767,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:226 msgid "We can skip multiple elements:" -msgstr "We can skip multiple elements:" +msgstr "複数の要素を飛ばすこともできます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:229 @@ -8852,7 +8796,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:242 msgid "> ## Tip: Order of operations" -msgstr "> ## Tip: Order of operations" +msgstr "> ## ヒント:演算の順番" #: r-novice-gapminder/_episodes/06-data-subsetting.md:243 msgid "" @@ -8875,9 +8819,8 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> A common trip up for novices occurs when trying to skip\n" -"> slices of a vector. It's natural to try to negate a\n" -"> sequence like so:\n" +"> 初心者のよくある失敗は、ベクトルのスライスを飛ばしてしまうことです。\n" +"> 数列に負の符号を付けようとするとき、次のようにすることはありがちです:\n" ">\n" "> \n" "> ~~~\n" @@ -8921,12 +8864,12 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> But remember the order of operations. `:` is really a function.\n" -"> It takes its first argument as -1, and its second as 3,\n" -"> so generates the sequence of numbers: `c(-1, 0, 1, 2, 3)`.\n" +"> でも、演算の順番を思い出してみて下さい。`:` は、実際には、関数なのです。\n" +"> 最初の引数を-1、次のを3として認識し、次のような数列を生成します。\n" +"> `c(-1, 0, 1, 2, 3)`\n" ">\n" -"> The correct solution is to wrap that function call in brackets, so\n" -"> that the `-` operator applies to the result:\n" +"> 正解は、関数を呼ぶ部分を括弧で囲むことです。\n" +"> そうすると関数の結果全てに`-` の演算子が適応されます:\n" ">\n" "> \n" "> ~~~\n" @@ -8945,9 +8888,7 @@ msgstr "" msgid "" "To remove elements from a vector, we need to assign the result back\n" "into the variable:" -msgstr "" -"To remove elements from a vector, we need to assign the result back\n" -"into the variable:" +msgstr "ベクトルから要素を削除するには、結果を変数に戻してやる必要があります。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:289 @@ -8997,7 +8938,7 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> Given the following code:\n" +"> 以下のコードがあるとします:\n" ">\n" "> \n" "> ~~~\n" @@ -9026,7 +8967,7 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> Come up with at least 2 different commands that will produce the following output:\n" +"> 以下のアウトプットを得るために、少なくとも2つの異なるコマンドを考えてください:\n" ">\n" "> \n" "> ~~~\n" @@ -9083,9 +9024,9 @@ msgid "" "> >" msgstr "" ">\n" -"> After you find 2 different commands, compare notes with your neighbour. Did you have different strategies?\n" +"> 2つの異なるコマンドを考えた後、隣の人と結果を比べましょう。自分とは違う案でしたか?\n" ">\n" -"> > ## Solution to challenge 1\n" +"> > ## チャレンジ1の解答\n" "> >\n" "> > \n" "> > ~~~\n" @@ -9131,11 +9072,11 @@ msgstr "" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:379 msgid "## Subsetting by name" -msgstr "## Subsetting by name" +msgstr "## 名前で部分集合を作る" #: r-novice-gapminder/_episodes/06-data-subsetting.md:381 msgid "We can extract elements by using their name, instead of extracting by index:" -msgstr "We can extract elements by using their name, instead of extracting by index:" +msgstr "要素番号で抜き出す代わりに、名前で要素を抽出することもできます。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:384 @@ -9146,7 +9087,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"x <- c(a=5.4, b=6.2, c=7.1, d=4.8, e=7.5) # we can name a vector 'on the fly'\n" +"x <- c(a=5.4, b=6.2, c=7.1, d=4.8, e=7.5) # ベクトルを'その場で'名づけることができます\n" "x[c(\"a\", \"c\")]\n" "~~~" @@ -9156,18 +9097,18 @@ msgid "" "position of various elements can often change when chaining together\n" "subsetting operations, but the names will always remain the same!" msgstr "" -"This is usually a much more reliable way to subset objects: the\n" -"position of various elements can often change when chaining together\n" -"subsetting operations, but the names will always remain the same!" +"オブジェクトの部分集合を作るには、この方法の方が確実なやり方です:要素の場所は、\n" +"部分集合の演算子を繋いで使うことでよく変わるのですが。\n" +"名前は変わらないのです!" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:402 msgid "## Subsetting through other logical operations" -msgstr "## Subsetting through other logical operations" +msgstr "## 他の論理演算子を使って部分集合を作る" #: r-novice-gapminder/_episodes/06-data-subsetting.md:404 msgid "We can also use any logical vector to subset:" -msgstr "We can also use any logical vector to subset:" +msgstr "どんな論理ベクトルでも部分集合を作ることができます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:407 @@ -9200,9 +9141,8 @@ msgid "" "use them to succinctly subset vectors: the following statement gives\n" "the same result as the previous one." msgstr "" -"Since comparison operators (e.g. `>`, `<`, `==`) evaluate to logical vectors, we can also\n" -"use them to succinctly subset vectors: the following statement gives\n" -"the same result as the previous one." +"比較演算子(例えば、 `>`、`<`、 `==`)は、その結果が論理ベクトルになるので、簡潔にベクトルの部分集合を作ることができます。\n" +"つまり、以下の宣言は、前と同じ結果を返します。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:425 @@ -9221,17 +9161,17 @@ msgid "" "a logical vector `c(FALSE, FALSE, TRUE, FALSE, TRUE)`, and then\n" "selects the elements of `x` corresponding to the `TRUE` values." msgstr "" -"Breaking it down, this statement first evaluates `x>7`, generating\n" -"a logical vector `c(FALSE, FALSE, TRUE, FALSE, TRUE)`, and then\n" -"selects the elements of `x` corresponding to the `TRUE` values." +"分割すると、この宣言は、最初に `x>7` を計算し、論理ベクトル\n" +"`c(FALSE, FALSE, TRUE, FALSE, TRUE)` を作ります。それから、\n" +"`TRUE` の値に対応する `x` 要素を選択します。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:442 msgid "" "We can use `==` to mimic the previous method of indexing by name\n" "(remember you have to use `==` rather than `=` for comparisons):" msgstr "" -"We can use `==` to mimic the previous method of indexing by name\n" -"(remember you have to use `==` rather than `=` for comparisons):" +"名前で特定するという既出の方法を真似するため、 `==` を使うこともできます。\n" +"(比較には、 `=` ではなく、 `==` を使わないといけません):" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:446 @@ -9247,7 +9187,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:459 msgid "> ## Tip: Combining logical conditions" -msgstr "> ## Tip: Combining logical conditions" +msgstr "> ## ヒント:論理条件を組み合わせる" #: r-novice-gapminder/_episodes/06-data-subsetting.md:460 msgid "" @@ -9279,31 +9219,28 @@ msgid "" "> vector are `TRUE`)." msgstr "" ">\n" -"> We often want to combine multiple logical\n" -"> criteria. For example, we might want to find all the countries that are\n" -"> located in Asia **or** Europe **and** have life expectancies within a certain\n" -"> range. Several operations for combining logical vectors exist in R:\n" +"> 複数の論理基準を組み合わせたい場合はよくあります。\n" +"> 例えば、アジア**または** ヨーロッパに位置し、なお**かつ** ある一定の範囲の平均余命\n" +"> の国を見つけたいとします。\n" +"> Rにが論理ベクトルを複数組み合わせる演算子があります:\n" ">\n" -"> * `&`, the \"logical AND\" operator: returns `TRUE` if both the left and right\n" -"> are `TRUE`.\n" -"> * `|`, the \"logical OR\" operator: returns `TRUE`, if either the left or right\n" -"> (or both) are `TRUE`.\n" +"> * `&`、「論理積」演算子:もし左と右の両方が `TRUE` であれば、`TRUE`\n" +"> * `|`、「論理和」 演算子:もし左と右のどちらか(または両方)が `TRUE` であれば、`TRUE`\n" ">\n" -"> You may sometimes see `&&` and `||` instead of `&` and `|`. These two-character operators\n" -"> only look at the first element of each vector and ignore the\n" -"> remaining elements. In general you should not use the two-character\n" -"> operators in data analysis; save them\n" -"> for programming, i.e. deciding whether to execute a statement.\n" +"> `&` 及び `|` の代わりに、 `&&` 及び `||` を見かけることもあるでしょう。\n" +"> この二重になっている演算子は、それぞれのベクトルの最初の要素だけを見て、残りを無視するものです。\n" +"> 一般的に、この二重になっている演算子は、データ分析では使わずに、\n" +"> プログラミングの際に(つまり、ある宣言を実行するかどうかを決める際に)\n" +"> 使うことをおすすめします。\n" ">\n" -"> * `!`, the \"logical NOT\" operator: converts `TRUE` to `FALSE` and `FALSE` to\n" -"> `TRUE`. It can negate a single logical condition (eg `!TRUE` becomes\n" -"> `FALSE`), or a whole vector of conditions(eg `!c(TRUE, FALSE)` becomes\n" -"> `c(FALSE, TRUE)`).\n" +"> * `!`、「論理否定」演算子:`TRUE` を `FALSE` に、 `FALSE` を`TRUE`に変換します。\n" +"> 否定できるのは、一つの論理条件(例 `!TRUE` が `FALSE`へ)\n" +"> または、条件のベクトル全体(例 `!c(TRUE, FALSE)` が、\n" +"> `c(FALSE, TRUE)` へ)です。\n" ">\n" -"> Additionally, you can compare the elements within a single vector using the\n" -"> `all` function (which returns `TRUE` if every element of the vector is `TRUE`)\n" -"> and the `any` function (which returns `TRUE` if one or more elements of the\n" -"> vector are `TRUE`)." +"> 加えて、`all` 関数(ベクトルの全ての要素が `TRUE` である場合、`TRUE` を返す)及び\n" +"> `any` 関数(ベクトルのうち最低1つ、`TRUE` がある場合、`TRUE`を返す)を使って\n" +"> ひとつのベクトルの中にある要素を比較することもできます。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:507 msgid "" @@ -9328,9 +9265,9 @@ msgid "" "> > {: .output}" msgstr "" ">\n" -"> Write a subsetting command to return the values in x that are greater than 4 and less than 7.\n" +"> 4よりも大きく7より小さいxの値を返す部分集合を作るコマンドを書きましょう。\n" ">\n" -"> > ## Solution to challenge 2\n" +"> > ## チャレンジ2の解答\n" "> >\n" "> > \n" "> > ~~~\n" @@ -9350,7 +9287,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:530 msgid "> ## Tip: Non-unique names" -msgstr "> ## Tip: Non-unique names" +msgstr "> ## ヒント:同じ名前がある場合" #: r-novice-gapminder/_episodes/06-data-subsetting.md:531 msgid "" @@ -9374,10 +9311,10 @@ msgid "" ">~~~" msgstr "" ">\n" -"> You should be aware that it is possible for multiple elements in a\n" -"> vector to have the same name. (For a data frame, columns can have\n" -"> the same name --- although R tries to avoid this --- but row names\n" -"> must be unique.) Consider these examples:\n" +"> ベクトルの中の要素に、同じ名前を持つものがあるかもしれないということを知っておく必要があります。\n" +"> (データフレームでは、--- Rは避けようとしますが --- 列に同じ名前を付けることもできます。\n" +"> 一方で、行の名前は、全て違う必要があります)\n" +"> これらの例を考えてみましょう:\n" ">\n" ">\n" ">~~~\n" @@ -9487,7 +9424,7 @@ msgstr "" ">\n" ">\n" ">~~~\n" -"> x[names(x) == 'a'] # returns all three values\n" +"> x[names(x) == 'a'] # 3つ全ての値を返す\n" ">~~~\n" ">{: .language-r}\n" ">\n" @@ -9501,7 +9438,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:598 msgid "> ## Tip: Getting help for operators" -msgstr "> ## Tip: Getting help for operators" +msgstr "> ## ヒント:演算子についてのヘルプを見る" #: r-novice-gapminder/_episodes/06-data-subsetting.md:599 msgid "" @@ -9511,18 +9448,18 @@ msgid "" ">" msgstr "" ">\n" -"> Remember you can search for help on operators by wrapping them in quotes:\n" -"> `help(\"%in%\")` or `?\"%in%\"`.\n" +"> 演算子を引用符で囲むことで、演算子についてのヘルプを検索できることを覚えておきましょう:\n" +"> `help(\"%in%\")` または `?\"%in%\"`.\n" ">" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:605 msgid "## Skipping named elements" -msgstr "## Skipping named elements" +msgstr "## 名前のある要素を飛ばす" #: r-novice-gapminder/_episodes/06-data-subsetting.md:607 msgid "Skipping or removing named elements is a little harder. If we try to skip one named element by negating the string, R complains (slightly obscurely) that it doesn't know how to take the negative of a string:" -msgstr "Skipping or removing named elements is a little harder. If we try to skip one named element by negating the string, R complains (slightly obscurely) that it doesn't know how to take the negative of a string:" +msgstr "名前のある要素を飛ばしたり削除したりすることは少しだけ難しくなります。もし、ある文字列にマイナス記号を付けて飛ばそうとすると、Rは文字列にマイナス記号を付ける方法を知らないと(若干控えめに)抗議するでしょう:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:610 @@ -9533,7 +9470,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"x <- c(a=5.4, b=6.2, c=7.1, d=4.8, e=7.5) # we start again by naming a vector 'on the fly'\n" +"x <- c(a=5.4, b=6.2, c=7.1, d=4.8, e=7.5) # まず、ベクトルにその場で名前を付けることから、また始めます\n" "x[-\"a\"]\n" "~~~" @@ -9550,7 +9487,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:623 msgid "However, we can use the `!=` (not-equals) operator to construct a logical vector that will do what we want:" -msgstr "However, we can use the `!=` (not-equals) operator to construct a logical vector that will do what we want:" +msgstr "でも、`!=` (不等号)演算子を使えば、やってもらいたかったことをしてくれる論理ベクトルが作れます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:626 @@ -9579,7 +9516,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:639 msgid "Skipping multiple named indices is a little bit harder still. Suppose we want to drop the `\"a\"` and `\"c\"` elements, so we try this:" -msgstr "Skipping multiple named indices is a little bit harder still. Suppose we want to drop the `\"a\"` and `\"c\"` elements, so we try this:" +msgstr "複数の名前のある要素番号を飛ばすことは、少しですが、さらに難しくなります。`\"a\"` と`\"c\"` の要素を削除したいとき、以下を試したとしましょう:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:642 @@ -9608,20 +9545,20 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:663 msgid "R did *something*, but it gave us a warning that we ought to pay attention to - and it apparently *gave us the wrong answer* (the `\"c\"` element is still included in the vector)!" -msgstr "R did *something*, but it gave us a warning that we ought to pay attention to - and it apparently *gave us the wrong answer* (the `\"c\"` element is still included in the vector)!" +msgstr "Rは *何か* をしたのですが、私達が注目しなければならない警告も出しました。結果としては、どうやら *間違った回答* が帰ってきたみたいです(`\"c\"` の要素が、ベクトルに含まれています)!" #: r-novice-gapminder/_episodes/06-data-subsetting.md:665 msgid "So what does `!=` actually do in this case? That's an excellent question." -msgstr "So what does `!=` actually do in this case? That's an excellent question." +msgstr "ではいったい、 `!=` は、ここで実際に何をしたのでしょう。これは素晴らしい質問です。" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:667 msgid "### Recycling" -msgstr "### Recycling" +msgstr "### 再利用" #: r-novice-gapminder/_episodes/06-data-subsetting.md:669 msgid "Let's take a look at the comparison component of this code:" -msgstr "Let's take a look at the comparison component of this code:" +msgstr "このコードの比較する部分を見てみましょう:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:672 @@ -9652,10 +9589,9 @@ msgid "" "of the left argument with the corresponding element of its right\n" "argument. What happens when you compare vectors of different lengths?" msgstr "" -"Why does R give `FALSE` as the third element of this vector, when `names(x)[3] != \"c\"` is obviously false?\n" -"When you use `!=`, R tries to compare each element\n" -"of the left argument with the corresponding element of its right\n" -"argument. What happens when you compare vectors of different lengths?" +"Rは、`names(x)[3] != \"c\"` が明らかに間違いであるときに、このベクトルの3番目の要素として、なぜ`TRUE` にしたのでしょうか。\n" +"`!=` を使うとき、Rは、左側の引数のそれぞれの要素を、右側のそれぞれの要素と比較しようとします。\n" +"違う長さのベクトルを比較しようとすると、何が起こるのでしょう?" #: r-novice-gapminder/_episodes/06-data-subsetting.md:697 msgid "![Inequality testing](../fig/06-rmd-inequality.1.png)" @@ -9663,7 +9599,7 @@ msgstr "![Inequality testing](../fig/06-rmd-inequality.1.png)" #: r-novice-gapminder/_episodes/06-data-subsetting.md:699 msgid "When one vector is shorter than the other, it gets *recycled*:" -msgstr "When one vector is shorter than the other, it gets *recycled*:" +msgstr "もし、もう一つのベクトルよりも短いベクトルがあったとき、そのベクトルは*再利用されます*:" #: r-novice-gapminder/_episodes/06-data-subsetting.md:701 msgid "![Inequality testing: results of recycling](../fig/06-rmd-inequality.2.png)" @@ -9675,13 +9611,13 @@ msgid "" "doesn't match the third element of `names(x)`, the value of `!=` is `TRUE`.\n" "Because in this case the longer vector length (5) isn't a multiple of the shorter vector length (2), R printed a warning message. If we had been unlucky and `names(x)` had contained six elements, R would *silently* have done the wrong thing (i.e., not what we intended it to do). This recycling rule can can introduce hard-to-find and subtle bugs!" msgstr "" -"In this case R **repeats** `c(\"a\", \"c\")` as many times as necessary to match `names(x)`, i.e. we get `c(\"a\",\"c\",\"a\",\"c\",\"a\")`. Since the recycled `\"a\"`\n" -"doesn't match the third element of `names(x)`, the value of `!=` is `TRUE`.\n" -"Because in this case the longer vector length (5) isn't a multiple of the shorter vector length (2), R printed a warning message. If we had been unlucky and `names(x)` had contained six elements, R would *silently* have done the wrong thing (i.e., not what we intended it to do). This recycling rule can can introduce hard-to-find and subtle bugs!" +"この場合、Rは `c(\"a\", \"c\")` を `names(x)` に合わせるのに必要な分だけ**繰り返します**。つまり、`c(\"a\",\"c\",\"a\",\"c\",\"a\")`となります。\n" +"再利用された`\"a\"` は、 `names(x)` の3番目の要素と一致しないため、 `!=` の値は、`TRUE` なのです。\n" +"この場合、長い方のベクトルの長さ(5)は、短い方のベクトルの長さ(2)と一致しないので、Rは、警告メッセージを出力しました。もしも運悪く`names(x)` が6つの要素を持っていた場合、Rは*警告せずに* 間違った(意図していなかった)ことを行っていたでしょう。この再利用のルールは、見つけるのがとても難しく、とらえがたいバグをもたらすことがあります!" #: r-novice-gapminder/_episodes/06-data-subsetting.md:707 msgid "The way to get R to do what we really want (match *each* element of the left argument with *all* of the elements of the right argument) it to use the `%in%` operator. The `%in%` operator goes through each element of its left argument, in this case the names of `x`, and asks, \"Does this element occur in the second argument?\". Here, since we want to *exclude* values, we also need a `!` operator to change \"in\" to \"not in\":" -msgstr "The way to get R to do what we really want (match *each* element of the left argument with *all* of the elements of the right argument) it to use the `%in%` operator. The `%in%` operator goes through each element of its left argument, in this case the names of `x`, and asks, \"Does this element occur in the second argument?\". Here, since we want to *exclude* values, we also need a `!` operator to change \"in\" to \"not in\":" +msgstr "Rに本当にやってもらいたいこと(左の引数の *それぞれの* 要素を、右の引数の要素の *全て* にマッチさせこと)をしてもらうには、 `%in%` 演算子を使う必要があります。`%in%` 演算子は、左の引数のそれぞれの要素、ここでは `x` の名前にひとつづつ 「この要素は、2番目の引数にあるかな」と尋ねていきます。ここで、値を *除く* ため、「中にある(in)」を「中にない(not in)」に変える `!` 演算子が必要です。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:710 @@ -9755,71 +9691,69 @@ msgid "" "> > is both correct and easy to type (and read)." msgstr "" ">\n" -"> Selecting elements of a vector that match any of a list of components\n" -"> is a very common data analysis task. For example, the gapminder data set\n" -"> contains `country` and `continent` variables, but no information between\n" -"> these two scales. Suppose we want to pull out information from southeast\n" -"> Asia: how do we set up an operation to produce a logical vector that\n" -"> is `TRUE` for all of the countries in southeast Asia and `FALSE` otherwise?\n" +"> データ分析をするにあたって、リスト内にある要素をベクトルの中から選択するのは\n" +"> よくあることです。例えば、gapminderのデータセットには、\n" +"> `国(country)` 及び `大陸(continent)` 変数があるけれども、これら2つの目盛りの間\n" +"> をつなぐ情報はありません。例えば東南アジアの情報を引き出したい場合、\n" +"> 全ての東南アジアの国を `TRUE` とし、その他を`FALSE`とする論理ベクトルを作る処理を\n" +"> どのように構築するのでしょう?\n" ">\n" -"> Suppose you have these data:\n" +"> 次のようなデータを持っているとします:\n" "> \n" "> ~~~\n" "> seAsia <- c(\"Myanmar\",\"Thailand\",\"Cambodia\",\"Vietnam\",\"Laos\")\n" -"> ## read in the gapminder data that we downloaded in episode 2\n" +"> ## エピソード2でダウンロードしたgapminderのデータを読み込む\n" "> gapminder <- read.csv(\"data/gapminder_data.csv\", header=TRUE)\n" -"> ## extract the `country` column from a data frame (we'll see this later);\n" -"> ## convert from a factor to a character;\n" -"> ## and get just the non-repeated elements\n" +"> ## `country` 列をデータフレームから読み込む(これを後で見ます)\n" +"> ## 順序なし因子を文字列へ変換します\n" +"> ## すると、繰り返していない要素だけを得られます\n" "> countries <- unique(as.character(gapminder$country))\n" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> There's a wrong way (using only `==`), which will give you a warning;\n" -"> a clunky way (using the logical operators `==` and `|`); and\n" -"> an elegant way (using `%in%`). See whether you can come up with all three\n" -"> and explain how they (don't) work.\n" +"> 警告が出てくる、間違った方法( `==` のみを使う)、\n" +"> 粗削りな方法(論理演算子 `==` 及び `|` を使う)、\n" +"> 洗練された方法( `%in%` を使う)があります。\n" +"> これら3つの方法それぞれの例を考え、それぞれがどう動く(動かない)か説明してください。\n" "> \n" -"> > ## Solution to challenge 3\n" +"> > ## チャレンジ3の解答\n" "> >\n" -"> > - The **wrong** way to do this problem is `countries==seAsia`. This\n" -"> > gives a warning (`\"In countries == seAsia : longer object length is not a multiple of shorter object length\"`) and the wrong answer (a vector of all\n" -"> > `FALSE` values), because none of the recycled values of `seAsia` happen\n" -"> > to line up correctly with matching values in `country`.\n" -"> > - The **clunky** (but technically correct) way to do this problem is\n" +"> > - この問題に対する**誤った** 方法は、`countries==seAsia` です。\n" +"> > これには、警告(`\"In countries == seAsia : longer object length is not a multiple of shorter object length\"`)が出ると共に、\n" +"> > 誤った回答(全てが `FALSE` の値を持つベクトル)をもたらします。なぜなら、`seAsia` の再利用された値のどれも、\n" +"> > `country` の値と正しく一致する並びになっていないからです。\n" +"> > - この問題に対する**粗削りな** (でも技術的には合っている)方法は、\n" "> > \n" "> > ~~~\n" "> > (countries==\"Myanmar\" | countries==\"Thailand\" |\n" "> > countries==\"Cambodia\" | countries == \"Vietnam\" | countries==\"Laos\")\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > (or `countries==seAsia[1] | countries==seAsia[2] | ...`). This\n" -"> > gives the correct values, but hopefully you can see how awkward it\n" -"> > is (what if we wanted to select countries from a much longer list?).\n" -"> > - The best way to do this problem is `countries %in% seAsia`, which\n" -"> > is both correct and easy to type (and read)." +"> > (または `countries==seAsia[1] | countries==seAsia[2] | ...`)。\n" +"> > これは正しい値を返すのですが、この方法がどれだけ不格好であるか理解できれば上出来です\n" +"> > (もっと長いリストから国を選ぶ場合は、この方法だったらどうなっていたでしょう?)。\n" +"> > - この問題に対する一番良い方法は、`countries %in% seAsia` で、\n" +"> > 正しい回答でもあり、タイプする(読む)のも楽です。" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:771 msgid "## Handling special values" -msgstr "## Handling special values" +msgstr "## 特別な値を扱う" #: r-novice-gapminder/_episodes/06-data-subsetting.md:773 msgid "" "At some point you will encounter functions in R that cannot handle missing, infinite,\n" "or undefined data." -msgstr "" -"At some point you will encounter functions in R that cannot handle missing, infinite,\n" -"or undefined data." +msgstr "ある時点で、欠測値、無限値、未定義のデータを扱えないRの関数に出会うことでしょう。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:776 msgid "There are a number of special functions you can use to filter out this data:" -msgstr "There are a number of special functions you can use to filter out this data:" +msgstr "データをフィルターするために使える特別な関数がいくつかあります:" # unordered list #: r-novice-gapminder/_episodes/06-data-subsetting.md:778 msgid " * `is.na` will return all positions in a vector, matrix, or data.frame" -msgstr " * `is.na` will return all positions in a vector, matrix, or data.frame" +msgstr " * `is.na` は、ベクトル、行列、データフレームで、 全ての`NA` (または `NaN` )を含む位置を返します" #: r-novice-gapminder/_episodes/06-data-subsetting.md:779 msgid "" @@ -9829,28 +9763,24 @@ msgid "" " that do not contain `NA`, `NaN` or `Inf`.\n" " * `na.omit` will filter out all missing values from a vector" msgstr "" -" containing `NA` (or `NaN`)\n" -" * likewise, `is.nan`, and `is.infinite` will do the same for `NaN` and `Inf`.\n" -" * `is.finite` will return all positions in a vector, matrix, or data.frame\n" -" that do not contain `NA`, `NaN` or `Inf`.\n" -" * `na.omit` will filter out all missing values from a vector" +" * これと同じことを `NaN` 及び `Inf` にするのが `is.nan` 及び `is.infinite` です\n" +" * `is.finite` は、ベクトル、行列、データフレームで、 全ての`NA`, `NaN` または `Inf`を含まない位置を返します\n" +" * `na.omit` は、ベクトルから欠損値をフィルターし、除きます" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:785 msgid "## Factor subsetting" -msgstr "## Factor subsetting" +msgstr "## 順序のない因子の部分集合を作る" #: r-novice-gapminder/_episodes/06-data-subsetting.md:787 msgid "" "Now that we've explored the different ways to subset vectors, how\n" "do we subset the other data structures?" -msgstr "" -"Now that we've explored the different ways to subset vectors, how\n" -"do we subset the other data structures?" +msgstr "これまで部分集合ベクトルを作る色々な方法をやってみましたが、他のデータ構造の部分集合を作るにはどうすればいいでしょう。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:790 msgid "Factor subsetting works the same way as vector subsetting." -msgstr "Factor subsetting works the same way as vector subsetting." +msgstr "順序なし因子の部分集合を作る方法は、ベクトルの部分集合を作る方法と同じです。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:793 @@ -9930,9 +9860,7 @@ msgstr "" msgid "" "Skipping elements will not remove the level\n" "even if no more of that category exists in the factor:" -msgstr "" -"Skipping elements will not remove the level\n" -"even if no more of that category exists in the factor:" +msgstr "要素を飛ばし、その順序なし因子に該当カテゴリーが存在しない場合であっても、水準は削除されません:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:841 @@ -9961,7 +9889,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:854 msgid "## Matrix subsetting" -msgstr "## Matrix subsetting" +msgstr "## 行列の部分周到を作る" #: r-novice-gapminder/_episodes/06-data-subsetting.md:856 msgid "" @@ -9969,9 +9897,8 @@ msgid "" "it takes two arguments: the first applying to the rows, the second\n" "to its columns:" msgstr "" -"Matrices are also subsetted using the `[` function. In this case\n" -"it takes two arguments: the first applying to the rows, the second\n" -"to its columns:" +"行列も `[` 関数を使うことで部分集合を作ることができます。この場合、\n" +"2つの引数があります。最初の引数は適応する行を、2番目の引数は適応する列を指します:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:861 @@ -10007,9 +9934,7 @@ msgstr "" msgid "" "You can leave the first or second arguments blank to retrieve all the\n" "rows or columns respectively:" -msgstr "" -"You can leave the first or second arguments blank to retrieve all the\n" -"rows or columns respectively:" +msgstr "それぞれ全ての列または行を取ってくるために、この最初または2番目の引数を空のままにしておくこともできます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:881 @@ -10049,9 +9974,7 @@ msgstr "" msgid "" "If we only access one row or column, R will automatically convert the result\n" "to a vector:" -msgstr "" -"If we only access one row or column, R will automatically convert the result\n" -"to a vector:" +msgstr "1つの列または行にアクセスした場合、Rは、結果を自動的にベクトルに変換します:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:903 @@ -10080,8 +10003,8 @@ msgid "" "If you want to keep the output as a matrix, you need to specify a *third* argument;\n" "`drop = FALSE`:" msgstr "" -"If you want to keep the output as a matrix, you need to specify a *third* argument;\n" -"`drop = FALSE`:" +"もし、アウトプットを行列のままにしておきたいなら、*3番目の* 因数、\n" +"`drop = FALSE` が必要です:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:919 @@ -10111,9 +10034,7 @@ msgstr "" msgid "" "Unlike vectors, if we try to access a row or column outside of the matrix,\n" "R will throw an error:" -msgstr "" -"Unlike vectors, if we try to access a row or column outside of the matrix,\n" -"R will throw an error:" +msgstr "ベクトルと違って、行列の外の行や列にアクセスしようとしたとき、Rはエラーを返します:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:936 @@ -10140,7 +10061,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:948 msgid "> ## Tip: Higher dimensional arrays" -msgstr "> ## Tip: Higher dimensional arrays" +msgstr "> ## ヒント:高次元列" #: r-novice-gapminder/_episodes/06-data-subsetting.md:949 msgid "" @@ -10151,18 +10072,15 @@ msgid "" ">" msgstr "" ">\n" -"> when dealing with multi-dimensional arrays, each argument to `[`\n" -"> corresponds to a dimension. For example, a 3D array, the first three\n" -"> arguments correspond to the rows, columns, and depth dimension.\n" +"> 多次元列を扱う際、`[` のそれぞれの引数は、次元に対応しています。 \n" +"> 例えば、3次元列は、最初の3つの引数が、行、列、次元の深さに対応してます。\n" ">" #: r-novice-gapminder/_episodes/06-data-subsetting.md:956 msgid "" "Because matrices are vectors, we can\n" "also subset using only one argument:" -msgstr "" -"Because matrices are vectors, we can\n" -"also subset using only one argument:" +msgstr "行列は、ベクトルなので、1つの引数だけを使って部分集合を作ることもできます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:960 @@ -10192,9 +10110,8 @@ msgid "" "are laid out in *column-major format* by default. That is the elements of the\n" "vector are arranged column-wise:" msgstr "" -"This usually isn't useful, and often confusing to read. However it is useful to note that matrices\n" -"are laid out in *column-major format* by default. That is the elements of the\n" -"vector are arranged column-wise:" +"これは、普段使うには役に立たず、読むときにも混乱を招きます。ですが、行列は *列順序(column-major format)* で\n" +"デフォルト配置されるということを覚えておくといいでしょう。つまり、ベクトルの要素は、列にある順番で配置されています。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:978 @@ -10224,7 +10141,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:992 msgid "If you wish to populate the matrix by row, use `byrow=TRUE`:" -msgstr "If you wish to populate the matrix by row, use `byrow=TRUE`:" +msgstr "もし、行列を、行の順番で埋めていきたい場合は、 `byrow=TRUE` を使います:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:995 @@ -10256,9 +10173,7 @@ msgstr "" msgid "" "Matrices can also be subsetted using their rownames and column names\n" "instead of their row and column indices." -msgstr "" -"Matrices can also be subsetted using their rownames and column names\n" -"instead of their row and column indices." +msgstr "行列もまた、行及び列の要素番号の代わりに、名前で部分集合を作ることができます。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1013 msgid "" @@ -10282,7 +10197,7 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> Given the following code:\n" +"> 以下のコードがあるとしましょう:\n" ">\n" "> \n" "> ~~~\n" @@ -10318,7 +10233,7 @@ msgid "" "> > D" msgstr "" ">\n" -"> 1. Which of the following commands will extract the values 11 and 14?\n" +"> 1. 次のコマンドのうち、11と14を抜き出すことができるコマンドはどれでしょう?\n" ">\n" "> A. `m[2,4,2,5]`\n" ">\n" @@ -10328,30 +10243,30 @@ msgstr "" ">\n" "> D. `m[2,c(4,5)]`\n" ">\n" -"> > ## Solution to challenge 4\n" +"> > ## チャレンジ4の解答\n" "> >\n" "> > D" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:1050 msgid "## List subsetting" -msgstr "## List subsetting" +msgstr "## リストの分部集合を作る" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1052 msgid "" "Now we'll introduce some new subsetting operators. There are three functions\n" "used to subset lists. We've already seen these when learning about atomic vectors and matrices: `[`, `[[`, and `$`." msgstr "" -"Now we'll introduce some new subsetting operators. There are three functions\n" -"used to subset lists. We've already seen these when learning about atomic vectors and matrices: `[`, `[[`, and `$`." +"ここで新しい部分集合を作る演算子を御紹介しましょう。リストの部分集合を作る関数は3つあります。\n" +"原子ベクトルと行列について学んだ時に、既に見たものです: `[` 、 `[[` 、`$`" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1055 msgid "" "Using `[` will always return a list. If you want to *subset* a list, but not\n" "*extract* an element, then you will likely use `[`." msgstr "" -"Using `[` will always return a list. If you want to *subset* a list, but not\n" -"*extract* an element, then you will likely use `[`." +" `[` を使えばいつもリストが返ってきます。リストの *部分集合* を作りたいけれども、\n" +"要素を *抜き出したい* わけではないときは、おそらく `[` を使うことが多いでしょう。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1059 @@ -10381,7 +10296,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1073 msgid "This returns a *list with one element*." -msgstr "This returns a *list with one element*." +msgstr "これは、 *1つの要素を持つリスト* です。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1075 msgid "" @@ -10391,11 +10306,9 @@ msgid "" "in each element of the list, not the individual elements within those\n" "data structures." msgstr "" -"We can subset elements of a list exactly the same way as atomic\n" -"vectors using `[`. Comparison operations however won't work as\n" -"they're not recursive, they will try to condition on the data structures\n" -"in each element of the list, not the individual elements within those\n" -"data structures." +"`[` を使い原子ベクトルを作ったのと全く同じ方法で、リストの要素から部分集合を作ることができます。\n" +"しかし、比較処理は反復的ではないため、使えません。比較処理は、リストのそれぞれの要素のデータ構造にある、個々の要素ではなく、\n" +"データ構造に条件付けをしようとするからです。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1082 @@ -10431,9 +10344,7 @@ msgstr "" msgid "" "To extract individual elements of a list, you need to use the double-square\n" "bracket function: `[[`." -msgstr "" -"To extract individual elements of a list, you need to use the double-square\n" -"bracket function: `[[`." +msgstr "リストの個々の要素を抜き出すためには、二重角括弧 `[[` を使う必要があります:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1102 @@ -10460,11 +10371,11 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1114 msgid "Notice that now the result is a vector, not a list." -msgstr "Notice that now the result is a vector, not a list." +msgstr "ここで結果がリストではなく、ベクトルとなっていることに気をつけましょう。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1116 msgid "You can't extract more than one element at once:" -msgstr "You can't extract more than one element at once:" +msgstr "1つの要素を同時に抜き出すことはできません:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1119 @@ -10490,7 +10401,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1131 msgid "Nor use it to skip elements:" -msgstr "Nor use it to skip elements:" +msgstr "また、要素を飛ばすこともできません:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1134 @@ -10516,7 +10427,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1146 msgid "But you can use names to both subset and extract elements:" -msgstr "But you can use names to both subset and extract elements:" +msgstr "でも両方の部分集合の名前を使って、要素を抽出することはできます:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1149 @@ -10531,7 +10442,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1161 msgid "The `$` function is a shorthand way for extracting elements by name:" -msgstr "The `$` function is a shorthand way for extracting elements by name:" +msgstr " `$` 関数は、簡単に名前で要素を抽出できるものです。" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1164 @@ -10570,7 +10481,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:1183 msgid "> Given the following list:" -msgstr "> Given the following list:" +msgstr "> 以下のリストがあるとしましょう:" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1184 msgid "" @@ -10630,10 +10541,10 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> Using your knowledge of both list and vector subsetting, extract the number 2 from xlist.\n" -"> Hint: the number 2 is contained within the \"b\" item in the list.\n" +"> リストとベクトルの部分集合を作る知識を使って、xlistから、数字の2を抜き出してみましょう。\n" +"> ヒント:数字の2は、リスト「b」の中にあります。\n" ">\n" -"> > ## Solution to challenge 5\n" +"> > ## チャレンジ5の解答\n" "> >\n" "> > \n" "> > ~~~\n" @@ -10675,7 +10586,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:1237 msgid "> Given a linear model:" -msgstr "> Given a linear model:" +msgstr "> 線形モデルを考えてみましょう:" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1238 msgid "" @@ -10708,13 +10619,13 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> Extract the residual degrees of freedom (hint: `attributes()` will help you)\n" +"> 残差の自由度を抜き出してみましょう(ヒント: `attributes()` が役立つはずです)\n" ">\n" -"> > ## Solution to challenge 6\n" +"> > ## チャレンジ6の解答\n" "> >\n" "> > \n" "> > ~~~\n" -"> > attributes(mod) ## `df.residual` is one of the names of `mod`\n" +"> > attributes(mod) ## `df.residual` は、`mod` の名前のひとつです\n" "> > ~~~\n" "> > {: .language-r}\n" "> > \n" @@ -10726,23 +10637,23 @@ msgstr "" # header #: r-novice-gapminder/_episodes/06-data-subsetting.md:1263 msgid "## Data frames" -msgstr "## Data frames" +msgstr "## データフレーム" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1265 msgid "" "Remember the data frames are lists underneath the hood, so similar rules\n" "apply. However they are also two dimensional objects:" msgstr "" -"Remember the data frames are lists underneath the hood, so similar rules\n" -"apply. However they are also two dimensional objects:" +"データフレームの中身は実はリストなので、同じようなルールがあてはまることを覚えておきましょう。\n" +"しかし、データフレームは2次元のオブジェクトでもあります。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1268 msgid "" "`[` with one argument will act the same way as for lists, where each list\n" "element corresponds to a column. The resulting object will be a data frame:" msgstr "" -"`[` with one argument will act the same way as for lists, where each list\n" -"element corresponds to a column. The resulting object will be a data frame:" +"1つの引数しかない `[` は、リストと同じような働きがあり、それぞれのリストの要素が列に対応します。\n" +"その結果、返されるオブジェクトはデータフレームになります:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1272 @@ -10780,7 +10691,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1290 msgid "Similarly, `[[` will act to extract *a single column*:" -msgstr "Similarly, `[[` will act to extract *a single column*:" +msgstr "同様に、 `[[` は、 *単一の列* を抜き出す働きをするものです:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1293 @@ -10806,7 +10717,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1305 msgid "And `$` provides a convenient shorthand to extract columns by name:" -msgstr "And `$` provides a convenient shorthand to extract columns by name:" +msgstr "そして `$` は、簡単に列名で列を抽出できるものです:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1308 @@ -10832,7 +10743,7 @@ msgstr "" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1320 msgid "With two arguments, `[` behaves the same way as for matrices:" -msgstr "With two arguments, `[` behaves the same way as for matrices:" +msgstr "2つの引数を使えば、 `[` は、行列と同じような働きをします:" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1323 @@ -10867,8 +10778,8 @@ msgid "" "If we subset a single row, the result will be a data frame (because\n" "the elements are mixed types):" msgstr "" -"If we subset a single row, the result will be a data frame (because\n" -"the elements are mixed types):" +"もし、1つの行を部分集合する場合、結果はデータフレームになります\n" +"(理由は、要素には色々なデータ型が混ざっているからです):" # code block #: r-novice-gapminder/_episodes/06-data-subsetting.md:1342 @@ -10899,8 +10810,8 @@ msgid "" "But for a single column the result will be a vector (this can\n" "be changed with the third argument, `drop = FALSE`)." msgstr "" -"But for a single column the result will be a vector (this can\n" -"be changed with the third argument, `drop = FALSE`)." +"しかし、1つの行についての結果は、ベクトルになります\n" +"(これは、3番目の引数を `drop = FALSE` とすれば変えられます)。" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1359 msgid "" @@ -11002,9 +10913,9 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Fix each of the following common data frame subsetting errors:\n" +"> 以下の一般的なデータフレームの部分集合を作る際のエラーを修正しましょう:\n" ">\n" -"> 1. Extract observations collected for the year 1957\n" +"> 1. 1957年に集められた標本を抜き出す\n" ">\n" "> \n" "> ~~~\n" @@ -11012,7 +10923,7 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> 2. Extract all columns except 1 through to 4\n" +"> 2. 1から4を除く全ての列を抜き出す\n" ">\n" "> \n" "> ~~~\n" @@ -11020,7 +10931,7 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> 3. Extract the rows where the life expectancy is longer the 80 years\n" +"> 3. 平均余命が80歳以上の行を抜き出す\n" ">\n" "> \n" "> ~~~\n" @@ -11028,8 +10939,8 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> 4. Extract the first row, and the fourth and fifth columns\n" -"> (`lifeExp` and `gdpPercap`).\n" +"> 4. 最初の行の4番目と5番目の列を抜き出す\n" +"> (`lifeExp` と `gdpPercap`).\n" ">\n" "> \n" "> ~~~\n" @@ -11037,8 +10948,7 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> 5. Advanced: extract rows that contain information for the years 2002\n" -"> and 2007\n" +"> 5. 上級:2002年と2007年の情報を含む行を抜き出す\n" ">\n" "> \n" "> ~~~\n" @@ -11046,11 +10956,13 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> > ## Solution to challenge 7\n" +"> > ## チャレンジ7の解答\n" "> >\n" -"> > Fix each of the following common data frame subsetting errors:\n" +"> > 以下の一般的なデータフレームの部分集合を作る際のエラーを修正しましょう:\n" +"\n" "> >\n" -"> > 1. Extract observations collected for the year 1957\n" +"> > 1. 1957年に集められた標本を抜き出す\n" +"\n" "> >\n" "> > \n" "> > ~~~\n" @@ -11059,7 +10971,7 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > 2. Extract all columns except 1 through to 4\n" +"> > 2. 1から4を除く全ての列を抜き出す\n" "> >\n" "> > \n" "> > ~~~\n" @@ -11068,7 +10980,7 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > 3. Extract the rows where the life expectancy is longer the 80 years\n" +"> > 3. 平均余命が80歳以上の行を抜き出す\n" "> >\n" "> > \n" "> > ~~~\n" @@ -11077,8 +10989,8 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > 4. Extract the first row, and the fourth and fifth columns\n" -"> > (`lifeExp` and `gdpPercap`).\n" +"> > 4. 最初の行の4番目と5番目の列を抜き出す\n" +"> > (`lifeExp` と `gdpPercap`).\n" "> >\n" "> > \n" "> > ~~~\n" @@ -11087,8 +10999,7 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > 5. Advanced: extract rows that contain information for the years 2002\n" -"> > and 2007\n" +"> > 5. 上級:2002年と2007年の情報を含む行を抜き出す\n" "> >\n" "> > \n" "> > ~~~\n" @@ -11101,7 +11012,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/06-data-subsetting.md:1458 msgid "> ## Challenge 8" -msgstr "> ## Challenge 8" +msgstr "> ## チャレンジ8" #: r-novice-gapminder/_episodes/06-data-subsetting.md:1459 msgid "" @@ -11125,15 +11036,15 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> 1. Why does `gapminder[1:20]` return an error? How does it differ from `gapminder[1:20, ]`?\n" +"> 1. なぜ、 `gapminder[1:20]` は、エラーを返すのでしょうか? `gapminder[1:20, ]` とどう違うのでしょう?\n" ">\n" ">\n" -"> 2. Create a new `data.frame` called `gapminder_small` that only contains rows 1 through 9\n" -"> and 19 through 23. You can do this in one or two steps.\n" +"> 2. 新しく `gapminder_small` という、1から9の行だけを含む `data.frame` を作ってください。\n" +"> これは、1つまたは2つの手順でできます。\n" ">\n" -"> > ## Solution to challenge 8\n" +"> > ## チャレンジ8の解答\n" "> >\n" -"> > 1. `gapminder` is a data.frame so needs to be subsetted on two dimensions. `gapminder[1:20, ]` subsets the data to give the first 20 rows and all columns.\n" +"> > 1. `gapminder` は、データフレームなので、2つの次元の部分集合を作る必要があります。 `gapminder[1:20, ]` は、最初から20番目の行までについて全ての列を引き出します。\n" "> >\n" "> > 2. \n" "> >\n" @@ -11188,17 +11099,17 @@ msgid "" "by setting actions to occur only if a condition or a set of conditions are met.\n" "Alternatively, we can also set an action to occur a particular number of times." msgstr "" -"Often when we're coding we want to control the flow of our actions. This can be done\n" -"by setting actions to occur only if a condition or a set of conditions are met.\n" -"Alternatively, we can also set an action to occur a particular number of times." +"コードを書く際、実行の流れを制御する必要がよくあります。\n" +"これは、ある条件、または一連の条件が満たされたときに、実行されるようにすればできます。\n" +"あるいは、決まった回数実行されるよう設定することもできます。" #: r-novice-gapminder/_episodes/07-control-flow.md:25 msgid "" "There are several ways you can control flow in R.\n" "For conditional statements, the most commonly used approaches are the constructs:" msgstr "" -"There are several ways you can control flow in R.\n" -"For conditional statements, the most commonly used approaches are the constructs:" +"Rでは、流れを制御する方法がいくつかあります。\n" +"条件付きの宣言で、最もよく使われるのが「構文(constructs)」です:" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:29 @@ -11233,7 +11144,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:44 msgid "Say, for example, that we want R to print a message if a variable `x` has a particular value:" -msgstr "Say, for example, that we want R to print a message if a variable `x` has a particular value:" +msgstr "例えばRに、もし変数 `x` が特定の値を持っていた場合、メッセージを表示させたいとします。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:47 @@ -11271,7 +11182,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:65 msgid "The print statement does not appear in the console because x is not greater than 10. To print a different message for numbers less than 10, we can add an `else` statement." -msgstr "The print statement does not appear in the console because x is not greater than 10. To print a different message for numbers less than 10, we can add an `else` statement." +msgstr "xは、10より大きくないため、表示された宣言はコンソール上に表示されません。10より小さい場合に違ったメッセージを表示させるためには、 `else` 宣言を追加しなければなりません。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:68 @@ -11309,7 +11220,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:86 msgid "You can also test multiple conditions by using `else if`." -msgstr "You can also test multiple conditions by using `else if`." +msgstr " `else if` を使うと、複数の条件を試すこともできます。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:89 @@ -11355,9 +11266,8 @@ msgid "" "looking for a logical element, i.e., `TRUE` or `FALSE`. This can cause some\n" "headaches for beginners. For example:" msgstr "" -"**Important:** when R evaluates the condition inside `if()` statements, it is\n" -"looking for a logical element, i.e., `TRUE` or `FALSE`. This can cause some\n" -"headaches for beginners. For example:" +"**重要:** Rが `if()` 宣言の中の条件を計算する際、論理要素( `TRUE` or `FALSE` )を探します。\n" +"初心者には複雑なので、混乱してしまうかもしれません。例えば:" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:114 @@ -11393,7 +11303,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:131 msgid "As we can see, the not equal message was printed because the vector x is `FALSE`" -msgstr "As we can see, the not equal message was printed because the vector x is `FALSE`" +msgstr "ここで見たように、ベクトルxが `FALSE` であるので、不等号のメッセージが表示されたのです。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:134 @@ -11467,32 +11377,31 @@ msgid "" "> >" msgstr "" ">\n" -"> Use an `if()` statement to print a suitable message\n" -"> reporting whether there are any records from 2002 in\n" -"> the `gapminder` dataset.\n" -"> Now do the same for 2012.\n" +"> `if()` 宣言を使って、`gapminder` のデータセットに2002年の記録があるかどうかを伝える\n" +"> 適当なメッセージを表示してください。\n" +"> 2012年についても、同じことをしてください。\n" ">\n" -"> > ## Solution to Challenge 1\n" -"> > We will first see a solution to Challenge 1 which does not use the `any()` function.\n" -"> > We first obtain a logical vector describing which element of `gapminder$year` is equal to `2002`:\n" +"> > ## チャレンジ1の解答\n" +"> > `any()` を使わないチャレンジ1の解答をまず見てみましょう。\n" +"> > 最初に、`gapminder$year` の内、どの要素が `2002` と等しいかを記した論理ベクトルを手に入れます:\n" "> > \n" "> > ~~~\n" "> > gapminder[(gapminder$year == 2002),]\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > Then, we count the number of rows of the data.frame `gapminder` that correspond to the 2002:\n" +"> > そして、データフレーム `gapminder` の2002と対応する行の数を数えます:\n" "> > \n" "> > ~~~\n" "> > rows2002_number <- nrow(gapminder[(gapminder$year == 2002),])\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > The presence of any record for the year 2002 is equivalent to the request that `rows2002_number` is one or more:\n" +"> > 2002年の記録が存在するということは、 `rows2002_number` が1以上あるということです:\n" "> > \n" "> > ~~~\n" "> > rows2002_number >= 1\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > Putting all together, we obtain:\n" +"> > 全てを合わせると、以下になります:\n" "> > \n" "> > ~~~\n" "> > if(nrow(gapminder[(gapminder$year == 2002),]) >= 1){\n" @@ -11501,7 +11410,7 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > All this can be done more quickly with `any()`. The logical condition can be expressed as:\n" +"> > `any()` を使えば、もっと早くできます。論理条件は、次のように書けます:\n" "> > \n" "> > ~~~\n" "> > if(any(gapminder$year == 2002)){\n" @@ -11513,7 +11422,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:196 msgid "Did anyone get a warning message like this?" -msgstr "Did anyone get a warning message like this?" +msgstr "次のような警告メッセージをもらった人はいますか?" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:199 @@ -11534,14 +11443,14 @@ msgid "" "the function `if()` will still run, but will only evaluate the condition in the first\n" "element. Here you need to make sure your condition is of length 1." msgstr "" -"If your condition evaluates to a vector with more than one logical element,\n" -"the function `if()` will still run, but will only evaluate the condition in the first\n" -"element. Here you need to make sure your condition is of length 1." +"もし、1つ以上の要素を持つベクトルを評価する条件の場合、\n" +"関数 `if()` は走るのですが、最初の要素の条件しか評価しません。\n" +"ここでは、確実に条件の長さは1であるようにする必要があります。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/07-control-flow.md:209 msgid "> ## Tip: `any()` and `all()`" -msgstr "> ## Tip: `any()` and `all()`" +msgstr "> ## ヒント:`any()` と `all()`" #: r-novice-gapminder/_episodes/07-control-flow.md:210 msgid "" @@ -11553,16 +11462,16 @@ msgid "" "> the vector are `TRUE`." msgstr "" ">\n" -"> The `any()` function will return TRUE if at least one\n" -"> TRUE value is found within a vector, otherwise it will return `FALSE`.\n" -"> This can be used in a similar way to the `%in%` operator.\n" -"> The function `all()`, as the name suggests, will only return `TRUE` if all values in\n" -"> the vector are `TRUE`." +"> `any()` 関数は、少なくとも1つ `TRUE` の値がある場合、 `TRUE` を返し、\n" +"> そうでない場合は、 `FALSE` を返します。\n" +"> これは、 `%in%` 演算子でも同様に使えます。\n" +"> 関数 `all()` は、その名前が示唆しているように、ベクトル内の全ての値が `TRUE` である時のみ、\n" +"> `TRUE` となります。" # header #: r-novice-gapminder/_episodes/07-control-flow.md:218 msgid "## Repeating operations" -msgstr "## Repeating operations" +msgstr "## 繰り返し行う処理" #: r-novice-gapminder/_episodes/07-control-flow.md:220 msgid "" @@ -11574,17 +11483,17 @@ msgid "" "correctly. Avoid using `for()` loops unless the order of iteration is important:\n" "i.e. the calculation at each iteration depends on the results of previous iterations." msgstr "" -"If you want to iterate over\n" -"a set of values, when the order of iteration is important, and perform the\n" -"same operation on each, a `for()` loop will do the job.\n" -"We saw `for()` loops in the shell lessons earlier. This is the most\n" -"flexible of looping operations, but therefore also the hardest to use\n" -"correctly. Avoid using `for()` loops unless the order of iteration is important:\n" -"i.e. the calculation at each iteration depends on the results of previous iterations." +"一連の値に繰り返し同じ演算をしたい場合、\n" +"そして繰り返す順番も重要である場合は、 \n" +" `for()` ループを使いましょう。\n" +" `for()` ループは、先ほどシェルのレッスンで見ましたね。これは、最も柔軟な\n" +"ループの演算子ですが、それゆえ、正しく使うのが最も難しいです。\n" +"繰り返す順番が重要(つまり直前の繰り返しの結果をもとに、次々と\n" +"繰り返しの演算行われる形)でない限り、 `for()` ループを使うのを避けましょう。" #: r-novice-gapminder/_episodes/07-control-flow.md:228 msgid "The basic structure of a `for()` loop is:" -msgstr "The basic structure of a `for()` loop is:" +msgstr "`for()` ループの基本構造は:" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:231 @@ -11603,7 +11512,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:238 msgid "For example:" -msgstr "For example:" +msgstr "例:" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:241 @@ -11653,17 +11562,13 @@ msgstr "" msgid "" "The `1:10` bit creates a vector on the fly; you can iterate\n" "over any other vector as well." -msgstr "" -"The `1:10` bit creates a vector on the fly; you can iterate\n" -"over any other vector as well." +msgstr " `1:10` の部分は、ベクトルをその場で作るもので、他のベクトルの間中、繰り返すこともできます。" #: r-novice-gapminder/_episodes/07-control-flow.md:267 msgid "" "We can use a `for()` loop nested within another `for()` loop to iterate over two things at\n" "once." -msgstr "" -"We can use a `for()` loop nested within another `for()` loop to iterate over two things at\n" -"once." +msgstr " `for()` ループを、もうひとつの `for()` ループと入れ子となる形にすれば、2つのことを同時に繰り返すこともできます。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:271 @@ -11745,7 +11650,7 @@ msgstr "" #: r-novice-gapminder/_episodes/07-control-flow.md:311 msgid "Rather than printing the results, we could write the loop output to a new object." -msgstr "Rather than printing the results, we could write the loop output to a new object." +msgstr "結果を表示させずに、ループの結果を新しいオブジェクトとして書くこともできます。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:314 @@ -11793,14 +11698,14 @@ msgid "" "the result object incrementally) is computationally inefficient, so avoid\n" "it when you are iterating through a lot of values." msgstr "" -"This approach can be useful, but 'growing your results' (building\n" -"the result object incrementally) is computationally inefficient, so avoid\n" -"it when you are iterating through a lot of values." +"このアプローチが役に立つこともありますが、'結果を太らせる' (結果のオブジェクトを\n" +"段々積み上げる)と、演算する上で非効率になります。\n" +"ゆえに、多くの値の間を繰り返すときは避けましょう。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/07-control-flow.md:339 msgid "> ## Tip: don't grow your results" -msgstr "> ## Tip: don't grow your results" +msgstr "> ## ヒント:結果を太らせないようにしましょう" #: r-novice-gapminder/_episodes/07-control-flow.md:340 msgid "" @@ -11816,23 +11721,23 @@ msgid "" "> store the results in the appropriate location." msgstr "" ">\n" -"> One of the biggest things that trips up novices and\n" -"> experienced R users alike, is building a results object\n" -"> (vector, list, matrix, data frame) as your for loop progresses.\n" -"> Computers are very bad at handling this, so your calculations\n" -"> can very quickly slow to a crawl. It's much better to define\n" -"> an empty results object before hand of the appropriate dimensions.\n" -"> So if you know the end result will be stored in a matrix like above,\n" -"> create an empty matrix with 5 row and 5 columns, then at each iteration\n" -"> store the results in the appropriate location." +"> 初心者と経験のあるRユーザーの両方の足を引っ張るループの使い方の一つとして、\n" +"> 結果のオブジェクト(ベクトル、リスト、行列、データフレーム)をループするたびに作ってしまうという\n" +"> ことがあります。\n" +"> コンピュータはこれを扱うのがとても下手で、すぐに計算が\n" +"> 遅くなります。適当な次元を持つ空の結果オブジェクトを\n" +"> 前もって宣言しておく方が効率的です。\n" +"> もし、上記の行列に蓄積される最後の結果が何になるかを知っていたら、\n" +"> 5行、5列の数列を作成しておいて、それぞれの繰り返しで、適切な場所へ結果を\n" +"> 蓄積しましょう。" #: r-novice-gapminder/_episodes/07-control-flow.md:352 msgid "" "A better way is to define your (empty) output object before filling in the values.\n" "For this example, it looks more involved, but is still more efficient." msgstr "" -"A better way is to define your (empty) output object before filling in the values.\n" -"For this example, it looks more involved, but is still more efficient." +"よりよい方法は、(空の)出力オブジェクトを、値を埋める前に宣言することです。\n" +"この例では、より複雑に見えますが、それでもより効率的です。" # code block #: r-novice-gapminder/_episodes/07-control-flow.md:356 @@ -11883,7 +11788,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/07-control-flow.md:380 msgid "> ## Tip: While loops" -msgstr "> ## Tip: While loops" +msgstr "> ## ヒント:while ループ" #: r-novice-gapminder/_episodes/07-control-flow.md:381 msgid "" @@ -11914,8 +11819,8 @@ msgid "" msgstr "" ">\n" ">\n" -"> Sometimes you will find yourself needing to repeat an operation until a certain\n" -"> condition is met. You can do this with a `while()` loop.\n" +"> ときには、ある条件が満たされるまで繰り返す必要がある場合に出くわすこともあるでしょう。\n" +"> これは、 `while()` ループを使えばできます。\n" ">\n" "> \n" "> ~~~\n" @@ -11925,9 +11830,8 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> As an example, here's a while loop\n" -"> that generates random numbers from a uniform distribution (the `runif()` function)\n" -"> between 0 and 1 until it gets one that's less than 0.1.\n" +"> 例として、このwhileループは一様分布(`runif()` 関数)から0.1よりも小さい数を得るまで、\n" +"> 0から1の間で乱数を生成します。\n" ">\n" "> ~~~\n" "> z <- 1\n" @@ -11949,8 +11853,8 @@ msgid "" "> that you don't end up in an infinite loop because your condition is never met." msgstr "" ">\n" -"> `while()` loops will not always be appropriate. You have to be particularly careful\n" -"> that you don't end up in an infinite loop because your condition is never met." +"> `while()` ループは、いつも適当であるとは言えません。特に、条件が決して満たされないことによる\n" +"> 無限ループに陥らないように特に注意する必要があります。" #: r-novice-gapminder/_episodes/07-control-flow.md:413 msgid "" @@ -12010,54 +11914,53 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Compare the objects output_vector and\n" -"> output_vector2. Are they the same? If not, why not?\n" -"> How would you change the last block of code to make output_vector2\n" -"> the same as output_vector?\n" +"> `output_vector` と `output_vector2` のオブジェクトを比較しましょう。\n" +"> 同じですか?もし違ったら、なぜそうなったのでしょう?\n" +"> `output_vector2` の最後のコードのかたまりを `output_vector` と同じにするには、どう変えればよいでしょうか?\n" ">\n" -"> > ## Solution to Challenge 2\n" -"> > We can check whether the two vectors are identical using the `all()` function:\n" +"> > ## チャレンジ2の解答\n" +"> > 2つのベクトルが同じかを調べるために、 `all()` 関数を使いましょう:\n" "> > \n" "> > ~~~\n" "> > all(output_vector == output_vector2)\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > However, all the elements of `output_vector` can be found in `output_vector2`:\n" +"> > しかし、 `output_vector` の全ての要素は、 `output_vector2` にあります:\n" "> > \n" "> > ~~~\n" "> > all(output_vector %in% output_vector2)\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > and vice versa:\n" +"> > そして、その逆もしかり。\n" "> > \n" "> > ~~~\n" "> > all(output_vector2 %in% output_vector)\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > therefore, the element in `output_vector` and `output_vector2` are just sorted in a different order.\n" -"> > This is because `as.vector()` outputs the elements of an input matrix going over its column.\n" -"> > Taking a look at `output_matrix`, we can notice that we want its elements by rows.\n" -"> > The solution is to transpose the `output_matrix`. We can do it either by calling the transpose function\n" -"> > `t()` or by inputing the elements in the right order.\n" -"> > The first solution requires to change the original\n" +"> > それゆえ、`output_vector` と `output_vector2` の要素は、違う順番で蓄積されただけです。\n" +"> > この理由は、 `as.vector()` は列ごとに行列に要素を入力する形で出力するからです。\n" +"> > `output_matrix` を見てみると、要素を行ごとに欲しいということに気づくでしょう。\n" +"> > 解決方法は、 `output_matrix` を転置することです。転置関数 `t()` を呼ぶか、\n" +"> > 要素を正しい順番で入力するか、いずれかの方法で対応可能です。\n" +"> > 最初の解決方法は、もともとのものを次の形で変更する必要があります:\n" "> > \n" "> > ~~~\n" "> > output_vector2 <- as.vector(output_matrix)\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > into\n" +"> > を、以下へ\n" "> > \n" "> > ~~~\n" "> > output_vector2 <- as.vector(t(output_matrix))\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > The second solution requires to change\n" +"> > 二番目の解決方法は、次のように変える必要があります:\n" "> > \n" "> > ~~~\n" "> > output_matrix[i, j] <- temp_output\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > into\n" +"> > を、以下へ。\n" "> > \n" "> > ~~~\n" "> > output_matrix[j, i] <- temp_output\n" @@ -12123,13 +12026,12 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Write a script that loops through the `gapminder` data by continent and prints out\n" -"> whether the mean life expectancy is smaller or larger than 50\n" -"> years.\n" +"> `gapminder` データを大陸ごとにループし、平均余命が50歳以上かどうかを表示する\n" +"> スクリプトを書きましょう。\n" ">\n" -"> > ## Solution to Challenge 3\n" +"> > ## チャレンジ3の解答\n" "> >\n" -"> > **Step 1**: We want to make sure we can extract all the unique values of the continent vector\n" +"> > **手順1**:大陸ベクトルから、確実に全ての唯一無二な値を抜き出せるかを確かめましょう。\n" "> > \n" "> > ~~~\n" "> > gapminder <- read.csv(\"data/gapminder_data.csv\")\n" @@ -12137,12 +12039,12 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > **Step 2**: We also need to loop over each of these continents and calculate the average life expectancy for each `subset` of data.\n" -"> > We can do that as follows:\n" +"> > **手順2**:これらの大陸のそれぞれにループをし、その `部分集合` データごとに平均余命を出す必要があります。\n" +"> > それは次の形でできます:\n" "> >\n" -"> > 1. Loop over each of the unique values of 'continent'\n" -"> > 2. For each value of continent, create a temporary variable storing the life exepectancy for that subset,\n" -"> > 3. Return the calculated life expectancy to the user by printing the output:\n" +"> > 1. '大陸(continent)' の唯一無二の値のそれぞれについてループする\n" +"> > 2. 大陸のそれぞれの値ごとに、この部分集合の平均余命を蓄積する一時的な変数を作る\n" +"> > 3. 計算した平均余命を返し、 出力を表示させる:\n" "> >\n" "> > \n" "> > ~~~\n" @@ -12154,11 +12056,11 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > **Step 3**: The exercise only wants the output printed if the average life expectancy is less than 50 or greater than 50. So we need to add an `if` condition before printing.\n" -"> > So we need to add an `if` condition before printing, which evaluates whether the calculated average life expectancy is above or below a threshold, and print an output conditional on the result.\n" -"> > We need to amend (3) from above:\n" +"> > **手順3**:演習は、平均余命が50歳以上かどうかの結果だけを出力したいというものでした。\n" +"> > ゆえに、 `if` 条件を、表示させる前につける必要があります。これは、演算された平均余命が基準値以上か、基準値未満かを判別し、結果によって出力を表示させる必要があります。\n" +"> > 上から (3) を修正する必要があります:\n" "> >\n" -"> > 3a. If the calculated life expectancy is less than some threshold (50 years), return the continent and a statement that life expectancy is less than threshold, otherwise return the continent and a statement that life expectancy is greater than threshold,:\n" +"> > 3a. もし計算された平均余命が、ある基準(50歳)未満の場合、大陸と、平均余命は基準未満であるという宣言を、そうでない場合は、大陸と、平均余命は基準値以上であるという宣言を返しなさい:\n" "> >\n" "> > \n" "> > ~~~\n" @@ -12211,12 +12113,12 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Modify the script from Challenge 3 to loop over each\n" -"> country. This time print out whether the life expectancy is\n" -"> smaller than 50, between 50 and 70, or greater than 70.\n" +"> チャレンジ3のスクリプトをそれぞれの国とごとにループする形で修正しなさい。\n" +"> 今回は、平均余命は、50歳未満か、50歳以上70歳未満か、70歳以上かを\n" +"> 表示しましょう。\n" ">\n" -"> > ## Solution to Challenge 4\n" -"> > We modify our solution to Challenge 3 by now adding two thresholds, `lowerThreshold` and `upperThreshold` and extending our if-else statements:\n" +"> > ## チャレンジ4の解答\n" +"> > チャレンジ3の解答を、 `lowerThreshold` と `upperThreshold` の2つの基準値を加え、if-else 宣言を拡張する形で修正します:\n" "> >\n" "> > \n" "> > ~~~\n" @@ -12243,7 +12145,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/07-control-flow.md:562 msgid "> ## Challenge 5 - Advanced" -msgstr "> ## Challenge 5 - Advanced" +msgstr "> ## チャレンジ5 - 上級" #: r-novice-gapminder/_episodes/07-control-flow.md:563 msgid "" @@ -12303,23 +12205,23 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Write a script that loops over each country in the `gapminder` dataset,\n" -"> tests whether the country starts with a 'B', and graphs life expectancy\n" -"> against time as a line graph if the mean life expectancy is under 50 years.\n" +"> `gapminder` データセットで、それぞれの国ごとにループするスクリプトを書き、\n" +">国が 'B' で始まるかどうかをテストし、平均余命が50歳以下の場合、平均余命を\n" +"> 時間ごとの移り変わりで示した線グラフを書きましょう。\n" ">\n" -"> > ## Solution for Challenge 5\n" +"> > ## チャレンジ5の解答\n" "> >\n" -"> > We will use the `grep` command that was introduced in the Unix Shell lesson to find countries that start with \"B.\"\n" -"> > Lets understand how to do this first.\n" -"> > Following from the Unix shell section we may be tempted to try the following\n" +"> > シェルのレッスンで紹介した`grep` コマンドを「B」で始まる国を見つけるために使います。\n" +"> > まず、これをどういうふうにするかを理解しましょう。\n" +"> > シェル節に従って、以下を試してみたいと思うかもしれません:\n" "> > \n" "> > ~~~\n" "> > grep(\"^B\", unique(gapminder$country))\n" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > But when we evaluate this command it returns the indices of the factor variable `country` that start with \"B.\"\n" -"> > To get the values, we must add the `value=TRUE` option to the `grep` command:\n" +"> > でも、このコマンドを演算すると、順序なし因子変数 `country` の「B」で始まる要素番号を返します。\n" +"> > 値を得るためには、 `grep` コマンドの、`value=TRUE` オプションを加える必要があります:\n" "> >\n" "> > \n" "> > ~~~\n" @@ -12327,8 +12229,8 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > We will now store these countries in a variable called candidateCountries, and then loop over each entry in the variable.\n" -"> > Inside the loop, we evaluate the average life expectancy for each country, and if the average life expectancy is less than 50 we use base-plot to plot the evolution of average life expectancy:\n" +"> > これらの国々をcandidateCountriesと呼ぶ変数に蓄積し、その変数のそれぞれでループするようにしましょう。\n" +"> > そのループの中で、それぞれの国の平均余命を演算子、もし平均余命が50歳未満でったら、平均余命の進展をみるために、`with()` と`subset()`を使い、base-plotを用いてプロットしましょう:\n" "> >\n" "> > \n" "> > ~~~\n" @@ -13376,15 +13278,15 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 09-vectorization.md in _episodes_rmd/\n" -"title: Vectorization\n" -"teaching: 10\n" -"exercises: 15\n" -"questions:\n" -"- \"How can I operate on all the elements of a vector at once?\"\n" -"objectives:\n" -"- \"To understand vectorized operations in R.\"\n" -"keypoints:\n" -"- \"Use vectorized operations instead of loops.\"\n" +"タイトル: ベクトル化\n" +"講義: 10\n" +"練習: 15\n" +"質問:\n" +"- \"どうやってベクトルの全要素をまとめて操作するの?\"\n" +"目的:\n" +"- \"R におけるベクトル化された操作を理解しましょう。\"\n" +"要点:\n" +"- \"ループの代わりにベクトル化を利用します。\"\n" "source: Rmd\n" "---" @@ -13395,10 +13297,8 @@ msgid "" "and act on each element one at a time. This makes writing code more\n" "concise, easy to read, and less error prone." msgstr "" -"Most of R's functions are vectorized, meaning that the function will\n" -"operate on all elements of a vector without needing to loop through\n" -"and act on each element one at a time. This makes writing code more\n" -"concise, easy to read, and less error prone." +"Rの関数はほとんどがベクトル化されており、関数はベクトルの全ての要素を最初から操作してくれるので、ベクトルの要素ごとにいちいちループする必要がありません。\n" +"おかげで簡潔で読み易く、エラーの少ないコードを書くことができます。" # code block #: r-novice-gapminder/_episodes/09-vectorization.md:25 @@ -13426,11 +13326,11 @@ msgstr "" #: r-novice-gapminder/_episodes/09-vectorization.md:38 msgid "The multiplication happened to each element of the vector." -msgstr "The multiplication happened to each element of the vector." +msgstr "積はベクトルの要素ごとに実行されました。" #: r-novice-gapminder/_episodes/09-vectorization.md:40 msgid "We can also add two vectors together:" -msgstr "We can also add two vectors together:" +msgstr "2つのベクトルを足し合わせることもできます:" # code block #: r-novice-gapminder/_episodes/09-vectorization.md:43 @@ -13458,7 +13358,7 @@ msgstr "" #: r-novice-gapminder/_episodes/09-vectorization.md:56 msgid "Each element of `x` was added to its corresponding element of `y`:" -msgstr "Each element of `x` was added to its corresponding element of `y`:" +msgstr "この場合 `x` の各要素が対応する `y`の要素に足されます。" # code block #: r-novice-gapminder/_episodes/09-vectorization.md:59 @@ -13519,21 +13419,17 @@ msgid "" "> > {: .output}" msgstr "" ">\n" -"> Let's try this on the `pop` column of the `gapminder` dataset.\n" +"> `gapminder` データセットの `pop` 列でこれに挑戦してみましょう。\n" ">\n" -"> Make a new column in the `gapminder` data frame that\n" -"> contains population in units of millions of people.\n" -"> Check the head or tail of the data frame to make sure\n" -"> it worked.\n" +"> `gapminder` データフレームに百万人単位の人口を示す列を追加しましょう。\n" +"> データフレームの先頭か最後を確認して、追加に成功したか確認しましょう。\n" ">\n" -"> > ## Solution to challenge 1\n" +"> > ## チャレンジ1の解答\n" "> >\n" -"> > Let's try this on the `pop` column of the `gapminder` dataset.\n" +"> > `gapminder` データセットの `pop` 列でこれをやってみましょう。\n" "> >\n" -"> > Make a new column in the `gapminder` data frame that\n" -"> > contains population in units of millions of people.\n" -"> > Check the head or tail of the data frame to make sure\n" -"> > it worked.\n" +"> > `gapminder` データフレームに百万人単位の人口を示す列を追加しましょう。\n" +"> > データフレームの先頭か最後を確認して、追加に成功したか確認しましょう。\n" "> >\n" "> > \n" "> > ~~~\n" @@ -13589,16 +13485,16 @@ msgid "" "> > \"plot" msgstr "" ">\n" -"> On a single graph, plot population, in\n" -"> millions, against year, for all countries. Don't worry about\n" -">identifying which country is which.\n" +"> 一つの図に、100万人単位の人口を年ごとにプロットしてみましょう。\n" +"> 国ごとの区別はつかなくていいです。\n" ">\n" -"> Repeat the exercise, graphing only for China, India, and\n" -">Indonesia. Again, don't worry about which is which.\n" +"> 練習を繰り返して、中国とインドとインドネシアだけを含む図を\n" +"> 作ってみましょう。\n" +"> 先程と同じく、国ごとの区別はつかなくていいです。\n" ">\n" -"> > ## Solution to challenge 2\n" +"> > ## チャレンジ2の解答\n" "> >\n" -"> > Refresh your plotting skills by plotting population in millions against year.\n" +"> > 100万人単位の人口を年ごとにプロットして、作図方法を復習しましょう。\n" "> >\n" "> > \n" "> > ~~~\n" @@ -13623,13 +13519,11 @@ msgstr "" msgid "" "Comparison operators, logical operators, and many functions are also\n" "vectorized:" -msgstr "" -"Comparison operators, logical operators, and many functions are also\n" -"vectorized:" +msgstr "比較演算子や論理演算子に加え、多くの関数もベクトル化されています。" #: r-novice-gapminder/_episodes/09-vectorization.md:149 msgid "**Comparison operators**" -msgstr "**Comparison operators**" +msgstr "**比較演算子**" # code block #: r-novice-gapminder/_episodes/09-vectorization.md:152 @@ -13655,7 +13549,7 @@ msgstr "" #: r-novice-gapminder/_episodes/09-vectorization.md:164 msgid "**Logical operators**" -msgstr "**Logical operators**" +msgstr "**論理演算子**" # code block #: r-novice-gapminder/_episodes/09-vectorization.md:166 @@ -13666,7 +13560,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"a <- x > 3 # or, for clarity, a <- (x > 3)\n" +"a <- x > 3 # より明確な書き方は a <- (x > 3)\n" "a\n" "~~~" @@ -13684,7 +13578,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/09-vectorization.md:179 msgid "> ## Tip: some useful functions for logical vectors" -msgstr "> ## Tip: some useful functions for logical vectors" +msgstr "> ## Tip: 論理ベクトルに使える便利な関数" #: r-novice-gapminder/_episodes/09-vectorization.md:180 msgid "" @@ -13693,16 +13587,16 @@ msgid "" "> `all()` will return `TRUE` if *all* elements of a vector are `TRUE`" msgstr "" ">\n" -"> `any()` will return `TRUE` if *any* element of a vector is `TRUE`\n" -"> `all()` will return `TRUE` if *all* elements of a vector are `TRUE`" +"> `any()` はベクトルの要素に一つでも `TRUE` があれば `TRUE` を返します。\n" +"> `all()` はベクトルの要素が全て `TRUE` であれば `TRUE` を返します。" #: r-novice-gapminder/_episodes/09-vectorization.md:185 msgid "Most functions also operate element-wise on vectors:" -msgstr "Most functions also operate element-wise on vectors:" +msgstr "ほとんどの関数はベクトルを要素ごとに処理します。" #: r-novice-gapminder/_episodes/09-vectorization.md:187 msgid "**Functions**" -msgstr "**Functions**" +msgstr "**関数**" # code block #: r-novice-gapminder/_episodes/09-vectorization.md:189 @@ -13730,7 +13624,7 @@ msgstr "" #: r-novice-gapminder/_episodes/09-vectorization.md:202 msgid "Vectorized operations work element-wise on matrices:" -msgstr "Vectorized operations work element-wise on matrices:" +msgstr "ベクトル化された操作は行列を要素ごとに処理します:" # code block #: r-novice-gapminder/_episodes/09-vectorization.md:205 @@ -13765,7 +13659,7 @@ msgstr "" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/09-vectorization.md:222 msgid "> ## Tip: element-wise vs. matrix multiplication" -msgstr "> ## Tip: element-wise vs. matrix multiplication" +msgstr "> ## Tip: 要素ごとの積 vs. 行列の積" #: r-novice-gapminder/_episodes/09-vectorization.md:223 msgid "" @@ -13789,8 +13683,8 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> Very important: the operator `*` gives you element-wise multiplication!\n" -"> To do matrix multiplication, we need to use the `%*%` operator:\n" +"> 非常に重要: `*` 演算子は要素ごとの積を行います!\n" +"> 行列の積を行うには `%*%` 演算子を使う必要があります:\n" ">\n" "> \n" "> ~~~\n" @@ -13852,8 +13746,8 @@ msgid "" "> guide](http://www.statmethods.net/advstats/matrix.html)" msgstr "" ">\n" -"> For more on matrix algebra, see the [Quick-R reference\n" -"> guide](http://www.statmethods.net/advstats/matrix.html)" +"> 更に行列代数について知るには [Quick-R reference guide](http://www.statmethods.net/advstats/matrix.html)\n" +"> を参照して下さい" #: r-novice-gapminder/_episodes/09-vectorization.md:264 msgid "" @@ -13877,7 +13771,7 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> Given the following matrix:\n" +"> 以下の行列が与えられたとします:\n" ">\n" "> \n" "> ~~~\n" @@ -13966,18 +13860,18 @@ msgid "" "> >" msgstr "" ">\n" -"> Write down what you think will happen when you run:\n" +"> 以下を実行すると何が起きるか書いて下さい:\n" ">\n" "> 1. `m ^ -1`\n" "> 2. `m * c(1, 0, -1)`\n" "> 3. `m > c(0, 20)`\n" "> 4. `m * c(1, 0, -1, 2)`\n" ">\n" -"> Did you get the output you expected? If not, ask a helper!\n" +"> 思った通りの出力が得られましたか?違っていたことがあれば、ヘルパーになぜ間違っていたか聞いてみましょう。\n" ">\n" -"> > ## Solution to challenge 3\n" +"> > ## チャレンジ3の解答\n" "> >\n" -"> > Given the following matrix:\n" +"> > 以下の行列が与えられたとします:\n" "> >\n" "> > \n" "> > ~~~\n" @@ -13997,7 +13891,7 @@ msgstr "" "> > {: .output}\n" "> >\n" "> >\n" -"> > Write down what you think will happen when you run:\n" +"> > 以下を実行すると何が起きるか書き出して下さい:\n" "> >\n" "> > 1. `m ^ -1`\n" "> >\n" @@ -14155,8 +14049,7 @@ msgid "" "> >" msgstr "" ">\n" -"> We're interested in looking at the sum of the\n" -"> following sequence of fractions:\n" +"> 以下の分数の数列の総和が知りたいとします:\n" ">\n" "> \n" "> ~~~\n" @@ -14164,14 +14057,13 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> This would be tedious to type out, and impossible for high values of\n" -"> n. Use vectorisation to compute x when n=100. What is the sum when\n" -"> n=10,000?\n" +"> これをタイプするのは面倒な上に、nが大きいと不可能です。\n" +"> ベクトル化を用いて n = 100 の場合を計算しましょう。\n" +"> n = 10,000 の時の総和はいくつでしょうか?\n" ">\n" -"> > ## Challenge 4\n" +"> > ## チャレンジ4\n" "> >\n" -"> > We're interested in looking at the sum of the\n" -"> > following sequence of fractions:\n" +"> > 以下の分数の数列の総和が知りたいとします:\n" "> >\n" "> > \n" "> > ~~~\n" @@ -14179,10 +14071,9 @@ msgstr "" "> > ~~~\n" "> > {: .language-r}\n" "> >\n" -"> > This would be tedious to type out, and impossible for\n" -"> > high values of n.\n" -"> > Can you use vectorisation to compute x, when n=100?\n" -"> > How about when n=10,000?\n" +"> > これをタイプするのは面倒な上に、nが大きいと不可能です。\n" +"> > ベクトル化を用いて n = 100 の場合を計算しましょう。\n" +"> > n = 10,000 の時の総和はいくつでしょうか?\n" "> >\n" "> > \n" "> > ~~~\n" @@ -14226,7 +14117,7 @@ msgstr "" "> > ~~~\n" "> > {: .output}\n" "> >\n" -"> > We can also obtain the same results using a function:\n" +"> > 同じ結果を関数を利用して得ることもできます:\n" "> > \n" "> > ~~~\n" "> > inverse_sum_of_squares <- function(n) {\n" @@ -14302,23 +14193,23 @@ msgstr "" "---\n" "# Please do not edit this file directly; it is auto generated.\n" "# Instead, please edit 10-functions.md in _episodes_rmd/\n" -"title: Functions Explained\n" -"teaching: 45\n" -"exercises: 15\n" -"questions:\n" -"- \"How can I write a new function in R?\"\n" -"objectives:\n" -"- \"Define a function that takes arguments.\"\n" -"- \"Return a value from a function.\"\n" -"- \"Check argument conditions with `stopifnot()` in functions.\"\n" -"- \"Test a function.\"\n" -"- \"Set default values for function arguments.\"\n" -"- \"Explain why we should divide programs into small, single-purpose functions.\"\n" -"keypoints:\n" -"- \"Use `function` to define a new function in R.\"\n" -"- \"Use parameters to pass values into functions.\"\n" -"- \"Use `stopifnot()` to flexibly check function arguments in R.\"\n" -"- \"Load functions into programs using `source()`.\"\n" +"title: 関数について\n" +"講義: 45\n" +"練習: 15\n" +"質問:\n" +"- \"R で関数はどう書くの?\"\n" +"目標:\n" +"- \"引数を持つ関数を定義しましょう。\"\n" +"- \"関数から値を返しましょう。\"\n" +"- \"関数の中で `stopifnot()` を使って引数の状態を検査しましょう。\"\n" +"- \"関数をテストしましょう。\"\n" +"- \"関数の引数に既定値を指定しましょう。\"\n" +"- \"なぜプログラムを小さな一つの目的を持つ関数に分けるべきか説明しましょう。\"\n" +"要点:\n" +"- \"`function` を使って R で新しい関数を定義します。\"\n" +"- \"パラメーターを用いて関数に値を渡します。\"\n" +"- \"`stopifnot()` を使って R の関数の引数を柔軟に検査します。\"\n" +"- \"`source()` を使ってプログラムに関数を読み込みます。\"\n" "source: Rmd\n" "---" @@ -14330,24 +14221,20 @@ msgid "" "information later and re-run our analysis again. We may also obtain similar data\n" "from a different source in the future." msgstr "" -"If we only had one data set to analyze, it would probably be faster to load the\n" -"file into a spreadsheet and use that to plot simple statistics. However, the\n" -"gapminder data is updated periodically, and we may want to pull in that new\n" -"information later and re-run our analysis again. We may also obtain similar data\n" -"from a different source in the future." +"分析したいデータセットが一つだけなら、ファイルを表計算ソフトで読み込み、単純な統計値をプロットした方が早いでしょう。\n" +"しかし、gapmider データは定期的に更新されるので、後から新しい情報を読み込み分析し直したくなります。\n" +"また、将来的には似たようなデータを違う場所から入手することもあるでしょう。" #: r-novice-gapminder/_episodes/10-functions.md:33 msgid "" "In this lesson, we'll learn how to write a function so that we can repeat\n" "several operations with a single command." -msgstr "" -"In this lesson, we'll learn how to write a function so that we can repeat\n" -"several operations with a single command." +msgstr "この講義では関数の書き方を学ぶことで、同じ操作を一つのコマンドで繰り返せるようになります。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/10-functions.md:36 msgid "> ## What is a function?" -msgstr "> ## What is a function?" +msgstr "> ## 関数とは何でしょう?" #: r-novice-gapminder/_episodes/10-functions.md:37 msgid "" @@ -14365,30 +14252,28 @@ msgid "" "> you have written a function, you are a computer programmer." msgstr "" ">\n" -"> Functions gather a sequence of operations into a whole, preserving it for\n" -"> ongoing use. Functions provide:\n" +"> 関数は連続した操作を一つに纏め、後から使うときのために保存しておきます。\n" +"> 関数は以下の機能を提供します。:\n" ">\n" -"> * a name we can remember and invoke it by\n" -"> * relief from the need to remember the individual operations\n" -"> * a defined set of inputs and expected outputs\n" -"> * rich connections to the larger programming environment\n" +"> * 記憶可能で実行可能な名前\n" +"> * 各操作を覚える必要性からの解放\n" +"> * 入力と出力の組み合わせを定義\n" +"> * より大規模なプログラミング環境への接続性の高さ\n" ">\n" -"> As the basic building block of most programming languages, user-defined\n" -"> functions constitute \"programming\" as much as any single abstraction can. If\n" -"> you have written a function, you are a computer programmer." +"> ほとんどのプログラミング言語における基本的なブロックの構築がそうであるように\n" +"> ユーザーが定義する関数はどんな単純なことであれ抽象化する「プログラミング」により成り立ちます。\n" +"> 関数を書いた時点であなたはコンピュータープログラマーです。" # header #: r-novice-gapminder/_episodes/10-functions.md:51 msgid "## Defining a function" -msgstr "## Defining a function" +msgstr "## 関数を定義しましょう。" #: r-novice-gapminder/_episodes/10-functions.md:53 msgid "" "Let's open a new R script file in the `functions/` directory and call it\n" "functions-lesson.R." -msgstr "" -"Let's open a new R script file in the `functions/` directory and call it\n" -"functions-lesson.R." +msgstr "`functions/` ディレクトリ内に新しく functions-lesson.R と名付けた R スクリプトを作成して開きましょう。" # code block #: r-novice-gapminder/_episodes/10-functions.md:57 @@ -14411,9 +14296,7 @@ msgstr "" msgid "" "Let's define a function `fahr_to_kelvin()` that converts temperatures from\n" "Fahrenheit to Kelvin:" -msgstr "" -"Let's define a function `fahr_to_kelvin()` that converts temperatures from\n" -"Fahrenheit to Kelvin:" +msgstr "華氏をケルビンに変換する `fahr_to_kelvin()` という関数を定義しましょう。" # code block #: r-novice-gapminder/_episodes/10-functions.md:69 @@ -14442,16 +14325,21 @@ msgid "" "(`{}`). The statements in the body are indented by two spaces. This makes the\n" "code easier to read but does not affect how the code operates." msgstr "" -"We define `fahr_to_kelvin()` by assigning it to the output of `function`. The\n" -"list of argument names are contained within parentheses. Next, the\n" -"[body]({{ page.root }}/reference/#function-body) of the function--the\n" -"statements that are executed when it runs--is contained within curly braces\n" -"(`{}`). The statements in the body are indented by two spaces. This makes the\n" -"code easier to read but does not affect how the code operates." +"`fahr_to_kelvin()` を定義するには、`fahr_to_kelvin` に `function` の出力を指定します。\n" +"引数名の一覧は括弧の中に書きます。\n" +"次に関数の[本文 (body)]({{ page.root }}/reference/#function-body) として\n" +"走らせた時の実行内容を波括弧 (`{}`) の中に記述します。\n" +"本文はスペース二つでインデントしておきます。\n" +"これによりコードの操作内容を変更せずに可読性を向上させます。" #: r-novice-gapminder/_episodes/10-functions.md:84 msgid "It is useful to think of creating functions like writing a cookbook. First you define the \"ingredients\" that your function needs. In this case, we only need one ingredient to use our function: \"temp\". After we list our ingredients, we then say what we will do with them, in this case, we are taking our ingredient and applying a set of mathmatical operators to it. " -msgstr "It is useful to think of creating functions like writing a cookbook. First you define the \"ingredients\" that your function needs. In this case, we only need one ingredient to use our function: \"temp\". After we list our ingredients, we then say what we will do with them, in this case, we are taking our ingredient and applying a set of mathmatical operators to it. " +msgstr "" +"関数を作ることは料理本を書くようなものだと思うといいでしょう。\n" +"まず、必要な「材料」を決めます。\n" +"今回の関数に必要な材料は「temp」一つだけです。\n" +"材料を列挙したら、材料を使って何をするかを決めます。\n" +"今回は材料に対して数学的な演算を行います。" #: r-novice-gapminder/_episodes/10-functions.md:86 msgid "" @@ -14461,11 +14349,9 @@ msgid "" "statement]({{ page.root }}/reference/#return-statement) to send a result back to\n" "whoever asked for it." msgstr "" -"When we call the function, the values we pass to it as arguments are assigned to\n" -"those variables so that we can use them inside the function. Inside the\n" -"function, we use a [return\n" -"statement]({{ page.root }}/reference/#return-statement) to send a result back to\n" -"whoever asked for it." +"関数を呼び出す時、引数に指定した値は関数内で用いられる変数に与えられます。\n" +"関数の中では関数を呼び出した相手に結果を送るために [return\n" +"文]({{ page.root }}/reference/#return-statement) を用います。" #: r-novice-gapminder/_episodes/10-functions.md:93 msgid "" @@ -14476,18 +14362,17 @@ msgid "" "> return statement." msgstr "" ">\n" -"> One feature unique to R is that the return statement is not required.\n" -"> R automatically returns whichever variable is on the last line of the body\n" -"> of the function. But for clarity, we will explicitly define the\n" -"> return statement." +"> return 文が不要なことは R の変わった特徴の一つです。\n" +"> R では関数の本文の最終行に記述された変数が自動的に返り値になります。\n" +"> しかし、わかりやすくするために return 文を明示的に記述します。" #: r-novice-gapminder/_episodes/10-functions.md:101 msgid "" "Let's try running our function.\n" "Calling our own function is no different from calling any other function:" msgstr "" -"Let's try running our function.\n" -"Calling our own function is no different from calling any other function:" +"関数を実行してみましょう。\n" +"自分の関数を呼び出す方法は他の関数を呼び出す方法と同じです。" # code block #: r-novice-gapminder/_episodes/10-functions.md:105 @@ -14498,7 +14383,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"# freezing point of water\n" +"# 水の凝固点\n" "fahr_to_kelvin(32)\n" "~~~" @@ -14523,7 +14408,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"# boiling point of water\n" +"# 水の沸点\n" "fahr_to_kelvin(212)\n" "~~~" @@ -14561,15 +14446,13 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Write a function called `kelvin_to_celsius()` that takes a temperature in\n" -"> Kelvin and returns that temperature in Celsius.\n" +"> ケルビンを入力するとセ氏を返す `kelvin_to_celsius()` という関数を書いて下さい。\n" ">\n" -"> Hint: To convert from Kelvin to Celsius you subtract 273.15\n" +"> ヒント: ケルビンをセ氏に換算するには 273.15 を引きます。\n" ">\n" -"> > ## Solution to challenge 1\n" +"> > ## チャレンジ1の解答\n" "> >\n" -"> > Write a function called `kelvin_to_celsius` that takes a temperature in Kelvin\n" -"> > and returns that temperature in Celsius\n" +"> > ケルビンを入力するとセ氏を返す `kelvin_to_celsius()` という関数を書いて下さい。\n" "> >\n" "> > \n" "> > ~~~\n" @@ -14583,23 +14466,19 @@ msgstr "" # header #: r-novice-gapminder/_episodes/10-functions.md:155 msgid "## Combining functions" -msgstr "## Combining functions" +msgstr "## 関数を組み合わせましょう" #: r-novice-gapminder/_episodes/10-functions.md:157 msgid "" "The real power of functions comes from mixing, matching and combining them\n" "into ever-larger chunks to get the effect we want." -msgstr "" -"The real power of functions comes from mixing, matching and combining them\n" -"into ever-larger chunks to get the effect we want." +msgstr "関数の真髄を発揮するのは、関数を混ぜ合わせ組み合わせてより多きな塊にすることで、望み通りの効果を得る時です。" #: r-novice-gapminder/_episodes/10-functions.md:160 msgid "" "Let's define two functions that will convert temperature from Fahrenheit to\n" "Kelvin, and Kelvin to Celsius:" -msgstr "" -"Let's define two functions that will convert temperature from Fahrenheit to\n" -"Kelvin, and Kelvin to Celsius:" +msgstr "華氏をケルビンに変換する関数とケルビンをセ氏に変換する関数の2つを定義しましょう。" # code block #: r-novice-gapminder/_episodes/10-functions.md:164 @@ -14653,15 +14532,13 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Define the function to convert directly from Fahrenheit to Celsius,\n" -"> by reusing the two functions above (or using your own functions if you\n" -"> prefer).\n" +"> 先の2つの関数を再利用するか自分で定義した関数を利用して\n" +"> 華氏を直接セ氏に変換する関数を定義して下さい。\n" ">\n" ">\n" -"> > ## Solution to challenge 2\n" +"> > ## チャレンジ2の解答\n" "> >\n" -"> > Define the function to convert directly from Fahrenheit to Celsius,\n" -"> > by reusing these two functions above\n" +"> > 先の2つの関数を再利用して華氏を直接セ氏に変換する関数を定義して下さい。\n" "> >\n" "> >\n" "> > \n" @@ -14677,7 +14554,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/10-functions.md:202 msgid "## Interlude: Defensive Programming" -msgstr "## Interlude: Defensive Programming" +msgstr "## 幕間: 防衛的プログラミング" #: r-novice-gapminder/_episodes/10-functions.md:204 msgid "" @@ -14691,28 +14568,25 @@ msgid "" "They make it easier to debug because they give us a better idea of where the\n" "errors originate." msgstr "" -"Now that we've begun to appreciate how writing functions provides an efficient\n" -"way to make R code re-usable and modular, we should note that it is important\n" -"to ensure that functions only work in their intended use-cases. Checking\n" -"function parameters is related to the concept of _defensive programming_.\n" -"Defensive programming encourages us to frequently check conditions and throw an\n" -"error if something is wrong. These checks are referred to as assertion\n" -"statements because we want to assert some condition is `TRUE` before proceeding.\n" -"They make it easier to debug because they give us a better idea of where the\n" -"errors originate." +"関数を書くことで R のコードを効率的に再利用したりモジュール化する方法を理解し始めたところですが、\n" +"関数は想定した用途でのみ機能するように確実に設計することが重要です。\n" +"関数の引数を検査することは*防衛的プログラミング*の考え方に繋がります。\n" +"防衛的プログラミングでは状況を頻繁に検査し何かおかしなことがあればエラーを返すことを推奨します。\n" +"このような検査は、プログラム実行を継続する前に現状が `TRUE` であることをアサート(表明・断言)するので、アサーション文と呼ばれます。\n" +"アサーション文により、エラーがどこで起きているか分かりやすくなりデバッグが容易になります。" # header #: r-novice-gapminder/_episodes/10-functions.md:214 msgid "### Checking conditions with `stopifnot()`" -msgstr "### Checking conditions with `stopifnot()`" +msgstr "### `stopifnot()` を用いて状態を検査しましょう" #: r-novice-gapminder/_episodes/10-functions.md:216 msgid "" "Let's start by re-examining `fahr_to_kelvin()`, our function for converting\n" "temperatures from Fahrenheit to Kelvin. It was defined like so:" msgstr "" -"Let's start by re-examining `fahr_to_kelvin()`, our function for converting\n" -"temperatures from Fahrenheit to Kelvin. It was defined like so:" +"華氏をケルビンに変換する `fahr_to_kelvin()` 関数について再検討してみましょう。\n" +"この関数の定義は以下の通りです。" #: r-novice-gapminder/_episodes/10-functions.md:228 msgid "" @@ -14723,12 +14597,12 @@ msgid "" "could check for this condition with an `if` statement and throw an error if the\n" "condition was violated. We could augment our function above like so:" msgstr "" -"For this function to work as intended, the argument `temp` must be a `numeric`\n" -"value; otherwise, the mathematical procedure for converting between the two\n" -"temperature scales will not work. To create an error, we can use the function\n" -"`stop()`. For example, since the argument `temp` must be a `numeric` vector, we\n" -"could check for this condition with an `if` statement and throw an error if the\n" -"condition was violated. We could augment our function above like so:" +"この関数が意図した通りに機能するには、`temp` 引数は数値でなければなりません。\n" +"さもなくば、片方の温度の尺度からもう一方へ変換する計算過程が機能しません。\n" +"エラーを返すためには、`stop` 関数を使います。\n" +"例えば、`temp` 引数は数値ベクトルである必要があるので、\n" +"`if` 文により `temp` が数値ベクトルであるか確認し、違反していればエラーを返すようにします。\n" +"先述の関数の場合は以下のように増補します。" # code block #: r-novice-gapminder/_episodes/10-functions.md:236 @@ -14762,28 +14636,27 @@ msgid "" "conditions also serves a secondary purpose as extra documentation for the\n" "function." msgstr "" -"If we had multiple conditions or arguments to check, it would take many lines\n" -"of code to check all of them. Luckily R provides the convenience function\n" -"`stopifnot()`. We can list as many requirements that should evaluate to `TRUE`;\n" -"`stopifnot()` throws an error if it finds one that is `FALSE`. Listing these\n" -"conditions also serves a secondary purpose as extra documentation for the\n" -"function." +"複数の状態や引数を検査する必要があると、全てを検査するためのコードは何行にも渡ります。\n" +"幸いなことに R は `stopifnot` という便利な関数を提供しています。\n" +"`TRUE` と評価されるべき要件を必要なだけ列挙すると、\n" +"`stopifnot()` は一つでも `FALSE` がある場合にエラーを返します。\n" +"検査項目を列挙すると、追加のドキュメント化という2つ目の目的としても機能します。" #: r-novice-gapminder/_episodes/10-functions.md:254 msgid "" "Let's try out defensive programming with `stopifnot()` by adding assertions to\n" "check the input to our function `fahr_to_kelvin()`." msgstr "" -"Let's try out defensive programming with `stopifnot()` by adding assertions to\n" -"check the input to our function `fahr_to_kelvin()`." +"`stopifnot()` を用いて `fahr_to_kelvin()` に入力を検査するアサーション文を追加し、\n" +"防衛的プログラミングに挑戦しましょう。" #: r-novice-gapminder/_episodes/10-functions.md:257 msgid "" "We want to assert the following: `temp` is a numeric vector. We may do that like\n" "so:" msgstr "" -"We want to assert the following: `temp` is a numeric vector. We may do that like\n" -"so:" +"`temp` が数値ベクトルであることをアサートしたいとします。\n" +"以下のようにしましょう。" # code block #: r-novice-gapminder/_episodes/10-functions.md:261 @@ -14806,7 +14679,7 @@ msgstr "" #: r-novice-gapminder/_episodes/10-functions.md:270 msgid "It still works when given proper input." -msgstr "It still works when given proper input." +msgstr "入力が適切であればこれでも機能します。" # code block #: r-novice-gapminder/_episodes/10-functions.md:273 @@ -14817,13 +14690,13 @@ msgid "" "~~~" msgstr "" "~~~\n" -"# freezing point of water\n" +"# 水の凝固点\n" "fahr_to_kelvin(temp = 32)\n" "~~~" #: r-novice-gapminder/_episodes/10-functions.md:286 msgid "But fails instantly if given improper input." -msgstr "But fails instantly if given improper input." +msgstr "しかし不適切な入力があるとすぐに失敗します。" # code block #: r-novice-gapminder/_episodes/10-functions.md:289 @@ -14877,17 +14750,15 @@ msgid "" "> > {: .language-r}" msgstr "" ">\n" -"> Use defensive programming to ensure that our `fahr_to_celsius()` function\n" -"> throws an error immediately if the argument `temp` is specified\n" -"> inappropriately.\n" +"> 防衛的プログラミングにより、`fahr_to_celsius()` 関数の `temp` 引数に不適切な\n" +"> 値が指定されたらすぐにエラーを返すよう念押しして下さい。\n" ">\n" ">\n" -"> > ## Solution to challenge 3\n" +"> > ## チャレンジ3の解答\n" "> >\n" -"> > Extend our previous definition of the function by adding in an explicit call\n" -"> > to `stopifnot()`. Since `fahr_to_celsius()` is a composition of two other\n" -"> > functions, checking inside here makes adding checks to the two component\n" -"> > functions redundant.\n" +"> > 明示的に `stopifnot()` を呼ぶことで先述の関数の定義を拡張しましょう。\n" +"> > `fahr_to_celsius()` は2つの他の関数から構成されているので、\n" +">> ここでの検査は2つの関数の検査に追加され冗長になります。\n" "> >\n" "> >\n" "> > \n" @@ -14904,15 +14775,13 @@ msgstr "" # header #: r-novice-gapminder/_episodes/10-functions.md:330 msgid "## More on combining functions" -msgstr "## More on combining functions" +msgstr "## もっと関数を組み合わせましょう" #: r-novice-gapminder/_episodes/10-functions.md:332 msgid "" "Now, we're going to define a function that calculates the Gross Domestic Product\n" "of a nation from the data available in our dataset:" -msgstr "" -"Now, we're going to define a function that calculates the Gross Domestic Product\n" -"of a nation from the data available in our dataset:" +msgstr "ここで我々のデータセットで利用できるデータからある国の国内総生産を計算するための関数を定義します。" # code block #: r-novice-gapminder/_episodes/10-functions.md:336 @@ -14927,8 +14796,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"# Takes a dataset and multiplies the population column\n" -"# with the GDP per capita column.\n" +"# データセットを受け取り、人口の列と一人あたりのGDPをかけます。\n" "calcGDP <- function(dat) {\n" " gdp <- dat$pop * dat$gdpPercap\n" " return(gdp)\n" @@ -14942,26 +14810,25 @@ msgid "" "-- the statements executed when you call the function -- is contained within\n" "curly braces (`{}`)." msgstr "" -"We define `calcGDP()` by assigning it to the output of `function`. The list of\n" -"argument names are contained within parentheses. Next, the body of the function \n" -"-- the statements executed when you call the function -- is contained within\n" -"curly braces (`{}`)." +"`calcGDP()` を定義するために、`function` の結果を `calcGDP` に代入します。\n" +"引数の名前の一覧は括弧に中に書きます。\n" +"次に、本文 -- 関数を読んだ時に実行される命令文 -- は波括弧 (`{}`) の中に書きます。" #: r-novice-gapminder/_episodes/10-functions.md:351 msgid "" "We've indented the statements in the body by two spaces. This makes the code\n" "easier to read but does not affect how it operates." msgstr "" -"We've indented the statements in the body by two spaces. This makes the code\n" -"easier to read but does not affect how it operates." +"本文中の命令文は2つのスペースでインデントしました。\n" +"これにより関数の動作に影響を及ぼさずに可読性を向上できます。" #: r-novice-gapminder/_episodes/10-functions.md:354 msgid "" "When we call the function, the values we pass to it are assigned to the\n" "arguments, which become variables inside the body of the function." msgstr "" -"When we call the function, the values we pass to it are assigned to the\n" -"arguments, which become variables inside the body of the function." +"関数を呼び出す時に、関数に渡した値は引数に指定され、\n" +"関数の本文中における変数になります。" #: r-novice-gapminder/_episodes/10-functions.md:357 msgid "" @@ -14969,9 +14836,8 @@ msgid "" "This `return()` function is optional: R will automatically return the results of\n" "whatever command is executed on the last line of the function." msgstr "" -"Inside the function, we use the `return()` function to send back the result.\n" -"This `return()` function is optional: R will automatically return the results of\n" -"whatever command is executed on the last line of the function." +"関数の中では `return()` 関数を用いて結果を返します。\n" +"`return()` 関数は必須ではなく、R は 関数の最終行で実行されたコマンドの結果を自動的に返します。" # code block #: r-novice-gapminder/_episodes/10-functions.md:363 @@ -14999,9 +14865,7 @@ msgstr "" msgid "" "That's not very informative. Let's add some more arguments so we can extract\n" "that per year and country." -msgstr "" -"That's not very informative. Let's add some more arguments so we can extract\n" -"that per year and country." +msgstr "これでは情報に乏しいです。いくつか引数を追加して、年ごとと国ごとの情報を得られるようにしましょう。" # code block #: r-novice-gapminder/_episodes/10-functions.md:379 @@ -15025,8 +14889,7 @@ msgid "" "~~~" msgstr "" "~~~\n" -"# Takes a dataset and multiplies the population column\n" -"# with the GDP per capita column.\n" +"# データセットを受け取り、人口の列と一人あたりのGDPの列をかけます。\n" "calcGDP <- function(dat, year=NULL, country=NULL) {\n" " if(!is.null(year)) {\n" " dat <- dat[dat$year %in% year, ]\n" @@ -15047,9 +14910,8 @@ msgid "" "(a good idea!), you can load in the functions into our R session by using the\n" "`source()` function:" msgstr "" -"If you've been writing these functions down into a separate R script\n" -"(a good idea!), you can load in the functions into our R session by using the\n" -"`source()` function:" +"もしこれらの関数を別の R スクリプトに書いているなら (グッドアイディア!)、\n" +"`source()` 関数を使って関数を R セッションに読み込むことができます。" # code block #: r-novice-gapminder/_episodes/10-functions.md:402 @@ -15072,17 +14934,16 @@ msgid "" "this as the final result. You can see that the output is much more informative\n" "than a vector of numbers." msgstr "" -"Ok, so there's a lot going on in this function now. In plain English, the\n" -"function now subsets the provided data by year if the year argument isn't empty,\n" -"then subsets the result by country if the country argument isn't empty. Then it \n" -"calculates the GDP for whatever subset emerges from the previous two steps. The \n" -"function then adds the GDP as a new column to the subsetted data and returns\n" -"this as the final result. You can see that the output is much more informative\n" -"than a vector of numbers." +"さて、この関数の中では色々なことが起きています。\n" +"平文にすると、この関数は `year` 引数を指定されている場合に、指定した値でデータを絞り込みます。\n" +"次にその結果を、`country` 引数が指定されている場合に指定した値で絞り込みます。\n" +"そしてこの2つの段階を経て現れたデータに対してGDPを計算します。\n" +"更にこの関数は、絞り込んだデータに新しくGDPの列を追加し、最終結果として返します。\n" +"出力が単に数値のベクトルだった時よりもはるかに情報に富んでいることがわかるでしょう。" #: r-novice-gapminder/_episodes/10-functions.md:415 msgid "Let's take a look at what happens when we specify the year:" -msgstr "Let's take a look at what happens when we specify the year:" +msgstr "`year` を指定した時に何が起きるか見てみましょう。" # code block #: r-novice-gapminder/_episodes/10-functions.md:418 @@ -15120,7 +14981,7 @@ msgstr "" #: r-novice-gapminder/_episodes/10-functions.md:436 msgid "Or for a specific country:" -msgstr "Or for a specific country:" +msgstr "また `country` を指定するとどうなるでしょうか。" # code block #: r-novice-gapminder/_episodes/10-functions.md:439 @@ -15170,7 +15031,7 @@ msgstr "" #: r-novice-gapminder/_episodes/10-functions.md:463 msgid "Or both:" -msgstr "Or both:" +msgstr "あるいは両方指定してみましょう。" # code block #: r-novice-gapminder/_episodes/10-functions.md:466 @@ -15198,7 +15059,7 @@ msgstr "" #: r-novice-gapminder/_episodes/10-functions.md:479 msgid "Let's walk through the body of the function:" -msgstr "Let's walk through the body of the function:" +msgstr "関数の本文を順番に見ていきましょう。" # code block #: r-novice-gapminder/_episodes/10-functions.md:482 @@ -15218,10 +15079,9 @@ msgid "" "in the function definition. This means that those arguments will\n" "take on those values unless the user specifies otherwise." msgstr "" -"Here we've added two arguments, `year`, and `country`. We've set\n" -"*default arguments* for both as `NULL` using the `=` operator\n" -"in the function definition. This means that those arguments will\n" -"take on those values unless the user specifies otherwise." +"ここで `year` と `country` の二つの引数を追加しました。\n" +"`=` 演算子を関数定義時に用いることで、両者の*既定値*には `NULL` を指定しています。\n" +"これにより、ユーザーが値を指定しない限り、これらの引数の値は `NULL` になることを意味します。" # code block #: r-novice-gapminder/_episodes/10-functions.md:493 @@ -15250,50 +15110,47 @@ msgid "" "they're not `null` overwrite the dataset stored in `dat` with a subset given by \n" "the non-`null` argument." msgstr "" -"Here, we check whether each additional argument is set to `null`, and whenever\n" -"they're not `null` overwrite the dataset stored in `dat` with a subset given by \n" -"the non-`null` argument." +"ここでは、追加した引数それぞれについて値が `NULL` であるか確認し、\n" +"`NULL` でなければ `dat` に格納されたデータセットを非 `NULL` な引数の値を用いて絞り込み上書きします。" #: r-novice-gapminder/_episodes/10-functions.md:507 msgid "" "I did this so that our function is more flexible for later. We can ask it to\n" "calculate the GDP for:" msgstr "" -"I did this so that our function is more flexible for later. We can ask it to\n" -"calculate the GDP for:" +"こうして関数を柔軟なものにすることで、後々使いやすくしました。\n" +"この関数を用いて、以下の様々な場合のGDPを計算できます。" # unordered list #: r-novice-gapminder/_episodes/10-functions.md:510 msgid " * The whole dataset;" -msgstr " * The whole dataset;" +msgstr " * データセット全体" # unordered list #: r-novice-gapminder/_episodes/10-functions.md:511 msgid " * A single year;" -msgstr " * A single year;" +msgstr " * ある年" # unordered list #: r-novice-gapminder/_episodes/10-functions.md:512 msgid " * A single country;" -msgstr " * A single country;" +msgstr " * ある国" # unordered list #: r-novice-gapminder/_episodes/10-functions.md:513 msgid " * A single combination of year and country." -msgstr " * A single combination of year and country." +msgstr " * ある年とある国の組み合わせ" #: r-novice-gapminder/_episodes/10-functions.md:515 -msgid "" -"By using `%in%` instead, we can also give multiple years or countries to those\n" -"arguments." -msgstr "" +msgid "" "By using `%in%` instead, we can also give multiple years or countries to those\n" "arguments." +msgstr "代わりに `%in%` を使うことによって、`year` と `country` に複数の値を指定できるようになっています。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/10-functions.md:518 msgid "> ## Tip: Pass by value" -msgstr "> ## Tip: Pass by value" +msgstr "> ## Tip: 値渡し" #: r-novice-gapminder/_episodes/10-functions.md:519 msgid "" @@ -15308,19 +15165,18 @@ msgid "" "> body of the function, stay inside the body of the function." msgstr "" ">\n" -"> Functions in R almost always make copies of the data to operate on\n" -"> inside of a function body. When we modify `dat` inside the function\n" -"> we are modifying the copy of the gapminder dataset stored in `dat`,\n" -"> not the original variable we gave as the first argument.\n" +"> R の関数は関数本文中で操作するためのデータを、ほぼ必ずコピーします。\n" +"> 関数の中で `dat` を変更するということは、\n" +"> `dat` に格納された gapminder データセットのコピーを変更するということであり、\n" +"> 第一引数に指定した元の変数を変更することはありません。\n" ">\n" -"> This is called \"pass-by-value\" and it makes writing code much safer:\n" -"> you can always be sure that whatever changes you make within the\n" -"> body of the function, stay inside the body of the function." +"> この挙動は \"値渡し\" と呼ばれ、コードの記述をより安全なものにします。\n" +"> つまり、関数内での変更は常に関数内での出来事に留まります。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/10-functions.md:530 msgid "> ## Tip: Function scope" -msgstr "> ## Tip: Function scope" +msgstr "> ## Tip: 関数のスコープ" #: r-novice-gapminder/_episodes/10-functions.md:531 msgid "" @@ -15332,13 +15188,12 @@ msgid "" "> have variables of the same name in our interactive R session, they are\n" "> not modified in any way when executing a function." msgstr "" -">\n" -"> Another important concept is scoping: any variables (or functions!) you\n" -"> create or modify inside the body of a function only exist for the lifetime\n" -"> of the function's execution. When we call `calcGDP()`, the variables `dat`,\n" -"> `gdp` and `new` only exist inside the body of the function. Even if we\n" -"> have variables of the same name in our interactive R session, they are\n" -"> not modified in any way when executing a function." +"> スコープはもう一つの重要な概念です。\n" +"> 関数の本文中で作成したり変更したいかなる変数 (関数を含む!) は、\n" +"> 関数を実行している間だけ存在します。`calcGDP()` を呼んだ時に、\n" +"> `dat`、`gdp`、そして `new` という変数は関数の本文中でのみ存在します。\n" +"> 対話的な R のセッションにおいて同名の変数が存在していたとして、\n" +"> それらは関数実行時に変更されることはありません。" # code block #: r-novice-gapminder/_episodes/10-functions.md:541 @@ -15364,10 +15219,9 @@ msgid "" "the context for the returned GDP values, which is much better than in our first \n" "attempt where we got a vector of numbers." msgstr "" -"Finally, we calculated the GDP on our new subset, and created a new data frame\n" -"with that column added. This means when we call the function later we can see\n" -"the context for the returned GDP values, which is much better than in our first \n" -"attempt where we got a vector of numbers." +"最終的に、絞り込んだデータからGDPを計算し、その結果を列に追加した新しいデータフレームを作成しました。\n" +"これは関数を呼び出した後でも返り値のGDPの値が持つ文脈がわかることを意味します。\n" +"従って、最初に試した数値のベクトルを返す方法よりもずっと良いものです。" #: r-novice-gapminder/_episodes/10-functions.md:555 msgid "" @@ -15387,19 +15241,19 @@ msgid "" "> > GDP for New Zealand in 1952: 21058193787" msgstr "" ">\n" -"> Test out your GDP function by calculating the GDP for New Zealand in 1987. How\n" -"> does this differ from New Zealand's GDP in 1952?\n" +"> GDP を計算する関数をテストするため、1987年の New Zealand の GDP を計算して下さい。\n" +"> 1952 年の New Zealand の GDP とはどう違いますか?\n" ">\n" -"> > ## Solution to challenge 4\n" +"> > ## チャレンジ4の解答\n" "> >\n" "> > \n" "> > ~~~\n" "> > calcGDP(gapminder, year = c(1952, 1987), country = \"New Zealand\")\n" "> > ~~~\n" "> > {: .language-r}\n" -"> > GDP for New Zealand in 1987: 65050008703\n" +"> > 1987年の New Zealand の GDP: 65050008703\n" "> >\n" -"> > GDP for New Zealand in 1952: 21058193787" +"> > 1952年の New Zealand の GDP: 21058193787" #: r-novice-gapminder/_episodes/10-functions.md:574 msgid "" @@ -15420,7 +15274,7 @@ msgid "" "> ~~~" msgstr "" ">\n" -"> The `paste()` function can be used to combine text together, e.g:\n" +"> `paste()` 関数を使うと文字列を一繋ぎにできます。例えば\n" ">\n" "> \n" "> ~~~\n" @@ -15477,8 +15331,7 @@ msgid "" "> > {: .output}" msgstr "" ">\n" -"> Write a function called `fence()` that takes two vectors as arguments, called\n" -"> `text` and `wrapper`, and prints out the text wrapped with the `wrapper`:\n" +"> `text` と `wrapper` という引数を持ち、`text` を `wapper` で囲む `fence()` という関数を定義して下さい。\n" ">\n" "> \n" "> ~~~\n" @@ -15486,15 +15339,12 @@ msgstr "" "> ~~~\n" "> {: .language-r}\n" ">\n" -"> *Note:* the `paste()` function has an argument called `sep`, which specifies\n" -"> the separator between text. The default is a space: \" \". The default for\n" -"> `paste0()` is no space \"\".\n" +"> *Note:* `paste()` 関数では `sep` 引数を用いて文字列の間に入る文字列を指定できます。\n" +"> `paste0()` の場合 `sep` の既定値は \"\" です。\n" ">\n" -"> > ## Solution to challenge 5\n" +"> > ## チャレンジ5の解答\n" "> >\n" -"> > Write a function called `fence()` that takes two vectors as arguments,\n" -"> > called `text` and `wrapper`, and prints out the text wrapped with the\n" -"> > `wrapper`:\n" +"> > `text` と `wrapper` という引数を持ち、`text` を `wapper` で囲む `fence()` という関数を定義して下さい。\n" "> >\n" "> > \n" "> > ~~~\n" @@ -15526,12 +15376,11 @@ msgid "" "> [Advanced R Programming][adv-r] by Hadley Wickham." msgstr "" ">\n" -"> R has some unique aspects that can be exploited when performing more\n" -"> complicated operations. We will not be writing anything that requires\n" -"> knowledge of these more advanced concepts. In the future when you are\n" -"> comfortable writing functions in R, you can learn more by reading the\n" -"> [R Language Manual][man] or this [chapter][] from\n" -"> [Advanced R Programming][adv-r] by Hadley Wickham." +"> R より複雑な演算を行う時に利用できる変わった機能があります。\n" +"> ここでは発展的な概念を知っておく必要のあることは書きません。\n" +"> 将来的に R で関数を書くことに慣れたら、\n" +"> [R Language Manual][man] や Hadley Wickham による\n" +"> [Advanced R Programming][adv-r] のこの[章][]を読んで学んで下さい。" #: r-novice-gapminder/_episodes/10-functions.md:641 msgid "" @@ -15540,13 +15389,13 @@ msgid "" "[adv-r]: http://adv-r.had.co.nz/" msgstr "" "[man]: http://cran.r-project.org/doc/manuals/r-release/R-lang.html#Environment-objects\n" -"[chapter]: http://adv-r.had.co.nz/Environments.html\n" +"[章]: http://adv-r.had.co.nz/Environments.html\n" "[adv-r]: http://adv-r.had.co.nz/" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/10-functions.md:646 msgid "> ## Tip: Testing and documenting" -msgstr "> ## Tip: Testing and documenting" +msgstr "> ## Tip: テストとドキュメント" #: r-novice-gapminder/_episodes/10-functions.md:647 msgid "" @@ -15578,31 +15427,26 @@ msgid "" "> Formal automated tests can be written using the [testthat][] package." msgstr "" ">\n" -"> It's important to both test functions and document them:\n" -"> Documentation helps you, and others, understand what the\n" -"> purpose of your function is, and how to use it, and its\n" -"> important to make sure that your function actually does\n" -"> what you think.\n" -">\n" -"> When you first start out, your workflow will probably look a lot\n" -"> like this:\n" +"> 関数をテストし、ドキュメントを整備することは重要です。\n" +"> ドキュメントはあなたや他の人が関数の用途や用法を理解する助けになります。\n" +"> また、関数が意図した通りに動作することを確認することは重要です。\n" +"> 始めるにあたって、作業手順は多くの場合以下のようなものになるでしょう。\n" ">\n" -"> 1. Write a function\n" -"> 2. Comment parts of the function to document its behaviour\n" -"> 3. Load in the source file\n" -"> 4. Experiment with it in the console to make sure it behaves\n" -"> as you expect\n" -"> 5. Make any necessary bug fixes\n" -"> 6. Rinse and repeat.\n" +"> 1. 関数を書く\n" +"> 2. 関数の部分的な挙動についてドキュメント代わりにコメントする\n" +"> 3. ソースファイルを読み込む\n" +"> 4. コンソール上で実験し、意図した通りに動作するか確認する\n" +"> 5. 適宜バグの修正を行う\n" +"> 6. これらを繰り返す。\n" ">\n" -"> Formal documentation for functions, written in separate `.Rd`\n" -"> files, gets turned into the documentation you see in help\n" -"> files. The [roxygen2][] package allows R coders to write documentation\n" -"> alongside the function code and then process it into the appropriate `.Rd`\n" -"> files. You will want to switch to this more formal method of writing\n" -"> documentation when you start writing more complicated R projects.\n" +"> 別途 `.Rd` ファイルに記述された正式な関数のドキュメントは、\n" +"> ヘルプファイルを見た時のドキュメントになります。\n" +"> [roxygen2][] パッケージを使うと、開発者は R の関数のすぐ側にドキュメントを書き、\n" +"> 適切な `.Rd` ファイルに加工することができます。\n" +"> より複雑なプロジェクトを R で扱うようになると、このようにより正式な手法を使って\n" +"> ドキュメントを整備したくなるでしょう。\n" ">\n" -"> Formal automated tests can be written using the [testthat][] package." +"> 正式な自動化されたテストを書くには [testthat][] パッケージを使います。." #: r-novice-gapminder/_episodes/10-functions.md:675 msgid "" @@ -19294,7 +19138,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:26 msgid "## Data analysis reports" -msgstr "## Data analysis reports" +msgstr "## データ分析報告" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:28 msgid "" @@ -19302,9 +19146,8 @@ msgid "" "analyses and results, for their collaborators or to document their\n" "work for future reference." msgstr "" -"Data analysts tend to write a lot of reports, describing their\n" -"analyses and results, for their collaborators or to document their\n" -"work for future reference." +"データ分析家は、協力者や、将来参照する文章として、分析及び結果を記した\n" +"報告を数多く書く傾向にあります。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:32 msgid "" @@ -19313,10 +19156,9 @@ msgid "" "results and attaching various graphs. In discussing the results, there\n" "would often be confusion about which graph was which." msgstr "" -"When I was first starting out, I'd write an R script with all of my\n" -"work, and would just send an email to my collaborator, describing the\n" -"results and attaching various graphs. In discussing the results, there\n" -"would often be confusion about which graph was which." +"私が始めたばかりの頃は、全ての仕事についてRスクリプトを書いて、\n" +"結果を説明し、様々なグラフを添付したメールを協力者に送信していました。\n" +"結果を議論する際、どのグラフについて話しているのか混乱してしまうことがよくありました。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:37 msgid "" @@ -19324,9 +19166,9 @@ msgid "" "spend a lot of time getting the figures to look right. Mostly, the\n" "concern is about page breaks." msgstr "" -"I moved to writing formal reports, with Word or LaTeX, but I'd have to\n" -"spend a lot of time getting the figures to look right. Mostly, the\n" -"concern is about page breaks." +"WordやLaTeXで正式な報告を書く様になったのですが、図を正しく表示\n" +"するためにかなり多くの時間を費やしました。大抵の場合、ページ分けで\n" +"つまずきました。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:41 msgid "" @@ -19334,14 +19176,14 @@ msgid "" "file). It can be one long stream, so I can use tall figures that\n" "wouldn't ordinary fit on one page. Scrolling is your friend." msgstr "" -"Everything is easier now that I create a web page (as an html\n" -"file). It can be one long stream, so I can use tall figures that\n" -"wouldn't ordinary fit on one page. Scrolling is your friend." +"今では、ウェブページ(htmlファイル)を作るようになり全てが楽になりました。\n" +"ひとつの長いページなるので、普通ではひとつのページに収まらないような高さの図\n" +"でもはみ出さずに入れることができます。「スクロールは友達」ですね。" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:46 msgid "## Literate programming" -msgstr "## Literate programming" +msgstr "## 読み書きできるプログラミング" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:48 msgid "" @@ -19351,11 +19193,11 @@ msgid "" "results (versus having to reconstruct figures, paste them into\n" "a Word document, and further hand-edit various detailed results)." msgstr "" -"Ideally, such analysis reports are _reproducible_ documents: If an\n" -"error is discovered, or if some additional subjects are added to the\n" -"data, you can just re-compile the report and get the new or corrected\n" -"results (versus having to reconstruct figures, paste them into\n" -"a Word document, and further hand-edit various detailed results)." +"分析報告書のようなものは、_再現できる_ 文書であることが理想です。つまり、\n" +"エラーが見つかった場合や、データに追加があった場合など、単に報告書を\n" +"再コンパイルすることで、新しい、または正しい結果が得られるという形です\n" +"(再現できない文書の場合、図を再作成し、Word文書に貼り付け、更に手作業で\n" +"様々な詳細結果に手を加えなえればなりません)。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:54 msgid "" @@ -19364,14 +19206,14 @@ msgid "" "code. When the document is processed by knitr, chunks of R code will\n" "be executed, and graphs or other results inserted." msgstr "" -"The key tool for R is [knitr](http://yihui.name/knitr/), which allows\n" -"you to create a document that is a mixture of text and some chunks of\n" -"code. When the document is processed by knitr, chunks of R code will\n" -"be executed, and graphs or other results inserted." +"Rでカギとなるツールは [knitr](http://yihui.name/knitr/) です。これは、\n" +"コードと文章が混ざった文書を作成してくれるものです。\n" +"文書がknitrで処理される際にRコードが実行され、\n" +"グラフや他の結果が文書に挿入されます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:59 msgid "This sort of idea has been called \"literate programming\"." -msgstr "This sort of idea has been called \"literate programming\"." +msgstr "こういうものを「読み書きできるプログラミング(literate programming)」と呼びます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:61 msgid "" @@ -19380,23 +19222,22 @@ msgid "" "with R. Markdown is a light-weight mark-up language for creating web\n" "pages." msgstr "" -"knitr allows you to mix basically any sort of text with any sort of\n" -"code, but we recommend that you use R Markdown, which mixes Markdown\n" -"with R. Markdown is a light-weight mark-up language for creating web\n" -"pages." +"knitrは、基本的にどんなテキストやコードでも組み合わせられるのですが、\n" +"RにMarkdownを合体させた、R Markdownがお勧めです。\n" +"Markdownは、ウェブページを作るための軽量なマークアップ言語です。" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:67 msgid "## Creating an R Markdown file" -msgstr "## Creating an R Markdown file" +msgstr "## R Markdownファイルの作成" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:69 msgid "" "Within R Studio, click File → New File → R Markdown and\n" "you'll get a dialog box like this:" msgstr "" -"Within R Studio, click File → New File → R Markdown and\n" -"you'll get a dialog box like this:" +"R Studioで、File → New File → R Markdown をクリックしましょう。\n" +"すると、次のようなダイアログボックスが出ます:" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:72 msgid "![](../fig/New_R_Markdown.png)" @@ -19404,12 +19245,12 @@ msgstr "![](../fig/New_R_Markdown.png)" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:74 msgid "You can stick with the default (HTML output), but give it a title." -msgstr "You can stick with the default (HTML output), but give it a title." +msgstr "デフォルト(HTML output)のままでよいので、タイトルを付けましょう。" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:77 msgid "## Basic components of R Markdown" -msgstr "## Basic components of R Markdown" +msgstr "## R Markdownの基本構成要素" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:79 msgid "" @@ -19417,9 +19258,9 @@ msgid "" "thing a title, author, and date, and tell it that you're going to want\n" "to produce html output (in other words, a web page)." msgstr "" -"The initial chunk of text contains instructions for R: you give the\n" -"thing a title, author, and date, and tell it that you're going to want\n" -"to produce html output (in other words, a web page)." +"最初のテキストの塊は、Rへの説明となります。つまり、\n" +"タイトル、著者者、日付といったものを書き込み、\n" +"html(つまりウェブページを)出力したいということを伝えましょう。" # code block #: r-novice-gapminder/_episodes/15-knitr-markdown.md:83 @@ -19448,17 +19289,17 @@ msgid "" "included. The double-quotes aren't strictly _necessary_ in this case.\n" "They're mostly needed if you want to include a colon in the title." msgstr "" -"You can delete any of those fields if you don't want them\n" -"included. The double-quotes aren't strictly _necessary_ in this case.\n" -"They're mostly needed if you want to include a colon in the title." +"入れたくなければ、これらのフィールドのいずれも消すことができます。\n" +"二重引用符は、厳密には _必須_ ではありません。\n" +"大抵は、タイトルにコロンを含めたいときに使います。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:96 msgid "" "RStudio creates the document with some example text to get you\n" "started. Note below that there are chunks like" msgstr "" -"RStudio creates the document with some example text to get you\n" -"started. Note below that there are chunks like" +"RStudioは、始めやすいように、例がいくつか入れられてある文書を作成します。\n" +"以下のような「チャンク(chunk)」がすでにあるかと思います:" # inline html #: r-novice-gapminder/_episodes/15-knitr-markdown.md:99 @@ -19480,8 +19321,8 @@ msgid "" "These are chunks of R code that will be executed by knitr and replaced\n" "by their results. More on this later." msgstr "" -"These are chunks of R code that will be executed by knitr and replaced\n" -"by their results. More on this later." +"これらはRコードの「チャンク」(塊)で、knitrによってコードが実行され、結果に置き換えられます。\n" +"また後ほど、詳しくお伝えします。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:108 msgid "" @@ -19489,9 +19330,8 @@ msgid "" "well as the double-asterisks in `**Knit**`. This is\n" "[Markdown](http://daringfireball.net/projects/markdown/syntax)." msgstr "" -"Also note the web address that's put between angle brackets (`< >`) as\n" -"well as the double-asterisks in `**Knit**`. This is\n" -"[Markdown](http://daringfireball.net/projects/markdown/syntax)." +"`**Knit**` の中にある、二重アスタリスクとかぎ括弧( `< >` )の間に置かれているウェブアドレスが\n" +"あるのが分かるでしょうか。これが、[Markdown](http://daringfireball.net/projects/markdown/syntax)なのです。" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:112 @@ -19505,18 +19345,15 @@ msgid "" "text gets _converted_ to html, replacing the marks with the proper\n" "html code." msgstr "" -"Markdown is a system for writing web pages by marking up the text much\n" -"as you would in an email rather than writing html code. The marked-up\n" -"text gets _converted_ to html, replacing the marks with the proper\n" -"html code." +"Markdownは、メールを書くような感覚でテキストに印をつけていきながら、htmlコードを使わずに\n" +"ウェブページを書くための言語です。印がつけられた(marked-up)\n" +"テキストは、マークが指し示す正しいhtmlコードに置き換えられながら、htmlに _変換_ されます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:119 msgid "" "For now, let's delete all of the stuff that's there and write a bit of\n" "markdown." -msgstr "" -"For now, let's delete all of the stuff that's there and write a bit of\n" -"markdown." +msgstr "とりあえず、ここにあるものを全部消して、少しMarkdownを書いてみましょう。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:122 msgid "" @@ -19524,17 +19361,14 @@ msgid "" "and you make things _italics_ by using underscores, like this:\n" "`_italics_`." msgstr "" -"You make things **bold** using two asterisks, like this: `**bold**`,\n" -"and you make things _italics_ by using underscores, like this:\n" -"`_italics_`." +"二重アスタリスクを使って、 **太字** に(例 `**bold**`)、\n" +"下線を使って、 _斜体_ にすることができます(例 `_italics_`)。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:126 msgid "" "You can make a bulleted list by writing a list with hyphens or\n" "asterisks, like this:" -msgstr "" -"You can make a bulleted list by writing a list with hyphens or\n" -"asterisks, like this:" +msgstr "ハイフンやアスタリスクを使って、箇条書きを書くこともできます。例えば:" # code block #: r-novice-gapminder/_episodes/15-knitr-markdown.md:129 @@ -19546,14 +19380,14 @@ msgid "" "```" msgstr "" "```\n" -"* bold with double-asterisks\n" -"* italics with underscores\n" -"* code-type font with backticks\n" +"* 太字は、二重アスタリスクで\n" +"* 斜体は、下線で\n" +"* コードタイプのフォントは括弧で\n" "```" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:135 msgid "or like this:" -msgstr "or like this:" +msgstr "または、このように:" # code block #: r-novice-gapminder/_episodes/15-knitr-markdown.md:137 @@ -19565,41 +19399,41 @@ msgid "" "```" msgstr "" "```\n" -"- bold with double-asterisks\n" -"- italics with underscores\n" -"- code-type font with backticks\n" +"- 太字は、二重アスタリスクで\n" +"- 斜体は、下線で\n" +"- コードタイプのフォントは括弧で\n" "```" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:143 msgid "Each will appear as:" -msgstr "Each will appear as:" +msgstr "それぞれ、以下の形で表示されます:" # unordered list #: r-novice-gapminder/_episodes/15-knitr-markdown.md:145 msgid "- bold with double-asterisks" -msgstr "- bold with double-asterisks" +msgstr "- 太字は、二重アスタリスクで" # unordered list #: r-novice-gapminder/_episodes/15-knitr-markdown.md:146 msgid "- italics with underscores" -msgstr "- italics with underscores" +msgstr "- 斜体は、下線で" # unordered list #: r-novice-gapminder/_episodes/15-knitr-markdown.md:147 msgid "- code-type font with backticks" -msgstr "- code-type font with backticks" +msgstr "- コードタイプのフォントは括弧で" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:149 msgid "(I prefer hyphens over asterisks, myself.)" -msgstr "(I prefer hyphens over asterisks, myself.)" +msgstr "(私はハイフンよりもアスタリスクの方が好きですが)" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:151 msgid "" "You can make a numbered list by just using numbers. You can use the\n" "same number over and over if you want:" msgstr "" -"You can make a numbered list by just using numbers. You can use the\n" -"same number over and over if you want:" +"数字を使って番号付きリストを作ることもできます。\n" +"同じ番号を何度でも好きなだけ使えます:" # code block #: r-novice-gapminder/_episodes/15-knitr-markdown.md:154 @@ -19611,37 +19445,35 @@ msgid "" "```" msgstr "" "```\n" -"1. bold with double-asterisks\n" -"1. italics with underscores\n" -"1. code-type font with backticks\n" +"1. 太字は、二重アスタリスクで\n" +"1. 斜体は、下線で\n" +"1. コードタイプのフォントは括弧で\n" "```" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:160 msgid "This will appear as:" -msgstr "This will appear as:" +msgstr "これは、次のように表示されます:" # ordered list #: r-novice-gapminder/_episodes/15-knitr-markdown.md:162 msgid "1. bold with double-asterisks" -msgstr "1. bold with double-asterisks" +msgstr "1. 太字は、二重アスタリスクで" # ordered list #: r-novice-gapminder/_episodes/15-knitr-markdown.md:163 msgid "1. italics with underscores" -msgstr "1. italics with underscores" +msgstr "1. 斜体は、下線で" # ordered list #: r-novice-gapminder/_episodes/15-knitr-markdown.md:164 msgid "1. code-type font with backticks" -msgstr "1. code-type font with backticks" +msgstr "1. コードタイプのフォントは括弧で" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:166 msgid "" "You can make section headers of different sizes by initiating a line\n" "with some number of `#` symbols:" -msgstr "" -"You can make section headers of different sizes by initiating a line\n" -"with some number of `#` symbols:" +msgstr "行の頭に `#` 印を好きな数つけることで、色々なサイズの文節の題名を作ることができます:" # code block #: r-novice-gapminder/_episodes/15-knitr-markdown.md:169 @@ -19654,10 +19486,10 @@ msgid "" "```" msgstr "" "```\n" -"# Title\n" -"## Main section\n" -"### Sub-section\n" -"#### Sub-sub section\n" +"# タイトル\n" +"## 主文節\n" +"### 副文節\n" +"#### 更なる副文節\n" "```" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:176 @@ -19668,11 +19500,10 @@ msgid "" "Reference\" (with the Markdown syntax) as well to the RStudio\n" "documentation on R Markdown." msgstr "" -"You _compile_ the R Markdown document to an html webpage by clicking\n" -"the \"Knit HTML\" in the upper-left. And note the little question mark\n" -"next to it; click the question mark and you'll get a \"Markdown Quick\n" -"Reference\" (with the Markdown syntax) as well to the RStudio\n" -"documentation on R Markdown." +"左上にある「Knit HTML」をクリックすることで、R Markdown文書をhtml ウェブサイトへ _コンパイル_ する\n" +"ことができます。その隣に、小さな疑問符があるのが分かると思います。その疑問符をクリックしてみると、\n" +"R MarkdownについてのRStudio文書と、「Markdown Quick Reference」(Markdownのシンタックス付き)\n" +"が出てきます。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/15-knitr-markdown.md:182 @@ -19680,7 +19511,7 @@ msgstr "" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:301 #: r-novice-gapminder/_episodes/15-knitr-markdown.md:329 msgid "> ## Challenge" -msgstr "> ## Challenge" +msgstr "> ## チャレンジ1" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:183 msgid "" @@ -19692,36 +19523,34 @@ msgid "" "> Convert the document to a webpage." msgstr "" ">\n" -"> Create a new R Markdown document. Delete all of the R code chunks\n" -"> and write a bit of Markdown (some sections, some italicized\n" -"> text, and an itemized list).\n" +"> 新しいR Markdown文書を作りましょう。Rコードのチャンクを全て消して、\n" +"> Markdown(いくつかの文節、斜体テキスト、箇条書き)\n" +"> を書いてみましょう。\n" ">\n" -"> Convert the document to a webpage." +"> この文書をウェブサイトにしてみましょう。" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:192 msgid "## A bit more Markdown" -msgstr "## A bit more Markdown" +msgstr "## もうちょっとMarkdownについて" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:194 msgid "" "You can make a hyperlink like this:\n" "`[text to show](http://the-web-page.com)`." msgstr "" -"You can make a hyperlink like this:\n" -"`[text to show](http://the-web-page.com)`." +"次のような、ハイパーリンクを作ることができます:\n" +"`[表示するテキスト](http://the-web-page.com)`." #: r-novice-gapminder/_episodes/15-knitr-markdown.md:197 msgid "You can include an image file like this: `![caption](http://url/for/file)`" -msgstr "You can include an image file like this: `![caption](http://url/for/file)`" +msgstr "このようなイメージを含めることもできます:`![caption](http://url/for/file)`" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:199 msgid "" "You can do subscripts (e.g., F~2~) with `F~2` and superscripts (e.g.,\n" "F^2^) with `F^2^`." -msgstr "" -"You can do subscripts (e.g., F~2~) with `F~2` and superscripts (e.g.,\n" -"F^2^) with `F^2^`." +msgstr "下付き文字 (例 F~2~)は `F~2` で、上付き文字(例 F^2^)は `F^2^` でできます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:202 msgid "" @@ -19730,10 +19559,9 @@ msgid "" "you can use `$ $` and `$$ $$` to insert math equations, like\n" "`$E = mc^2$` and" msgstr "" -"If you know how to write equations in\n" -"[LaTeX](http://www.latex-project.org/), you'll be glad to know that\n" -"you can use `$ $` and `$$ $$` to insert math equations, like\n" -"`$E = mc^2$` and" +"[LaTeX](http://www.latex-project.org/)の等式の書き方を知っていれば、\n" +"`$ $` と `$$ $$` で数式を挿入することができます。\n" +"例えば、 `$E = mc^2$` や、" # code block #: r-novice-gapminder/_episodes/15-knitr-markdown.md:207 @@ -19749,7 +19577,7 @@ msgstr "" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:213 msgid "## R code chunks" -msgstr "## R code chunks" +msgstr "## Rコードの「チャンク(塊)」" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:215 msgid "" @@ -19758,14 +19586,12 @@ msgid "" "processed, the R code will be executed; if they produce figures, the\n" "figures will be inserted in the final document." msgstr "" -"Markdown is interesting and useful, but the real power comes from\n" -"mixing markdown with chunks of R code. This is R Markdown. When\n" -"processed, the R code will be executed; if they produce figures, the\n" -"figures will be inserted in the final document." +"Markdownは役に立つし、興味深くもあるのですが、一番重要な機能は、RコードとMarkdownを組み合わせられることなのです。\n" +"それが、R Markdownです。処理すると、Rコードが実行され、図が作られ、最終的な文書に挿入されます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:220 msgid "The main code chunks look like this:" -msgstr "The main code chunks look like this:" +msgstr "メインのコードチャンクは、こんな感じです:" # inline html #: r-novice-gapminder/_episodes/15-knitr-markdown.md:222 @@ -19790,11 +19616,9 @@ msgid "" "produced, the file names are based on the name of the code chunk that\n" "produced them." msgstr "" -"That is, you place a chunk of R code between ```{r chunk_name}\n" -"and ```. It's a good idea to give each chunk\n" -"a name, as they will help you to fix errors and, if any graphs are\n" -"produced, the file names are based on the name of the code chunk that\n" -"produced them." +"つまり、Rコードを```{r chunk_name}\n" +"と```の間に置くことでコードの「チャンク(chunk・塊)」を作ります。それぞれのチャンクに重複しない名前を付けておくといいでしょう。\n" +"そうすると、エラーを修正するときに役立ちますし、グラフのファイル名は、生成されたコードのチャンクの名前に基づいて付けられるからです。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:235 msgid "" @@ -19806,16 +19630,16 @@ msgid "" "> - Create a plot" msgstr "" ">\n" -"> Add code chunks to\n" +"> 以下を行うコードチャンクを加えましょう\n" ">\n" -"> - Load the ggplot2 package\n" -"> - Read the gapminder data\n" -"> - Create a plot" +"> - ggplot2 パッケージの読み込み\n" +"> - gapminder データの読み込み\n" +"> - プロットの作成" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:243 msgid "## How things get compiled" -msgstr "## How things get compiled" +msgstr "## どうコンパイルされるか" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:245 msgid "" @@ -19825,11 +19649,10 @@ msgid "" "and replaced by both the input and the output; if figures are\n" "produced, links to those figures are included." msgstr "" -"When you press the \"Knit HTML\" button, the R Markdown document is\n" -"processed by [knitr](http://yihui.name/knitr) and a plain Markdown\n" -"document is produced (as well as, potentially, a set of figure files): the R code is executed\n" -"and replaced by both the input and the output; if figures are\n" -"produced, links to those figures are included." +"「Knit HTML」ボタンを押すと、R Markdown文書は[knitr](http://yihui.name/knitr)\n" +"によって処理され、単純なMarkdown文書が(一連の図のファイルと共に)生成されます。\n" +"Rコードは実行され、入力と出力に置き換えられます。図が生成された場合、\n" +"これらの図へのリンクが挿入されます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:251 msgid "" @@ -19837,9 +19660,8 @@ msgid "" "[pandoc](http://pandoc.org/), which converts the Markdown file into an\n" "html file, with the figures embedded." msgstr "" -"The Markdown and figure documents are then processed by the tool\n" -"[pandoc](http://pandoc.org/), which converts the Markdown file into an\n" -"html file, with the figures embedded." +"Markdownと図の文書は、[pandoc](http://pandoc.org/) というツールで処理され、\n" +"Markdownファイルは、図の埋め込まれたhtmlファイルに変換されます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:255 msgid "\"plot" @@ -19848,49 +19670,44 @@ msgstr " code." msgstr "" ">\n" -"> Use chunk options to control the size of a figure and to hide the\n" -"> code." +"> 図の大きさを管理し、コードを隠すチャンクのオプションを使ってみましょう。" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:308 msgid "## Inline R code" -msgstr "## Inline R code" +msgstr "## 文中のRコード" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:310 msgid "" @@ -19976,14 +19793,14 @@ msgid "" "like so: `r round(some_value, 2)`. The code will be\n" "executed and replaced with the _value_ of the result." msgstr "" -"You can make _every_ number in your report reproducible. Use\n" -"`r and ` for an in-line code chunk,\n" -"like so: `r round(some_value, 2)`. The code will be\n" -"executed and replaced with the _value_ of the result." +"報告書にある、_全て_ の数を再現可能なものにすることができます。\n" +"`r` を文中のコードのチャンクに入れてみましょう。\n" +"例えば、 `r round(some_value, 2)`。このコードはコンパイル時に\n" +"実行され、結果の _値_ に置き換えられます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:315 msgid "Don't let these in-line chunks get split across lines." -msgstr "Don't let these in-line chunks get split across lines." +msgstr "この文中のチャンクを、複数の行に分けて入れないようにしましょう。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:317 msgid "" @@ -19991,17 +19808,17 @@ msgid "" "calculations and defines things, with `include=FALSE` for that larger\n" "chunk (which is the same as `echo=FALSE` and `results=\"hide\"`)." msgstr "" -"Perhaps precede the paragraph with a larger code chunk that does\n" -"calculations and defines things, with `include=FALSE` for that larger\n" -"chunk (which is the same as `echo=FALSE` and `results=\"hide\"`)." +"こういう場合は、パラグラフの前に`include=FALSE`\n" +"( `echo=FALSE` と `results=\"hide\"` の組み合わせと同じ)のオプションを設定した、\n" +"定義や演算を行うコードチャンクを作っておきましょう。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:321 msgid "" "I'm very particular about rounding in such situations. I may want\n" "`2.0`, but `round(2.03, 1)` will give just `2`." msgstr "" -"I'm very particular about rounding in such situations. I may want\n" -"`2.0`, but `round(2.03, 1)` will give just `2`." +"私は四捨五入に関しては、神経質になりがちです。\n" +"`2.0` が欲しくても、`round(2.03, 1)` ではただの `2` が出てきてしまいます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:324 msgid "" @@ -20010,10 +19827,9 @@ msgid "" "function in my [R/broman](https://github.com/kbroman) package handles\n" "this." msgstr "" -"The\n" -"[`myround`](https://github.com/kbroman/broman/blob/master/R/myround.R)\n" -"function in my [R/broman](https://github.com/kbroman) package handles\n" -"this." +"[R/broman](https://github.com/kbroman)パッケージにある、\n" +"[`myround`](https://github.com/kbroman/broman/blob/master/R/myround.R)関数が、\n" +"この問題に対処してくれます。" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:330 msgid "" @@ -20021,12 +19837,12 @@ msgid "" "> Try out a bit of in-line R code." msgstr "" ">\n" -"> Try out a bit of in-line R code." +"> 文中のRコードを少し試してみましょう。" # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:335 msgid "## Other output options" -msgstr "## Other output options" +msgstr "## その他の出力オプション" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:337 msgid "" @@ -20035,15 +19851,14 @@ msgid "" "menu. Or you could put `pdf_document` or `word_document` in the header\n" "of the file." msgstr "" -"You can also convert R Markdown to a PDF or a Word document. Click the\n" -"little triangle next to the \"Knit HTML\" button to get a drop-down\n" -"menu. Or you could put `pdf_document` or `word_document` in the header\n" -"of the file." +"R MarkdownをPDFやWord文書に変換することもできます。\n" +"ドロップダウンメニューを表示させるために、「Knit HTML」の横にある小さい三角をクリックしましょう。\n" +"または、 `pdf_document` や `word_document` をファイルの最初のヘッダー(header)に入れておくこともできます。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/15-knitr-markdown.md:342 msgid "> ## Tip: Creating PDF documents" -msgstr "> ## Tip: Creating PDF documents" +msgstr "> ## ヒント:PDFドキュメントの作成" #: r-novice-gapminder/_episodes/15-knitr-markdown.md:343 msgid "" @@ -20055,16 +19870,16 @@ msgid "" "> - [TeX installers for macOS](https://tug.org/mactex)." msgstr "" ">\n" -"> Creating .pdf documents may require installation of some extra software. If\n" -"> required this is detailed in an error message.\n" +"> `.pdf` 文書を作成するためには、いくつかソフトウェアをインストールしなければいけないかもしれません。\n" +"> これらのソフトが必要な場合は、エラーメッセージの中に詳細が述べられています。\n" ">\n" -"> - [TeX installers for Windows](https://miktex.org/2.9/setup).\n" -"> - [TeX installers for macOS](https://tug.org/mactex)." +"> - [Windows向けのTeXインストーラー](https://miktex.org/2.9/setup).\n" +"> - [macOS向けのTeXインストーラー](https://tug.org/mactex)." # header #: r-novice-gapminder/_episodes/15-knitr-markdown.md:352 msgid "## Resources" -msgstr "## Resources" +msgstr "## 資料" # unordered list #: r-novice-gapminder/_episodes/15-knitr-markdown.md:354 @@ -20154,16 +19969,16 @@ msgstr "" # header #: r-novice-gapminder/_episodes/16-wrap-up.md:22 msgid "## Structure your project folder" -msgstr "## Structure your project folder" +msgstr "## プロジェクトフォルダーを構造化する" #: r-novice-gapminder/_episodes/16-wrap-up.md:24 msgid "Keep your project folder structured, organized and tidy, by creating subfolders for your code files, manuals, data, binaries, output plots, etc. It can be done completely manually, or with the help of RStudio's `New Project` functionality, or a desginated package, such as `ProjectTemplate`." -msgstr "Keep your project folder structured, organized and tidy, by creating subfolders for your code files, manuals, data, binaries, output plots, etc. It can be done completely manually, or with the help of RStudio's `New Project` functionality, or a desginated package, such as `ProjectTemplate`." +msgstr "プロジェクトフォルダーを、コードファイル、マニュアル、データ、バイナリー、プロットの出力などのサブフォルダーを作ることで、構造化し、整理し、片づけておきましょう。全部手作業でできますが、RStudioの `New Project` 機能、または、`ProjectTemplate` のように、その目的で作られたパッケージの助けを借りることもできます。" # blockquote, which can be cascaded #: r-novice-gapminder/_episodes/16-wrap-up.md:26 msgid "> ## Tip: ProjectTemplate - a possible solution" -msgstr "> ## Tip: ProjectTemplate - a possible solution" +msgstr "> ## ヒント:解決策の一つ:ProjectTemplate" #: r-novice-gapminder/_episodes/16-wrap-up.md:27 msgid "" @@ -20189,15 +20004,14 @@ msgid "" "> home page [ProjectTemplate](http://projecttemplate.net/index.html)" msgstr "" ">\n" -"> One way to automate the management of projects is to install the third-party package, `ProjectTemplate`.\n" -"> This package will set up an ideal directory structure for project management.\n" -"> This is very useful as it enables you to have your analysis pipeline/workflow organised and structured.\n" -"> Together with the default RStudio project functionality and Git you will be able to keep track of your\n" -"> work as well as be able to share your work with collaborators.\n" +"> プロジェクトの管理を自動化する方法のひとつは、第三者パッケージである `ProjectTemplate` をインストールすることです。\n" +"> このパッケージは、プロジェクト管理に理想的なディレクトリ構造を作成します。\n" +"> 自分の分析パイプライン(またはワークフロー)が整理、構造化されるので、これはとても役に立ちます。\n" +"> RStudioのデフォルトプロジェクト機能とGitと組み合わせれば、自分の作業の履歴を保存し、他の共同作業者とシェアすることもできます。\n" ">\n" -"> 1. Install `ProjectTemplate`.\n" -"> 2. Load the library\n" -"> 3. Initialise the project:\n" +"> 1. `ProjectTemplate` をダウンロードする\n" +"> 2. ライブラリを読み込む\n" +"> 3. プロジェクトを開始する:\n" ">\n" "> \n" "> ```r\n" @@ -20206,13 +20020,13 @@ msgstr "" "> create.project(\"../my_project\", merge.strategy = \"allow.non.conflict\")\n" "> ```\n" ">\n" -"> For more information on ProjectTemplate and its functionality visit the\n" -"> home page [ProjectTemplate](http://projecttemplate.net/index.html)" +"> ProjectTemplate及びその機能についての更なる情報は、\n" +"> 次のホームページから入手可能です: [ProjectTemplate](http://projecttemplate.net/index.html)" # header #: r-novice-gapminder/_episodes/16-wrap-up.md:50 msgid "## Make code readable" -msgstr "## Make code readable" +msgstr "## コードを読めるようにする" #: r-novice-gapminder/_episodes/16-wrap-up.md:52 msgid "" @@ -20221,15 +20035,15 @@ msgid "" "what it does: more often than not this someone will be you 6 months down the line,\n" "who will otherwise be cursing past-self." msgstr "" -"The most important part of writing code is making it readable and understandable.\n" -"You want someone else to be able to pick up your code and be able to understand\n" -"what it does: more often than not this someone will be you 6 months down the line,\n" -"who will otherwise be cursing past-self." +"コードを書く際に一番重要なのが、読みやすくて理解のしやすくすることです。\n" +"他の誰が自分のコードを取り上げ、何をするものかを理解してもらわなければなりません。\n" +"多くの場合、この誰かさんは、6か月後の自分なので、もしコードが読めない、\n" +"理解できない場合は、昔の自分に悪態をつくことになるでしょう。" # header #: r-novice-gapminder/_episodes/16-wrap-up.md:57 msgid "## Documentation: tell us what and why, not how" -msgstr "## Documentation: tell us what and why, not how" +msgstr "## 文書化:「どうやって」ではなく「なぜ」を伝えて下さい" #: r-novice-gapminder/_episodes/16-wrap-up.md:59 msgid "" @@ -20241,18 +20055,16 @@ msgid "" "that is. The *how* can come after that: it's an implementation detail you ideally\n" "shouldn't have to worry about." msgstr "" -"When you first start out, your comments will often describe what a command does,\n" -"since you're still learning yourself and it can help to clarify concepts and\n" -"remind you later. However, these comments aren't particularly useful later on\n" -"when you don't remember what problem your code is trying to solve. Try to also\n" -"include comments that tell you *why* you're solving a problem, and *what* problem\n" -"that is. The *how* can come after that: it's an implementation detail you ideally\n" -"shouldn't have to worry about." +"初めのころは、コメントにそのコマンドが何をするかを記したものが多いはずです。\n" +"なぜならば、学び始めたばかりで、概念をはっきりさせるのに役立ち、後で思い出せるからです。\n" +"しかしながら、後々、それらのコメントは、コードがどんな問題を解決しようとしていたのかを思い出そうと\n" +"する際には役に立ちません。 自分は*何* の問題を、 *なぜ* 解こうとしているのかを、コメントに含めるようにしましょう。\n" +"*どうやって* 問題を解いたのかについては、その後の話です。導入の詳細は、理想的にはそこまで心配する必要はありません。" # header #: r-novice-gapminder/_episodes/16-wrap-up.md:67 msgid "## Keep your code modular" -msgstr "## Keep your code modular" +msgstr "## コードをモジュール化しましょう" #: r-novice-gapminder/_episodes/16-wrap-up.md:69 msgid "" @@ -20263,17 +20075,16 @@ msgid "" "loaded into any analysis script in your project. It also lets you group related\n" "functions together easily." msgstr "" -"Our recommendation is that you should separate your functions from your analysis\n" -"scripts, and store them in a separate file that you `source` when you open the R\n" -"session in your project. This approach is nice because it leaves you with an\n" -"uncluttered analysis script, and a repository of useful functions that can be\n" -"loaded into any analysis script in your project. It also lets you group related\n" -"functions together easily." +"関数を分析スクリプトと分けて、別のファイルに保存しておき、\n" +"プロジェクトでRのセッションを開いたときに、 `source` することをオススメします。\n" +"このアプローチを取ると、分析スクリプトに無駄がなくなり、プロジェクト内のどの分析スクリプトでも\n" +"使える関数をストックする場所ができるので、便利です。\n" +"また、同じような関数をまとめるのが簡単になります。" # header #: r-novice-gapminder/_episodes/16-wrap-up.md:76 msgid "## Break down problem into bite size pieces" -msgstr "## Break down problem into bite size pieces" +msgstr "## 問題をひとくち大に分ける" #: r-novice-gapminder/_episodes/16-wrap-up.md:78 msgid "" @@ -20283,25 +20094,25 @@ msgid "" "keep breaking down the problem into smaller and smaller functions until you\n" "reach a point where you can code a solution, and build back up from there." msgstr "" -"When you first start out, problem solving and function writing can be daunting\n" -"tasks, and hard to separate from code inexperience. Try to break down your\n" -"problem into digestible chunks and worry about the implementation details later:\n" -"keep breaking down the problem into smaller and smaller functions until you\n" -"reach a point where you can code a solution, and build back up from there." +"初めは、問題解決と関数の記述は気が滅入るタスクで、\n" +"コードの経験不足とは別の問題として分けることができないと思うかもしれません。問題を消化できる塊に分け、\n" +"導入の詳細についての心配は後回しにしましょう:\n" +"問題をコードで解決できるまで、どんどん小さい関数に分けていきしましょう。\n" +"そして、解決されたものを積み上げていけば、問題を解決できるでしょう。" # header #: r-novice-gapminder/_episodes/16-wrap-up.md:84 msgid "## Know that your code is doing the right thing" -msgstr "## Know that your code is doing the right thing" +msgstr "## コードが正しいことをしているか確かめましょう" #: r-novice-gapminder/_episodes/16-wrap-up.md:86 msgid "Make sure to test your functions!" -msgstr "Make sure to test your functions!" +msgstr "関数をテストすることを、くれぐれも忘れないように!" # header #: r-novice-gapminder/_episodes/16-wrap-up.md:88 msgid "## Don't repeat yourself" -msgstr "## Don't repeat yourself" +msgstr "## 同じことを繰り返さないようにしましょう" #: r-novice-gapminder/_episodes/16-wrap-up.md:90 msgid "" @@ -20309,9 +20120,8 @@ msgid "" "lines of code through your project, those are usually candidates for being\n" "moved into functions." msgstr "" -"Functions enable easy reuse within a project. If you see blocks of similar\n" -"lines of code through your project, those are usually candidates for being\n" -"moved into functions." +"関数は、プロジェクトの中で簡単に再利用できます。もし、プロジェクトで同じようなコードの行の塊を\n" +"見つけたら、それらを関数に移す候補にしましょう。" #: r-novice-gapminder/_episodes/16-wrap-up.md:94 msgid "" @@ -20319,18 +20129,17 @@ msgid "" "project becomes more modular and easier to change. This is especially the case\n" "for which a particular input always gives a particular output." msgstr "" -"If your calculations are performed through a series of functions, then the\n" -"project becomes more modular and easier to change. This is especially the case\n" -"for which a particular input always gives a particular output." +"もし、計算が一連の関数で行われていた場合、プロジェクトはよりモジュール化され、変更するのが簡単になります。\n" +"これは、特定のインプットが必ず特定のアウトプットを返す場合など、特にそうです。" # header #: r-novice-gapminder/_episodes/16-wrap-up.md:98 msgid "## Remember to be stylish" -msgstr "## Remember to be stylish" +msgstr "## 常にスタイリッシュであろうとする" #: r-novice-gapminder/_episodes/16-wrap-up.md:100 msgid "Apply consistent style to your code." -msgstr "Apply consistent style to your code." +msgstr "自分のコードに一貫性のあるスタイルを適用しましょう。" # Front Matter #: r-novice-gapminder/_extras/about.md:1 @@ -21935,37 +21744,37 @@ msgstr "" # header #: r-novice-gapminder/reference.md:187 msgid "## [Vectorization]({{ page.root }}/09-vectorization/)" -msgstr "## [Vectorization]({{ page.root }}/09-vectorization/)" +msgstr "## [ベクトル化]({{ page.root }}/09-vectorization/)" # unordered list #: r-novice-gapminder/reference.md:189 msgid "- Most functions and operations apply to each element of a vector" -msgstr "- Most functions and operations apply to each element of a vector" +msgstr "- ほとんどの関数や演算はベクトルの要素ごとに実行されます。" # unordered list #: r-novice-gapminder/reference.md:190 msgid "- `*` applies element-wise to matrices" -msgstr "- `*` applies element-wise to matrices" +msgstr "- `*` は行列に対して要素ごとに実行されます。" # unordered list #: r-novice-gapminder/reference.md:191 msgid "- `%*%` for true matrix multiplication" -msgstr "- `%*%` for true matrix multiplication" +msgstr "- 本来の行列の積を求めるには `%*%` を使います。" # unordered list #: r-novice-gapminder/reference.md:192 msgid "- `any()` will return `TRUE` if any element of a vector is `TRUE`" -msgstr "- `any()` will return `TRUE` if any element of a vector is `TRUE`" +msgstr "- `any()` はベクトルの要素の中に一つでも `TRUE` があれば `TRUE` を返します。" # unordered list #: r-novice-gapminder/reference.md:193 msgid "- `all()` will return `TRUE` if *all* elements of a vector are `TRUE`" -msgstr "- `all()` will return `TRUE` if *all* elements of a vector are `TRUE`" +msgstr "- `all()` はベクトルの要素が*全て* `TRUE` であれば `TRUE` を返します。" # header #: r-novice-gapminder/reference.md:195 msgid "## [Functions explained]({{ page.root }}/10-functions/)" -msgstr "## [Functions explained]({{ page.root }}/10-functions/)" +msgstr "## [関数について]({{ page.root }}/10-functions/)" # unordered list #: r-novice-gapminder/reference.md:197 @@ -21975,7 +21784,7 @@ msgstr " - `?\"function\"`" # unordered list #: r-novice-gapminder/reference.md:198 msgid " - Put code whose parameters change frequently in a function, then call it with" -msgstr " - Put code whose parameters change frequently in a function, then call it with" +msgstr " - 何度もパラメータを変えながら実行するコードを関数にし、" #: r-novice-gapminder/reference.md:199 msgid "" @@ -21984,10 +21793,10 @@ msgid "" " - Any code written in the body of the function will preferably look for variables defined inside the function.\n" " - Document Why, then What, then lastly How (if the code isn't self explanatory)" msgstr "" -" different parameter values to customize its behavior.\n" -" - The last line of a function is returned, or you can use `return` explicitly\n" -" - Any code written in the body of the function will preferably look for variables defined inside the function.\n" -" - Document Why, then What, then lastly How (if the code isn't self explanatory)" +" 作った関数をパラメータの値を変えることで挙動を変更しながら呼び出しましょう。\n" +" - 関数の最終行か、明示的に `return` を用いた部分が返り値になります。\n" +" - 関数の本文中に記述したコードはいずれも、関数内で定義された変数から探し始めます。\n" +" - コードの内容が自明ではない時は、ドキュメントに「なぜ」、次に「何」、そして最後に「どう」を記述しましょう。" # header #: r-novice-gapminder/reference.md:204 diff --git a/po/r-novice-inflammation.ja.po b/po/r-novice-inflammation.ja.po index 4ef42953..1cbd2927 100644 --- a/po/r-novice-inflammation.ja.po +++ b/po/r-novice-inflammation.ja.po @@ -1,7 +1,7 @@ # Japanese translation of the Software Carpentry Programming with R Lesson -# Copyright (C) 2018 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. -# Software-Carpentry Japanese-Team , 2018. +# Software-Carpentry Japanese-Team , 2019. # msgid "" msgstr "" diff --git a/po/shell-novice.ja.po b/po/shell-novice.ja.po index b0bf2e93..a97cd43e 100644 --- a/po/shell-novice.ja.po +++ b/po/shell-novice.ja.po @@ -1,7 +1,7 @@ # Japanese translation of the Software Carpentry Unix Shell Lesson -# Copyright (C) 2018 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. -# Software-Carpentry Japanese-Team , 2018. +# Software-Carpentry Japanese-Team , 2019. # msgid "" msgstr "" diff --git a/po/sql-novice-survey.ja.po b/po/sql-novice-survey.ja.po index d610d079..96fe8188 100644 --- a/po/sql-novice-survey.ja.po +++ b/po/sql-novice-survey.ja.po @@ -1,7 +1,7 @@ # Japanese translation of the Software Carpentry Using Databases and SQL Lesson -# Copyright (C) 2018 Software Carpentry Foundation; Japanese Translation Team +# Copyright (C) 2019 Software Carpentry Foundation; Japanese Translation Team # This file is distributed under the same license as the PACKAGE package. -# Software-Carpentry Japanese-Team , 2018. +# Software-Carpentry Japanese-Team , 2019. # msgid "" msgstr "" diff --git a/quickstart.md b/quickstart.md index e5968066..47c88a62 100644 --- a/quickstart.md +++ b/quickstart.md @@ -18,20 +18,85 @@ git clone git@github.com:/i18n.git ``` 4. Add remote so you can pull changes from original repo: ``` -git remote add ja git@github.com:swcarpentry-ja/i18n.git +git remote add upstream git@github.com:swcarpentry-ja/i18n.git ``` 5. Make changes to your local repo - make sure to commit often: ``` git add -u git commit -m "" ``` -6. When you're ready to submit changes, pull all the changes from the `swcarpentry-ja` repo and push to **your** remote: +6. When you're ready to submit changes, first pull all the changes from the `swcarpentry-ja` repo: ``` -git pull ja ja -git pull # This is to pull changes from your remote -git push # This is to push changes to your remote +git pull upstream ja +``` +7. Fix any conflicts that arise when pulling and merging changes from the `swcarpentry-ja` repo. +8. Now push your changes to your remote repo : +``` +git push +``` +9. In GitHub, submit a Pull Request with your changes to the `swcarpentry-ja` repo. +10. When additional changes are requested, repeat steps 5 and 8 in your repo - Pull Request will be updated automatically: +``` +git add -u +git commit -m "" +git pull +git push +``` + +## Tips and recommendations for a better workflow (intermediate Git user) + +These are some tips and recommendations to make your workflow more smooth and easier for you to work on multiple edits. +If you intend to follow these steps, here are the sequence of steps to follow (in order): + +* Steps 1-4 as above +* Step 1 as below +* Step 5 as above +* Step 2 as below, instead of step 6 as above +* Step 7 as above +* Step 3 as below, instead of step 8 as above +* Step 4 as below, instead of step 9 as above +* Step 10 as above + +### Steps + +1. When you are starting a new edit, create a new branch for your edit (separate editing branch will make things easier for Pull Request as well). +Creating a branch will allow you to edit files without messing up changes that are being made on other branches. +``` +git checkout -b -edit + +# Examples: +git checkout -b rikutakei-edit +git checkout -b git-edit2 +git checkout -b readme-edit +``` +2. Use the `--rebase` option when you are pulling from the `swcarpentry-ja` repo. +The `--rebase` option is used to make sure your edit is *in addition* to the changes made in the `swcarpentry-ja` repo, and also allows you to prevent unnecessary merge commits, if possible. +Take a look at this [article](http://kernowsoul.com/blog/2012/06/20/4-ways-to-avoid-merge-commits-in-git/) and this [article](https://codeinthehole.com/tips/pull-requests-and-other-good-practices-for-teams-using-github/) for more explanation. +``` +git pull --rebase upstream ja +``` +3. When you are pushing your editing branch for the first time, make sure to set the upstream of the branch to the same name (note that your editing branch will not be on the remote repo when you made it, so you need to push to your remote **and** create that branch): +``` +# Pushing the editing branch for the first time +git push -u origin + +# Updating for the subsequent changes: +git pull +git push +``` +4. When you are making a Pull Request, use your editing branch for it. +This allows you to edit other files (on a different branch) without adding commits/changes that are not related to your Pull Request. +For example, if you want to work on different files, either create a new branch or move to a different branch: +``` +# List all branches: +git branch + +# Create another branch to edit a different file: +git checkout -b + +# Go to a diferent branch to work on different edits: +git checkout ``` -7. In GitHub, submit a Pull Request to the `swcarpentry-ja` repo ## Guide for Translators diff --git a/quickstart_ja.md b/quickstart_ja.md new file mode 100644 index 00000000..965db9c8 --- /dev/null +++ b/quickstart_ja.md @@ -0,0 +1,125 @@ +# クイックススタート(取説) + +このファイルは、[README](README.md)から必要最低限の情報をまとめたものです。 + +## 始める前に + +* このレポジトリにあるファイルは削除しないようにして下さい +* このプロジェクトに貢献したい場合、このレポジトリをフォーク(コピー)して、プルリクエストにて変更点を提出して下さい +* 問題点・質問などがあれば、イシュー(Issue)を開いて下さい + +## Git の設定、及び貢献の仕方 + +1. Gitの最新バージョンをダウンロード、そしてインストールして下さい +2. 右上にあるフォーク(Fork)ボタンを使って、このレポジトリのコピーを自身のアカウントに作って下さい +3. フォークしたレポジトリを自身のパソコンにダウンロードして下さい(この操作をクローン(clone)と呼びます): +``` +git clone git@github.com:/i18n.git +``` +4. オリジナルのレポジトリをリモート(remote)として追加して下さい: +``` +git remote add upstream git@github.com:swcarpentry-ja/i18n.git +``` +5. 自由にファイルの内容を変更・翻訳して下さい。 +変更点はこまめにコミット(commit)することをお勧めします: +``` +git add -u +git commit -m "" +``` +6. 変更点を提出する準備ができたら、オリジナルのレポジトリから最新のバージョンを「引き入れて」(プル(pull)して)下さい: +``` +git pull upstream ja +``` +7. コンフリクト(conflict;統合不能な変更点のこと)があれば、修正して下さい +8. 変更点を自身のリモートにプッシュ(push)して下さい: +``` +git push +``` +9. 自身のGitHubからプルリクエストを`swcarpentry-ja`へ提出して下さい +10. 新しい変更点を追加する場合は、ステップ5と8を自身のレポジトリで繰り返して下さい - 自動的にプルリクエストの内容が変更されます: +``` +git add -u +git commit -m "" +git pull +git push +``` + +## コツ・オススメのワークフロー(Git 中級者向け) + +Gitを使ったワークフローをより便利にするためのコツを紹介します。 +ここに記載されているコツを使う場合、上記のワークフローを以下のように変更して使って下さい: + +* 上記ステップ1から4 +* 下記ステップ1 +* 上記ステップ5 +* 上記ステップ6の代わりに、下記ステップ2 +* 上記ステップ7 +* 上記ステップ8の代わりに、下記ステップ3 +* 上記ステップ9の代わりに、下記ステップ4 +* 上記ステップ10 + +### ステップ + +1. 新しくファイル内容を変更・翻訳する場合、新しいブランチ(branch;「枝」)を使って下さい。 +新しいブランチを作ることによって、プルリクエストがより楽になり、更に他のブランチにあるファイルの変更点などを気にせずにファイルを編集することができます。 +``` +git checkout -b -edit + +# Examples: +git checkout -b rikutakei-edit +git checkout -b git-edit2 +git checkout -b readme-edit +``` +2. `swcarpentry-ja`のレポジトリからプルする際に、`--rebase`オプションを使って下さい。 +`--rebase`を使うことによって、自身の変更点を`swcarpentry-ja`レポジトリにある変更点の*後に*持ってくることができます。 +これによって、マージ・コミット(merge commit;変更点を統合する時に使われるコミットの事)をできるだけ省くことができます。 +英文ですが、 [こちら](http://kernowsoul.com/blog/2012/06/20/4-ways-to-avoid-merge-commits-in-git/)と[こちら](https://codeinthehole.com/tips/pull-requests-and-other-good-practices-for-teams-using-github/)の記事を参考にして下さい。 +``` +git pull --rebase upstream ja +``` +3. 初めてブランチをリモートにプッシュする際は、ブランチのアップストリーム(upstream;「上流」)を同じ名前に設定することをオススメします(これは、リモートに表示されるブランチ名に反映されるからです)。 +``` +# 初めてリモートにプッシュする際: +git push -u origin + +# それ以降は普通にプッシュ・プルすることが可能です: +git pull +git push +``` +4. プルリクエストを提出する際は、編集していたブランチから変更点を提出して下さい。 +ブランチからプルリクエストを送ることによって、別のブランチで他のファイルを編集してコミットしても、プルリクエストにそのコミットが反映されることがなくなります。 +例えば、別のファイルを編集する場合、新しくブランチを作るか、すでにあるブランチへ移動してからファイルを編集して下さい: +``` +# すでにあるブランチを表示する: +git branch + +# 新しくブランチを作る: +git checkout -b + +# すでにあるブランチに移動する: +git checkout +``` + +## 翻訳者のためのガイド + +### 翻訳ガイドライン + +[翻訳ガイドライン](TranslatorGuidelines.md)を参考に、翻訳内容を統一して下さい。 + +[単語リスト](https://github.com/swcarpentry-ja/i18n/wiki/Glossary-for-technical-terms) +専門用語の翻訳は、統一性を維持するために[単語リスト](https://github.com/swcarpentry-ja/i18n/wiki/Glossary-for-technical-terms)を使ってください。 +記載されていない場合は随時追加して下さい。 + +### 全レッスン共通のファイル + +以下のファイルは全てのレッスンに共通しています: + +``` +CODE_OF_CONDUCT.md +CONTRIBUTING.md +LICENSE.md +README.md +``` + +POファイルの初めにこれらのファイルの内容が記載されていますが、翻訳は無視して、READMEの後にあるレッスン内容を翻訳して下さい。 + diff --git a/rules.md b/rules.md new file mode 100644 index 00000000..5323e7c2 --- /dev/null +++ b/rules.md @@ -0,0 +1,34 @@ +# Rules of conduct + +* Please do not remove the files for other languages (currently Spanish) from the repository. +These need to be retained to merge the lessons with the main i18n repository and existing lessons. + +* Please do not delete the archived files for translation of previous versions of the English lessons. + These will be needed to merge translations with updated English files for future releases of the + main Software Carpentry lessons. This means that we will only need to translate updated sections and + translations to sections that have not been updated will be migrated to new releases. + +* Please only submit changes specific to Japanese language translations to this repository as Pull Requests. + Please submit issues specific to the English lessons to the main lesson repository. If you have a suggestion + for a change to the content or examples, we cannot change these in the Japanese lesson and the main lessons + need to be updated in English. We ask that these changes be raised as an Issue in Japanese rather than a + Pull Request if you prefer not to submit an Issue or Pull Request in English. + +* Please contact us if you wish to join the core translation team. Any contributions to the Japanese lessons + are welcome as Pull Requests but please make sure you understand the English version of the lesson if + you are able to. + +* Please commit and push changes to a fork of the repository on your personal GitHub account and + submit a Pull Request. In this way, suggested changes can be reviewed and discussed. Please raise + any matters that you are unsure of or want help with when submitting a Pull Request. + +* Please track changes to all files needed to generate the translated lessons. This way we can combine + all changes from contributors and track our progress. All contributions will be attributed to each + contributor. + +* Please contact us via an Issue if anything is unclear in the guides to set up or use the + translation tools in this repository so we can update the README and guides. + +* Please commit often and discuss issues on github to ensure that we are not repeating each other. + +* Add your name to the translation team if you wish (unless you want to remain anonymous). diff --git a/updating.md b/updating.md new file mode 100644 index 00000000..830748e4 --- /dev/null +++ b/updating.md @@ -0,0 +1,72 @@ +### Contributing to translation of an updated lesson with a new release of the main English lessons + +If there is an existing (complete) translation of the lesson in your language but + there has a new release of the main English lessons, the new updated version + of the English lessons needs to be merged with the current translated. This way + the sections have not been changed and have already been translated will be migrated + to the new version of the lessons and only the sections that have been changed remain + to be translated. + +1. Create a "Fork" for this repository on your personal GitHub account. (Click "Fork" in the top right + corner of the `https://github.com/swcarpentry-ja/i18n` webpage) + +2. Clone this repository from your personal account (e.g., GitHubUser). This is your local copy to manage your version of + the translation files. + +``` +cd directory +git clone git@github.com:GitHubUser/i18n.git +cd i18n +``` + +If you already have a fork of translation repository, please pull changes for the current + version from the organisation repository: + +``` +git checkout ja +git remote add swc-ja git@github.com:swcarpentry-ja/i18n.git +git pull swc-ja ja +``` + +3. Import the current version of the main English lessons. + +Update the submodule for the lesson that you want to translate + +``` +git submodule add https://github.com/swcarpentry/git-novice.git +``` + +Alternatively, you can update the submodules for every lesson: + +``` +git submodule foreach git pull origin master +``` + +4. Create translation files for the updated version of the lessons + +Run `po4gitbook/update.sh` - That creates/updates the `po` directory with the `.pot` files to use in translations. + +For an update: existing translations will be merged into an updated file. +```bash +cd po +ls git-novice.ja.po +``` + +5. This creates an updated `po` file with updated sections ready to translate. + + + - Edit the file with your favourite po editor ([PoEdit](http://www.poedit.net), + [GTranslator](https://wiki.gnome.org/Apps/Gtranslator), [Lokalize](https://userbase.kde.org/Lokalize), ...) + Note: + - "`Language`" field is needed to add to the header (at least with gtranslator), the rest is put by the tool. + - "`Language-Team:`" needs the first letter in upper case (e.g., `Es`) + - Create `po/LINGUAS` + - Run `po4gitbook/compile.sh` - This creates a `locale//` tree directory + +This generates a translated version of the lessons with your changes. You can add and commit + changes to the PO files and submit changes as a Pull Request on GitHub as described in the + "Guide for Translators". + + Please do not create a git repository within this repository. You can copy these files to another repository + as described in the "Guide for Maintainers and Administrators" and submit changes to translated + lesson repository to update the webpages hosted on GitHub.