text:
# Rmarkdown Word Table

Save Word Document as Markdown file. In this section, we discuss how to add figures and tables into your rmarkdown document, and how to provide captions for them. It does not allow row or cell spanning as well as putting multi-line text in a cell. Markdown se diseñó inicialmente para la creación de páginas web a partir de documentos de texto de forma sencilla y rápida. https://www. A major improvement in the new rmarkdown is the YAML set-up. Use it to embed R code and results into slideshows, pdfs, html documents, Word files and more. Rmarkdown - Introduction and Jalayer Academy 32,697 views. In print media, it usually contains chapter headings and corresponding page numbers for easy navigation. This example below shows you how to render a LaTeX table in HTML document. In this section you learned some additional details for making nice R Markdown reports in a reproducible research project setting, including setting the root directory, adding tables, setting figure and table captions, and using LaTeX commands for formatting details. render_toc() works to enable me to have the toc at any location on my rendered word doc. Methods for tables with rmarkdown. org to learn the basics of markdown formatting. For example, if you read the help page for the rmarkdown::word_document function you should find a keep_md argument. 1 Print tables For prettier tables, I suggest you try apa_table() , which builds on knitr ’s kable() , and printnum() , which can be used to properly round and report numbers. The recently published bookdown package makes it very easy to number and reference tables and figures. title[ # Hello, R Markdown! ]. The cleanest way to submit a manuscript made in RMarkdown is using the LaTeX code that it generates using the YAML switch keep_tex = true. This page demonstrates the syntax for footnotes used in my extension to PHP-Markdown. Users are advised to stick with the default multiline style, but if there is a need to change it either specify style argument when calling pander/pandoc. My post is based on Richard Layton's article Happy collaboration with Rmd to docx which explains how to create a MS Word. text in this directory. Is it possible to do that?. The post may be most useful if the source code and displayed post are viewed side by side. Contents: 1. 以下、rmarkdownとの違いに焦点を当てながら解説します。 (1) htmlファイル生成時のポイント rubyのライブラリ kramdown でhtmlを生成します。pandocと異なる点がいろいろあります。 tableの大枠罫線の付加. Within Rstudio, a document can be written in Rmarkdown, then converted seamlessly to high quality HTML, PDF, or DOCX formats. # ' @title Render flextable in rmarkdown (including Word output) # ' @description Function to use in the rmarkdown's \code{render} chunk option. Using a t-test, I show that surviving birds have lower body length than birds that do not survive. For best results, the reference document should be a modified version of a. Tables with heading spanning over 2 rows are not fully supported in markdown (yet), but the result is getting close to acceptable. org/2015/12/08/R-Web-App-Development-Deployment-Distribution. The default tab separated setting is very useful for pasting straight from Excel or other tabular data sources like SQL editors. githubusercontent. Pandoc feature for tables. R cheatsheet Rmarkdown Reference - Free download as PDF File (. Use it to embed R code and results into slideshows, pdfs, html documents, Word files and more. If I'm outputting to word I just use kable and then I use a word macro that re-formats all the tables in the document. LyX (styled as ; pronounced ) is an open source document processor based on the LaTeX typesetting system. Generate Manual Table of Contents in (R)Markdown Documents - render_toc. These posts are especially useful for researchers who. Open - Open a file that uses the. The problem: producing a Word (. New markdown syntax including expanded support for tables, definition lists, and bibliographies. That style, to me, feels spongy and weird. io Find an R package R language docs Run R in your browser R Notebooks. A good looking table matters! This tutorial is on how to create a neat table in Word by combining knitr and R Markdown. It is a Latex convention to start table references by “tab:”, which no only lets you use the same name for a figure (starting with fig:) and a table, but makes it easier to distinguish between figures and tables. Modern font formats such as TrueType and OpenType contain encoding tables which map code points to the glyphs the font file contains. 1 Paged printing When the df_print option is set to paged , tables are printed as HTML tables with support for pagination over rows and columns. Code Evaluation; Text Results; Code Decoration; Cache; Plots; Animation; Code Chunk; Child Documents; Language Engines; Option templates; Extracting. See the rmarkdown_format for additional details. 以下、rmarkdownとの違いに焦点を当てながら解説します。 (1) htmlファイル生成時のポイント rubyのライブラリ kramdown でhtmlを生成します。pandocと異なる点がいろいろあります。 tableの大枠罫線の付加. (I suppose the the rmarkdown documentation could make that more. For best results, the reference document should be a modified version of a. The process first involves the function render from within package rmarkdown , which feeds the. In side a text chunk, you can use mathematical notation if you surround it by dollar signs $for “inline mathematics” and$\$ for “displayed equations”. Since there are a lot of students who are taking the course at the same time, there will also be a decent number of audience for the blog. CSS is a modern CSS framework with built-in responsiveness. My post is based on Richard Layton's article Happy collaboration with Rmd to docx which explains how to create a MS Word. Both Simple and Grid tables don’t require column headers. What exactly do you mean by this? caption and multirow are LaTeX packages. class: center, middle, inverse, title-slide # RMarkdown Basics ### Haley Jeppson, Sam Tyner ### 2018/06/08 --- class: primary # What do you use to write? - Microsoft Word - LaTeX. Stack Overflow is a great source of answers to common rmarkdown questions. I know there are quite a few templates available, but I was missing one to be used in a corporate environment. Methods for tables with rmarkdown. This formal specification, based on the CommonMark Spec, defines the syntax and semantics of this dialect. Function used to render flextable in knitr/rmarkdown documents. It is a Latex convention to start table references by “tab:”, which no only lets you use the same name for a figure (starting with fig:) and a table, but makes it easier to distinguish between figures and tables. R & RMarkdown, A Short Note. RMarkdown LaTeX ile kaliteli dökümanlar üretebilmenin bedeli, LaTeX’in karmaşık olması ve tıpkı R gibi dik bir öğrenme eğrisinin bulunmasıdır. Cela fonctionne mais j'ai cependant deux petites questions sur RMarkDown avec Word : 1) J'obtiens bien un fichier word avec mes tableaux mais lorsque je veux utiliser des styles de tableau prédéfinis, ils n'apparaissent pas dans les styles de tableau créés. R Markdown Document Templates Overview If there is a particular form of R Markdown document that you or those you work with create frequently, it may make sense to create a re-usable document template for it. 2013/06/20 Define: Analytically. docx) file of a statistical report created in R, with as little overhead as possible. Format for converting from R Markdown to an MS Word document. Acknowledgement. Markdown and Visual Studio Code. R Markdown. You can merge cells, add header rows, add footer rows, change any format and specify how data should be displayed in cells. Same rules applies when you use them in rmarkdown::word_document. Introduction. R Markdown 速查表 详情请查看 rmarkdown. The "paged" method creates a paginated HTML table (note that this method is only valid for formats that produce HTML). Rmarkdown is a type of file (extension ‘. A book created for a 3 hour workshop on rmarkdown. Both Simple and Grid tables don't require column headers. Value A table output element that can be included in a panel. That’s why the rendering method is preferred. Here is what I did. org/yihui/bookdown/output. There are a number of word cloud libraries in R, my favorite being "wordcloud2". Generate reports directly from R scripts. See the rmarkdown website to learn more. an object of class flextable. This is where a packages like condformat and formattable come in handy. Tables content can also contain mixed type of content, text and images. The rmarkdown package (J. results = 'asis' and this will render a nice looking table in your HTML document. I need to use latex instead of other options because the table has to be in a certain format. Here are the different ways by which you can embed tables in your website and their pros and cons. Translate the R Markdown document (that may contain R code) into a Markdown document that no longer depends on R. When I convert HTML table to docx using pandoc (ver 1. Tools like knitr, rmarkdown, and pandoc do the hard work of translating your text files into “production” documents, like beautifully typeset pdfs, smooth presentations, and Word documents that your collaborators can’t live without. Go to the top of the file and change the line output: html_document as follows: Although no HTML coding is required, HTML could optionally be used to format the report. R Markdown is a powerful tool for combining analysis and reporting into the same document. Why use Rmarkdown? Word is far from perfect 先看我们最常用的但也无比糟糕的Word 体积臃肿，功能貌似强大，但很多其实都用不上。每次打开都费很久时间。 最让人崩溃的是非常非常容易崩溃。 版本和格式之间兼容性非常差。 比如MacOS 和Win 之间。. GFM Markdown table syntax is quite simple. As a coauthor/reader, I'd like to see the whole research process (how you arrived to that conclusion), rather than cooked manuscript with inserted tables/figures. I need to use latex instead of other options because the table has to be in a certain format. The "paged" method creates a paginated HTML table (note that this method is only valid for formats that produce HTML). html 문서의 경우 kable()외에도 다양한 함수들을 이용할 수 있는데, 대표적인 것이 rmarkdown::paged_table() 함수와 DT 패키지이다. Previously, I have written a tutorial how to create Table 1 with study characteristics and to export into Microsoft Word. , advanced tables) into word processing documents. There is a ton of customization you can do with RMarkdown, like adding your own CSS to HTML documents, and using your own templates for. How to add table of contents in Rmarkdown? I am using RStudio for writing markdown documents and want to add Table of Contents (TOC) at top of the documents so that the user could click the relevant section for reading. The only exception are. That style, to me, feels spongy and weird. You can automatically handle all the numbering of your sections, figures, and tables with bookdown, as well as automatically generating contents pages, and lists of tables and figures. R cheatsheet Rmarkdown Reference from rstudio. The Word document created by the R code above is available here : R software and ReporteRs package - Word document created from a template Note that, the function docx() can take two arguments : a title argument (title of the document, appearing only in the Word document properties) and a template argument (to specify template file). This is a record of how I turned an Excel sheet into a nicely formatted web-ready schedule using RMarkdown. Rmd extension. render_toc() works to enable me to have the toc at any location on my rendered word doc. I also would like to appreciate the mentorship from Tom Travison and all the efforts from the open source community, which help this package keep getting better. emoji { height: 2em; } Auto guess encoding of files. md file can be compiled and outputted to. If you use the condformat package, you can include the table in an RMarkdown generated PDF or HTML document. toc Add a table of contents at start of document X X X X X X X toc_depth The lowest level of headings to add to table of contents X X X X X X toc_float Float the table of contents to the le" of the main content X html pdf d odt rtf md gituhb ioslides slidy amer Table Suggestions Citations and Bibliographies Several functions format R data into. I just finished my first manuscript written in Rmarkdown 100%. Modern font formats such as TrueType and OpenType contain encoding tables which map code points to the glyphs the font file contains. Click any of the cells to select it, then click the “Table Editor” button on the reading order panel. Unlike most word processors, which follow the WYSIWYG ("what you see is what you get") paradigm, LyX has a WYSIWYM ("what you see is what you mean") approach, where what shows up on the screen roughly depicts the semantic structure of the page and is only an approximation of it. Workflow R Markdown is a format for writing reproducible, dynamic reports with R. Rmd), enabling the use of child documents in bookdown, and vignettes in a tutorials subdirectory, which is reserved for tutorials built with build_tutorials(). Rmarkdown to Word output - insert image above header Tag: r , rmarkdown I have an Rmarkdown document which I'm outputting to Word and I'm trying to insert a company logo to the top of the page, above the header that includes the title and author. Or copy & paste this link into an email or IM:. ) and in JSON-LD, so that search engines can find your data and index the metadata. The solution: combining R+knitr+rmarkdown+pander+pandoc (it is easier than it is spelled). How do I link rmarkdown report with shinyapps to export webapp content in R? I am trying to build a webapp with shiny in R which shows values of different indicators by means of a couple of tables. Knitr chunk options 3. RMarkdown LaTeX ile kaliteli dökümanlar üretebilmenin bedeli, LaTeX’in karmaşık olması ve tıpkı R gibi dik bir öğrenme eğrisinin bulunmasıdır. An alternative online ressource can be found on www. 1 1 There is also a slidedeck that goes along with this handout available here, which is worth looking at if you don't know what you're doing on this page and what to look at. Rmd file to knitr , which executes all of the code chunks and creates a new markdown (. You can schedule reports by scheduling the RMarkdown document like you would any R script. Launch Microsoft Word and create sample document. Workflow R Markdown is a format for writing reproducible, dynamic reports with R. You bring your data, code, and ideas, and R Markdown renders your content into a polished document that can be used to:. Word info: https://earthdatascience. This makes rerunning things a breeze, and can be used to generate dynamic reports. This combination of explanation, code, and results is called literate programming and is a powerful way to share research and data explorations. I used the following Pandoc command for conversion (HTML table to docs) pandoc -f html -t docx -S --mathjax conversion_t. Posts about R written by achyuts. Rmd), enabling the use of child documents in bookdown, and vignettes in a tutorials subdirectory, which is reserved for tutorials built with build_tutorials(). R Markdown is a powerful tool for combining analysis and reporting into the same document. tfoot Adds a table footer (uses the html element). dotm template that includes the macro code I need. The xtable package to produce nice tables in a PDF Again, we find ourselves using the extremely helpful dplyr package to answer this question and to create the underpinnings of our table to display. It combines the core syntax of markdown (an easy-to-write plain text format) with embedded R code chunks that are run so their output can be included in the final document. The plugin also contains a function called RAction which allows you to build ad-hoc commands to R. If you use the condformat package, you can include the table in an RMarkdown generated PDF or HTML document. Its textual content is irrelevant—its Style settings are what you will be using. Creating the base in a text file allows you to focus on the content and not obsess over the details like. rmd) in RStudio and then pressing “knit html” result in two output files (that is,. Function documentation is great if you know the name of the function you need, but it’s useless otherwise. There are a number of word cloud libraries in R, my favorite being "wordcloud2". When writing research papers using Rmarkdown (*. io Find an R package R language docs Run R in your browser R Notebooks. This tutorial is on how to create a neat table in Word by combining knitr and R Markdown. This file shows the basics of using rmarkdown to combine code and output, and generate a Word document. A framework to create bootstrap styled HTML reports from knitr Rmarkdown by Jim Hester (a preview) Creating a Business Dashboard in R by Bart Smeets Carl Boettiger has cool blog posts demonstrating how to publish a post to Wordpress. For example, the code below creates tag and caption combinations for two figures. You can automatically handle all the numbering of your sections, figures, and tables with bookdown, as well as automatically generating contents pages, and lists of tables and figures. 0 Content-Type: multipart/related. Knitr chunk options 3. The goal of kableExtra is to help you build common complex tables and manipulate table styles. Embedding RData files in Rmarkdown files for more reproducible analyses. Save and Knit Word produces this table: The style of the table entries using pander() is the same (Compact) as the style in the earlier table made with kable(). This file shows various options to generate tables in Word documents. Please do not use Word to edit rmarkdown files. If you're finding LaTeX tables a bit confusing, you can also write your table in excel and then upload it to this website: it will make a LaTeX table for you. Markdown Table Generator Paste here from Excel or another delimited source (such as a CSV file) and get a markdown-ready table below. Here is what I did. Data Scientist Jared Lander demonstrates how you can integrate Shiny into RMarkdown with ease. Introduction to R Markdown. GFM Markdown table syntax is quite simple. Fortunately R and RStudio have recently added a number of new features that allow for easy creation of HTML notebooks that are viewed with any web browser. 以下、rmarkdownとの違いに焦点を当てながら解説します。 (1) htmlファイル生成時のポイント rubyのライブラリ kramdown でhtmlを生成します。pandocと異なる点がいろいろあります。 tableの大枠罫線の付加. Methods for tables with rmarkdown. R , RMarkdown_Demo_2. E-books are on the rising. Rmd 文件。 File>NewFile>TextFile确保保存成. It is a Latex convention to start table references by “tab:”, which no only lets you use the same name for a figure (starting with fig:) and a table, but makes it easier to distinguish between figures and tables. 1 What is markdown?. Accepts tab-delimited and comma-delimited text. By becoming a MathJax Friend, organizations show the community that they support the goal of easy-to-use, high-quality mathematics display on the web for everyone, and are contributing in a very concrete way to help MathJax realize that goal. As a coauthor/reader, I'd like to see the whole research process (how you arrived to that conclusion), rather than cooked manuscript with inserted tables/figures. This step is facilitated by the rmarkdown and knitr packages. R Markdown. The output will just be a markdown list, so if you want to give the table of contents it’s own header, you’ll have to include that in the document. md file to pandoc , which will create the final rendered document (e. In what follows, I’ll discuss these different options using data on departing flights from Seattle and Portland in 2014. Contents: 1. The first official book authored by the core R Markdown developers that provides a comprehensive and accurate reference to the R Markdown ecosystem. Since pander aims at rendering R objects into Pandoc’s markdown all four (multiline, simple, grid, rmarkdown) of Pandoc’s formats are supported. I have created an rmarkdown report to do it. Trying to get nice looking tables in Word directly from RMarkdown I found to be a herculean task, but writing a macro isn't too bad and I can use a. I know I can use conditional formatting to shade every other row (or every nth row) of an Excel data table. Drag-and-drop the file below to upload. Until recently, I found that the convertion from LaTex and Rmarkdown to Word is reasonably good, thanks to bookdown by Yihui. If you haven't done so, install the tinytex R package from the console and run install_tinytex() to install TinyTeX (It may take a few minutes to download and compile, ~150MB). Translate the Markdown document into the desired output format (e. Chapter 2 RMarkdown. In research, we usually publish the most important findings in tables and figures. rMarkdown files will typically have the extension. En el documento de Word normal, puedo insertar fácilmente una tabla (5 filas por 2 columnas), y para la imagen solo copie y pegue. R cheatsheet Rmarkdown Reference from rstudio. This page demonstrates the syntax for footnotes used in my extension to PHP-Markdown. The new file can be a finished web page, PDF, MS Word document, slide show, notebook, handout, book, dashboard, package vignette or other format. If you are using R Sweave, beamer, R package vignette template, tufte or some customized rmarkdown A table environment will automatically ﬁnd the best place (it. The recently published bookdown package makes it very easy to number and reference tables and figures. I would like to present a simple table of counts, with column. Limitations of Tables. https://www. My question is, does anyone know of a way to mark certain sections so that they will stay together if there is a page break. A major improvement in the new rmarkdown is the YAML set-up. Hi Ana, welcome! Adding page breaks to word output it's a little tricky, but there is an easy way to do it with the officedown package, see this example. 29 July 2013. Let's assume I'm setup for an rmarkdown document. 我正在使用RStudio来编写markdown文档，并希望在文档顶部添加目录（TOC），以便用户可以单击相关部分进行阅读。关于rpubs有一些相关的例子，但现在我似乎无法找到它们。. Open - Open a file that uses the. Microsoft word tutorial |How to insert images into Outputting Stata Summary and Regression Tables for Excel, Word, or. 0 is used, a raw XML block # ' with the table code will be inserted, otherwise it falls back to inserting. Rmarkdown uses the YAML to setup the call to this function so you can write output: word_document: keep_md: yes for the purpose of looking at the raw markdown after knitr is done processing chunks. Before writing your own Rmarkdown document, use the excellent ressource on commonmark. Microsoft word tutorial |How to insert images into word document table - Duration: 7:11. R ) can be found in the repo you downloaded earlier. Applied Econometrics Name: Student ID: Direction: Download the Rmarkdown file (Assignment2. Exportability. To make a report: i. Estoy tratando de hacer un informe resumido, y tener a esos dos sería bueno. No-Cruft Excel to HTML Table Converter This simple utility allows you to paste data from an Excel spreadsheet (or an HTML table) and convert it to a new HTML table that is free of extraneous formatting. We first look at how to create a table from raw data. Both systems permit me to use a docx document as a template for styles formatting. Grid tables can be created easily using Emacs table mode. 1 Reproducible scientific reports. The problem: producing a Word (. When using knitr and rmarkdown together to create a word document you can use an existing document to style the output. It’s important during research to keep a thorough record of your analysis. And what if someone wants to know exactly how you did your analysis? This process isn't exactly sharable. We will cover all of the important techniques for generating elegant, reproducible documents in a wide variety of formats. Also, I had to use a couple of multi-page tables in my thesis. Please see the package documentation site for how to use this package in LaTeX. One way is to use the Table AutoFormat capabilities of Word. Save Word Document as Markdown file. Function htmltools_value return an HTML version of the flextable, this function is to be used within Shiny applications with renderUI(). Google Docs, LibreOffice Calc, webpage) and paste it into our editor -- click a cell and press Ctrl+V. 2017 Macau S20 Patacas Rooster-Colorized NGC PR70 With COA,Slice Cordless Digital Designer Cut Emboss Draw With Design Card Model 33755,1914 Fr. Le langage R Markdown. packages("knitr") install. DiagrammeR. Open - Open a file that uses the. Launch Microsoft Word and create sample document. En el documento de Word normal, puedo insertar fácilmente una tabla (5 filas por 2 columnas), y para la imagen solo copie y pegue. The version of LaTeX used is a subset of AMS-LaTeX markup, a superset of LaTeX markup which is in turn a superset of TeX markup, for mathematical formulae. Tables in Rmarkdown Word. rmd file (what we're now learning how to build) to package knitr. HTML table attributes. From this file, you can "render" the output in PDF, Word, HTML or many other formats using the rmarkdown package in R. The core components include the R programming language and Markdown , which is a light weight markup language for text creation. Function used to render flextable in knitr/rmarkdown documents. Unfortunately, R Markdown has no “native” method to number and reference table and figure captions. The PDFs, which are produced by TeX/LaTeX, I think, are actually more trouble, for example because LaTeX disregards my order of figures and tables, they are all floating objects and there is no easy way to change this from within the document. 2011-S Silver America the Beautiful - Olympic NP (WA) Quarter PCGS PR70DCAM,1960 90% SILVER PROOF WASHINGTON QUARTER (3G147),2018 P Apostle Islands National Park Quarter Wisconsin. Attaching templates to your documents in Microsoft Word 2010 is performed through the "Word Options" window and is a powerful way to give your document a new appearance in a matter of minutes. class: center, middle, inverse, title-slide # RMarkdown Basics ### Haley Jeppson, Sam Tyner ### 2018/06/08 --- class: primary # What do you use to write? - Microsoft Word - LaTeX. R Studio comes with a built-in text editor, which knows about, and has lots of tools for, working with R Markdown documents. The RStudio community is a friendly place to ask any questions about rmarkdown and the R Markdown family of packages. Any ideas forcing toc onto a fresh page, short of inserting a page break manually after the word doc is rendered?. I do not recommend this. RMarkdown is a framework that provides a literate programming format for data science. (4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and (5) discusses the implications of R Markdown. Tools like knitr, rmarkdown, and pandoc do the hard work of translating your text files into “production” documents, like beautifully typeset pdfs, smooth presentations, and Word documents that your collaborators can’t live without. Files should. [email protected]> Subject: Exported From Confluence MIME-Version: 1. This step is facilitated by the rmarkdown and knitr packages. Both Simple and Grid tables don’t require column headers. org/2015/12/08/R-Web-App-Development-Deployment-Distribution. Go to the top of the file and change the line output: html_document as follows: Although no HTML coding is required, HTML could optionally be used to format the report. R Markdown is a powerful tool for combining analysis and reporting into the same document. If you are using R Sweave, beamer, R package vignette template, tufte or some customized rmarkdown A table environment will automatically ﬁnd the best place (it. docx) files. Use it to embed R code and results into slideshows, pdfs, html documents, Word files and more. io Find an R package R language docs Run R in your browser R Notebooks. Extension: table_captions A caption may optionally be provided with all 4 kinds of tables (as illustrated in the examples below). Save Word Document as Markdown file. render_toc() works to enable me to have the toc at any location on my rendered word doc. This was news to me until this week. MathJax Friends will be listed on the MathJax Sponsors page. markdowntutorial. Possible values are latex, html, markdown, pandoc, and rst; this will be automatically determined if the function is called within knitr; it can also be set in the global option knitr. Contains functions for generating an HTML table with crude and adjusted estimates, plotting hazard ratio, plotting model estimates and confidence intervals using forest plots, extending this to comparing multiple models in a single forest plots. table() which is shortcut to quickly produce a nice FlexTable The second step is to add the created table into the Word document using. I do not recommend this. The Problem. 2013/06/20 Define: Analytically. Images, in particular, are a powerful means of communication in a report, whether they be data visualizations, diagrams, or pictures. The most notable feature of Word documents is the Word template, which is also known as the “style reference document”. This is a book on rmarkdown, aimed for scientists. Reproducible Research Tools for R 1 January 2017 Rmarkdown ( Yihui Xie, 2014) MS Word document, slide show, handout, book, dashboard, package vignette or. com and GitHub Enterprise. Knitr chunk options 3. R markdown resources. This is useful to generate reports (or papers) that contain all the relevant R code to carry out the analysis and allows for automatic updates to the document if either the code or the data change. Word simplifies the chart-creation process. This is a common practice within the wet lab with all researchers keeping a lab book. I was astonished how nice the resulting word file is. The source code is available here as a gist. In RStudio, click the Knit Word button. This is an R Markdown document. Let's assume I'm setup for an rmarkdown document. TF-IDF, Term Frequency-Inverse Document Frequency. RMarkdown is a framework that provides a literate programming format for data science. The new file can be a finished web page, PDF, MS Word document, slide show, notebook, handout, book, dashboard, package vignette or other format. So you have some code, data and a cool result, now it's time to communicate this with your collaborators (or supervisor). Markdown’s goal is to be “ as easy-to-read and easy-to-write as is feasible ”. org/yihui/bookdown/output. What exactly do you mean by this? caption and multirow are LaTeX packages. Posts about R written by achyuts. Introduction. RStudio's knit button renders a file to the first format listed in its output field. Possible values are latex, html, markdown, pandoc, and rst; this will be automatically determined if the function is called within knitr; it can also be set in the global option knitr. Modern font formats such as TrueType and OpenType contain encoding tables which map code points to the glyphs the font file contains. A major improvement in the new rmarkdown is the YAML set-up. It imports the pipe %>% symbol from magrittr and verbalize all the functions, so basically you can add “layers” to a kable output in a way that is similar with ggplot2 and plotly. And an RMarkdown file can be directly exported into multiple formats, including HTML, PDF, Â and Word. df_print to FALSE. In this post, I will present a simple way how to export your regression results (or output) from R into Microsoft Word. docx) file of a statistical report created in R, with as little overhead as possible. You may be new to web design or CSS and have questions about how to center a table on a web page. 50 Updated: 8/14 1. This formal specification, based on the CommonMark Spec, defines the syntax and semantics of this dialect. Grid table doesn't support Left/Center/Right alignment. The problem: producing a Word (. RMarkdown is an excellent tool that is built into RStudio. It's important during research to keep a thorough record of your analysis. RForge strives to provide a colaborative environment for R package developers. Both Simple and Grid tables don't require column headers. Introduction to R Markdown. 1 1 There is also a slidedeck that goes along with this handout available here, which is worth looking at if you don't know what you're doing on this page and what to look at. The source code is available here as a gist. Fortunately R and RStudio have recently added a number of new features that allow for easy creation of HTML notebooks that are viewed with any web browser. Format for converting from R Markdown to an MS Word document. Use it to embed R code and results into slideshows, pdfs, html documents, Word files and more. It provides many options and is a very flexible and powerful platform for authoring HTML, PDF, and MS Word documents, using the Markdown language. 3 uses the 1/1/2016 static CRAN snapshot by default, the fix is as easy as pointing to a more recent version of the package or a more recent repository.

format: plain


text:
###### poj 2443 状态压缩 叉姐的魔法训练

Set Operation
 Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 3162 Accepted: 1284

Description

You are given N sets, the i-th set (represent by S(i)) have C(i) element (Here "set" isn't entirely the same as the "set" defined in mathematics, and a set may contain two same element). Every element in a set is represented by a positive number from 1 to 10000. Now there are some queries need to answer. A query is to determine whether two given elements i and j belong to at least one set at the same time. In another word, you should determine if there exist a number k (1 <= k <= N) such that element i belongs to S(k) and element j also belong to S(k).

Input

First line of input contains an integer N (1 <= N <= 1000), which represents the amount of sets. Then follow N lines. Each starts with a number C(i) (1 <= C(i) <= 10000), and then C(i) numbers, which are separated with a space, follow to give the element in the set (these C(i) numbers needn't be different from each other). The N + 2 line contains a number Q (1 <= Q <= 200000), representing the number of queries. Then follow Q lines. Each contains a pair of number i and j (1 <= i, j <= 10000, and i may equal to j), which describe the elements need to be answer.

Output

For each query, in a single line, if there exist such a number k, print "Yes"; otherwise print "No".

Sample Input

3
3 1 2 3
3 1 2 5
1 10
4
1 3
1 5
3 5
1 10

Sample Output

Yes
Yes
No
No

1000个集合，每个集合最多有10000个数字，查询a b 是否同时在某一个集合中

int a[40][10010]       每一个列1000个数压缩成32个整数，这32个整数里面每个数字的每一个位表示一行

x=i/32,y=i%32;
//x表示集合i在整数x里面的二进制位里面，y表示在集合i在整数x里面的1<<y位中
a[x][temp]|=(1<<y)

if(a[i][num_1]&a[i][num_2])

#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;

int a[40][10010];

int main()
{
int x,y;
int n,m,t,temp;
//freopen("in.txt","r",stdin);
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&t);
x=i/32,y=i%32;
for(int j=0;j<t;j++){
scanf("%d",&temp);
a[x][temp]|=(1<<y);
}
}

n=n/32+1;
scanf("%d",&m);
int num_1,num_2;
while(m--)
{
int flag=1;
scanf("%d%d",&num_1,&num_2);
for(int i=0;i<n;i++){
if(a[i][num_1]&a[i][num_2]){
flag=0;
puts("Yes");
break;
}
}

if(flag)
puts("No");
}

return 0;
}

#### 【training】"叉姐的魔法训练"

2015-02-21 19:15:48

#### 叉姐的训练指南

2015-01-19 14:40:30

#### 数据结构讲义-叉姐(交大郭晓旭)

2015年08月12日 450KB 下载

#### 叉姐的魔法训练小结（未完结）

2015-11-04 20:17:03

#### 叉姐的魔法训练（第五课）---- 如何成为一名合格的小学生

2013-10-03 20:37:31

#### 叉姐的魔法训练（第一课）---- 初级魔法练习

2013-10-01 16:37:31

#### 叉姐的魔法训练（第十三课）---- 无法成为勇者的我，无可奈何决定去打工

2013-10-09 20:22:16

#### 叉姐的魔法训练（第二课）---- 冰系魔法入门

2013-10-01 21:27:13

#### 叉姐200题

2017-10-13 10:29:44

#### 叉姐的魔法训练（第十二课）---- 想不出名字了呜

2013-10-08 20:01:36

## 不良信息举报

poj 2443 状态压缩 叉姐的魔法训练


text:
A batched-softmax wrapper to mask the probabilities of padding.

For instance there may be a batch of instances where A is padding.

XXXXAA
XXAAAA
XXXXXX

MaskedSoftmax ensures that no probability is given to the A's.

For this example, sourceSizes is {4, 2, 6} and sourceLength is 6.

• sourceSizes - the true lengths (with left padding).
• sourceLength - the length of the batch.


text:
# Mouse Speed in GLUT and OpenGL?

I would like to simulate a point that moves in 2D. The input should be the speed of the mouse, so the new position will be computed as following

new_position = old_position + delta_time*mouse_velocity

As far as I know in GLUT there is no function to acquire the current speed of the mouse between each frame. What I've done so far to compute the delta_time as following

void Display()
{

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0f, 0.0f, 0.0f);
static int delta_t, current_t, previous_t;
current_t = glutGet(GLUT_ELAPSED_TIME);
delta_t = current_t - previous_t;
std::cout << delta_t << std::endl;

previous_t = current_t;
glutSwapBuffers();
}

Where should I start from here? (Note: I have to get the speed of the mouse because I'm modeling a system)

Edit: Based on the above code, delta_time fluctuates so much

34
19
2
20
1
20
0
16
1
1
10
21
0
13
1
19
34
0
13
0
6
1
14

Why does this happen?

You're right in that you'll need the time delta between the current and previous frame. You also need to store current and previous positions of the mouse, and this happens to be pretty easy with GLUT.

int px = 0;
int py = 0;

void MouseMotion( int x, int y )
{
int dx = x - px;
int dy = y - py;

// Do something with dx and dy
// ...

px = x;
py = y;
}

void PassiveMouseMotion( int x, int y )
{
px = x;
py = y;
}

int main( void )
{
// ...

glutMotionFunc( MouseMotion );
glutPassiveMotionFunc( PassiveMouseMotion );

glutMainLoop( );
}

px and py are the x and y locations (in pixels) of the mouse. The origin should be top left of the screen with y pointing down and x pointing to the right (IIRC).

Note that changes in the mouse position (dx and dy) are only recorded in my example code when a mouse button is held down. I am sure you can modify this to your specific needs.

• x pointing to the right and y pointing down. :) – Casey Feb 19 '14 at 23:40
• @RandyGaul, in this case, the velocity will be the output of the system. My goal is to compute the new position based on the velocity but not the vice versa. – CroCo Feb 20 '14 at 2:25
• Also, based on my code, this is what I'm getting, for delta_time 34 19 2 20 1 20 0 16 1 1 10 21 0 13 1 19 34 0 13 0 6 1 14 Why the delta_time fluctuates? – CroCo Feb 20 '14 at 2:27
• @CroCo I don't know how you expect to compute the position of the mouse based on its velocity if user input decides where the mouse will be. – RandyGaul Feb 20 '14 at 5:13
• @RandyGaul, I know it is silly since I have position and time, however, I want to go around by computing the position after calculating the velocity (which is computed by previous position). I did that though, but I'm still facing some problems to get work properly. – CroCo Feb 21 '14 at 1:11


text:
# Case study: Parkinson’s Disease A 65-year-old patient with a 2-year history of PD has been experiencing...

###### Question:

Case study: Parkinson’s Disease A 65-year-old patient with a 2-year history of PD has been experiencing an increase in symptoms, especially muscle tremors and rigidity. The patient has been taking carbidopa–levodopa (Sinemet CR) and selegiline since diagnosis. The physician has chosen to add benztropine to the patient’s medication regimen. The nurse is administering the first dose of benztropine and intends to provide patient teaching about the drug and its adverse effects. OTHER PERTINENT INFORMATION: Temperature - 98.6 degrees Fahrenheit Weight - 80 kg Height - 6 feet & 1 inch tall 1. What adverse effects are associated with benztropine? 2. Given the effect, the medication has on the pupils, what condition if present in the patient would cause concern? 3. An indication that the addition of benztropine is effective in this patient would be relief of which PD symptom? 4. Doctors order: 400mg of Levodopa OD PO and you only have 100mg tablets of Levodopa on hand. How many tablets would you administer to the patient? 5. Convert temperature into Celsius, his weight into pounds, and his height into centimeters. 6. What is the best pharmacological intervention to treat dyskinesias?

#### Similar Solved Questions

##### Compute b) Describe the type of information that an as-built schedule can provide to a firm...
Compute b) Describe the type of information that an as-built schedule can provide to a firm that might n. otherwise be obtained as puut ncclule shows things that man caured delay previously that can now he avided" c) What is the role of as-built schedules in litigation involving delays? shows wh...
##### 1. Questions: Prepare Adjusted Tri-balance for the following Items Amount 2152 3000 1200 Salaries Payable Account...
1. Questions: Prepare Adjusted Tri-balance for the following Items Amount 2152 3000 1200 Salaries Payable Account Receivable Accumulated Depreciation Equipment Supplies Expenses Equipment Withdrawal Dividends Cash Account Payable pre-paid Insurance supplies Tax payable Rental Revenue Rent Expenses R...
##### A student mixes wants to prepare 24.1 mmol of benzamide from benzoyl chloride and NH4OH. If...
A student mixes wants to prepare 24.1 mmol of benzamide from benzoyl chloride and NH4OH. If the student uses excess 15 M NH4OH, how many mL of Benzoyl chloride must be used? Will give thumbs up, please help!...
##### Payne CO. sells shoes which are made in the USA, Current data for the last month...
Payne CO. sells shoes which are made in the USA, Current data for the last month was as follows: Average Selling Price: $50 Variable Cost:$20 Monthly Fixed Costs: $85,000 Units Sold: 4,000 Payne has a target net income of:$50,000 What is the: Cost per unit: Net Income: Break even in Units: Units f...
##### Balance the following oxidation-reduction equation. The reactions occur in acidic or basic aqueous solution, as indicated....
Balance the following oxidation-reduction equation. The reactions occur in acidic or basic aqueous solution, as indicated. a. Co2+ + H2S +Co+Ss (acidic) O Co2+ +8H2S + 2Co + S8 + 16H+ O8Co2+ + 8H,8 + 8Co+Sg + 16+ Co2+ + 8H2S + 2Co + S8 b. S + Bry + SO 2 + Br” (basic) OS? + 4Br2 + 80H 8Br + SO4...
PLEASE HELP!!!! Please read the information very carefully. Mastery Problem: Corporations: Organization, Stock Transactions, and Dividends Pranks, Inc. Pranks, Inc. is a manufacturer of joke and novelty products for perpetrators of practical jokes. The corporation has paid several cash dividend...
##### Discuss the racial stereotype of black in media
discuss the racial stereotype of black in media...
##### Question 3 of Quiz 4: Explain why the minimum of the average total cost curve is...
Question 3 of Quiz 4: Explain why the minimum of the average total cost curve is the long run equilibrium price....
##### Q10: Cartilage is a type of: A) Supporting connective tissue B) Connective tissue proper C) Both...
Q10: Cartilage is a type of: A) Supporting connective tissue B) Connective tissue proper C) Both A & B D) Neither A nor B Q11: Peroxisomes are a type: A) Protein B) Cell C) Non-membranous organelle D) Membranous organelle Q14: What is the proper anatomical term for the upper-middle abdominopelvi...
##### 2. (6 pts) Fill in the missing entries of the matrix, assuming that the equation holds...
2. (6 pts) Fill in the missing entries of the matrix, assuming that the equation holds for all values of the variables. ( ) Read Example 5 on page 77 (a)?222-3 2x1-4z2 b) ?? r2-2r3...
##### How do you find the critical points for  f(x)=3cos2(x-pi/4)+1?
How do you find the critical points for  f(x)=3cos2(x-pi/4)+1?...


text:
# Questions Tagged with "cases"

Explore solved questions tagged with "cases" or help others by answering their unsolved questions related to "cases".

## Argument of begin has an extra } when trying to use cases

TeX - LaTeX Asked 1 year ago by Elan Mehl

## inline spacing within the cases command when document is in doublespace mode

TeX - LaTeX Asked 1 year ago

## Refinement of nested cases / aligned equations

TeX - LaTeX Asked 1 year ago

## Writing multiline equation inside algorithmic pseudocode environment

TeX - LaTeX Asked 1 year ago by David Ireland

## eqref and cases package

TeX - LaTeX Asked 1 year ago

## Remove extra space between equation and its serial number

TeX - LaTeX Asked 1 year ago

## Space between characters for summation cases condition

TeX - LaTeX Asked 1 year ago

## Cases environment doesn't work

TeX - LaTeX Asked 1 year ago by Sabrina Marques

## Writing left side of the CASES brackets

TeX - LaTeX Asked 1 year ago by Fel


text:
# Bow Infinity Fix Mod for Minecraft 1.7.10/1.6.4

0
64

Well, the Bow Infinity Fix mod is something that every bowman in Minecraft world has been waiting for. It amazingly features the infinity magic ability, making it a great kind of bow that does not need arrows to actually fire, by that way, allowing the archers to shoot as many arrows as they like from an enchanted bow without the need of carrying any actual arrows.

In the vanilla Minecraft, the archers always need to carry at least 1 arrow in the inventory, even though the bow does not use the arrow when firing, as the enchantment implies. So, this mod is definitely a right choice for those want to make the most of the bow’s infinite ability in Minecraft. However, the Bow Infinity Fix is not the kind of mod that should be used during online play since it could get you into trouble of being banned from servers which are strict about the mods, hacks, and other cheats.

## Bow Infinity Fix Mod for Minecraft 1.7.10 and 1.6.4 Changelogs

• Some bugs fixed!
• Update for 1.7.10 and 1.6.4!


text:
# Showing that an intermediate field is not closed

Hungerford defines a field, $E$ as being closed if $E=E''$ where $E'= \{ \sigma \in \mathrm{Aut}(F/K)|\sigma(u)=u \text{ for all } u\in E \} = \mathrm{Aut}(F/E)$ is a subgroup of $\mathrm{Aut}(F/K)$,
$F$ is an extension field of $K$.

I want to show that in the extension of $\mathbb{Q}$ by $\mathbb{Q}(x)$, the intermediate field $\mathbb{Q}(x^3)$ is not closed.

My Attempt. Let $u \in \mathbb{Q}(x) - \mathbb{Q}(x^3)$. Then I'd want to show that $u$ is fixed by $\sigma \in \mathrm{Aut}(\mathbb{Q}(x) / \mathbb{Q}(x^3))$. So I let $u=x^3+x$. Then $\sigma(u)=\sigma(x^3)+\sigma(x)=x^3+\sigma(x)$

Any help as usual would be appreciated.

-
Thanks for the editing. –  Nana Apr 1 '11 at 12:04

I don't really understand the definition you wrote for closed field, because we always have that $Aut(F/E)=Stab(E)\leq Aut(F/K)$.
Any way, if $\sigma \in Aut(\mathbb{Q}(x)/ \mathbb{Q}(x^3))$ then we only need to ask where it sends x. Since x is the root of $t^3-x^3\in\mathbb{Q}(x^3)[t]$ then $\sigma$ must be send x to another root of this polynomial, but in this field the only root is x (because if you extend to the complex numbers then the roots are $x,wx,w^2x$ where w is a root of unit of order 3).
What we get is that the fixed field of $Aut(\mathbb{Q}(x)/ \mathbb{Q}(x^3))$ is actually $\mathbb{Q}(x)$ and not $\mathbb{Q}(x^3)$ as in the galois case.


text:
# 45 dergree mirrors in Special Relativity

by YellowTaxi
Tags: dergree, mirrors, relativity, special
 P: 196 45 degree mirrors in Special Relativity If a moving 45 degree mirror is length contracted doesn't that mean a ray hitting it from the front will appear (from the stationary observer) to contradict the laws of reflection. ie the angle of incidence will not be equal to the angle of reflection. That is, the mirror will appear to be sitting at say something like 30 degrees from the vertical (depending on speed) but still deflect a horizontral ray straight up ! Likewise if the moving mirror DOES appear to be at 45 degrees after length contraction, the ray will NOT go straight up but rather deflect slightly behind the mirror :-) Is this true ? And does SR have any problems with this ? Or is it just an example of relativistic aberration ?
P: 3,914
 Quote by YellowTaxi 45 degree mirrors in Special Relativity If a moving 45 degree mirror is length contracted doesn't that mean a ray hitting it from the front will appear (from the stationary observer) to contradict the laws of reflection. ie the angle of incidence will not be equal to the angle of reflection. That is, the mirror will appear to be sitting at say something like 30 degrees from the vertical (depending on speed) but still deflect a horizontral ray straight up ! Likewise if the moving mirror DOES appear to be at 45 degrees after length contraction, the ray will NOT go straight up but rather deflect slightly behind the mirror :-)
Actually it worse than that :P

In the rest frame of the 45 degree mirror the ray is reflected directly upwards, but to an observer that sees the mirror moving to the right relative to him, the mirror is at 30 degrees from the vertical and the ray is deflected forward (to the right) but still hits the same target above the mirror that is comoving the mirror. So yes, the laws of reflection in relativity are different from the classical ones.

 Quote by YellowTaxi Is this true ? And does SR have any problems with this ? Or is it just an example of relativistic aberration ?
SR does not have a problem with this as long as the all observers measure the speed of light to be constant and observe events to happen in the same sequence and the laws of physics are the same in all reference frames. If a "law of physics" is not the same in all reference frames, then it not a law of physics and we have to modify it, until it is!
P: 3,412
 Quote by kev In the rest frame of the 45 degree mirror the ray is reflected directly upwards, but to an observer that sees the mirror moving to the right relative to him, the mirror is at 30 degrees from the vertical and the ray is deflected forward (to the right) but still hits the same target above the mirror that is comoving the mirror.
So the angle of incidence is still equal to the angle of reflection, isn't it?
 Quote by kev So yes, the laws of reflection in relativity are different from the classical ones.
Why?

P: 3,914

## 45 dergree mirrors in Special Relativity

 Quote by A.T. So the angle of incidence is still equal to the angle of reflection, isn't it?
No, to the observer that sees the length contracted mirror at 30 degrees from the vertical, the angle of incidence of the horizontal ray is 30 degrees and the angle of reflection is greater than 30 degrees, possibly greater than 90 degrees but I have not calculated it.

Also, I imagine that if you throw a ball horizontally at a 45 degree surface that is moving away from you, that it will bounce off at angle that is greater than 45 degrees.
P: 3,914
 Quote by kev No, to the observer that sees the length contracted mirror at 30 degrees from the vertical, the angle of incidence of the horizontal ray is 30 degrees and the angle of reflection is greater than 30 degrees, possibly greater than 90 degrees but I have not calculated it. Also, I imagine that if you throw a ball horizontally at a 45 degree surface that is moving away from you, that it will bounce off at angle that is greater than 45 degrees.
[EDIT] I tried to find a formula on the internet but had luck. I am pretty sure if an angled mirror is moving away from the light source, the angle of reflection will be greater than the angle of incidence and if the mirror is moving towards the source, the angle of reflection will be less than the angle of incidence.
P: 3,412
 Quote by kev [EDIT]I am pretty sure if an angled mirror is moving away from the light source, the angle of reflection will be greater than the angle of incidence and if the mirror is moving towards the source, the angle of reflection will be less than the angle of incidence.
Yes that makes sense, since it has to hit something moving with the mirror above it.

Yet when you think about it, even in classical mechanics (ball & 45°-wall) the rule: incidence angle = reflection angle applies only the rest frame of the wall. So, are the rules of reflection really that different in SR?
P: 1,136
 Quote by YellowTaxi 45 degree mirrors in Special Relativity If a moving 45 degree mirror is length contracted doesn't that mean a ray hitting it from the front will appear (from the stationary observer) to contradict the laws of reflection. ie the angle of incidence will not be equal to the angle of reflection. That is, the mirror will appear to be sitting at say something like 30 degrees from the vertical (depending on speed) but still deflect a horizontral ray straight up ! Likewise if the moving mirror DOES appear to be at 45 degrees after length contraction, the ray will NOT go straight up but rather deflect slightly behind the mirror :-) Is this true ? And does SR have any problems with this ? Or is it just an example of relativistic aberration ?

- The angle of reflection is also a function of the velocity.
- Non simultaneity changes the direction of the wave front.

I did work this out with an example which involves reflections at all
possible angles, The moving spherical mirror clock:

A light flash at the center of a hollow sphere with a reflective inner
surface is reflected and refocused to the center periodically and
constitutes an elementary clock.

See section 4.13 here:
http://physics-quest.org/Book_Chapte...multaneity.pdf

Figure 4.22 shows how the angle of reflection is changed by the velocity.

Sections 4.16 & 4.17 discuss how the light wave front rotates
as a result of non-simultaneity.

Regards, Hans
P: 3,914
 Quote by Hans de Vries - See section 4.13 here: http://physics-quest.org/Book_Chapte...multaneity.pdf
A beautifully crafted and presented document Hans!

 Quote by kev [EDIT] ... I am pretty sure if an angled mirror is moving away from the light source, the angle of reflection will be greater than the angle of incidence and if the mirror is moving towards the source, the angle of reflection will be less than the angle of incidence.
I thought I had better quantify the above statement.

The aberration formula for a ray of light emitted at an angle $\theta '$ as measured in the moving frame, by a source moving with velocity v, the angle of the ray $\theta$ in the stationary frame is:

$$\theta = - 2*\tan^{-1}\left(\frac{tan(\pi-\theta ')}{2}\right) * \sqrt{\frac{(1-v)}{(1+v)}}+\pi$$ (Adapted from http://www.mathpages.com/rr/s2-05/2-05.htm)

where all angles are in radians and are measured clockwise from the negative x axis and v is the is in the positive x direction.

It is farly easy to work out that the horizontal velocity required for the angle of the mirror to change from 45 degrees (Pi/4 radians) to 30 degrees from the vertical is 0.8165c. Plugging these numbers in gives:

$$\theta = - 2*\tan^{-1}\left(\frac{tan(\pi-\pi/4)}{2}\right) * \sqrt{\frac{(1-0.8165)}{(1+0.8165)}}+\pi$$

= 2.52611 radians = aprox 144.7 degrees.

The normal of the moving mirror is 30 degrees so the angle of reflection with the mirror moving away from the source is 144.7-30 = 114.7 degrees which is much greater than the angle of incidence (30 degrees).

For the mirror moving in the negative x direction towards the source:

$$\theta = - 2*\tan^{-1}\left(\frac{tan(\pi-\pi/4)}{2}\right) * \sqrt{\frac{(1+0.8165)}{(1-0.8165)}}+\pi$$

= 0.61548 radians = aprox 35.3 degrees,

so the angle of reflection in this case is 35.3-30 = 5.3 degrees from the normal of the mirror, which is much less than angle on incidence (30 degrees).

 Quote by YellowTaxi Or is it just an example of relativistic aberration ?
Pretty much... as the worked example above shows.
 P: 196 Shouldn't it look like exactly 60 degrees ? - So that it hits the ceiling vertically. Otherwise if a light detector on the ceiling triggers a bomb, the two observes will disagree about whether the bomb went off.
P: 3,914
 Quote by YellowTaxi Shouldn't it look like exactly 60 degrees ? - So that it hits the ceiling vertically. Otherwise if a light detector on the ceiling triggers a bomb, the two observes will disagree about whether the bomb went off.
If I have done the calculations correctly, then the reflected ray should still hit the target/bomb on the ceiling in both frames. The increased complexity over a simple application of angle of reflection is equal to angle of incidence is required to do that.

Bernhard Rothenstein who is a member of physicsforums has gave a formula (Eq 11) in this document here http://arxiv.org/ftp/physics/papers/0508/0508084.pdf but his formula causes a division by zero error when the angle of incidence is parallel to the x axis which is exactly the case we are considering. I am trying to put together a more flexible formula.
 P: 3,914 O.K. I think I have worked it out now. Given the angle $\theta '$, in the rest frame of a mirror, of a light ray from the normal of the mirror, the following formula gives the angle $\theta$ of the same ray as measured in a frame with relative velocity (v). $$\theta = \pi - 2*\tan^{-1}\left(\frac{tan(\pi-\theta ')}{2}\right) * \sqrt{\frac{(1-v/c)}{(1+v/c)}} - \tan^{-1} \left( \frac{ \sqrt{1-v^2/c^2}}{\tan(\theta_{M} ')} \right)$$ where $\theta_{M} '$ is the angle of the angle of the mirror from the y axis as measured in the rest frame of the mirror and v is parallel to the x axis. More explicitly the transformed angle of reflection is given by: $$\theta_{R} = \pi - 2*\tan^{-1}\left(\frac{tan(\pi-\theta_{R} ')}{2}\right) * \sqrt{\frac{(1-v/c)}{(1+v/c)}} - \tan^{-1} \left( \frac{ \sqrt{1-v^2/c^2}}{\tan(\theta_{M} ')} \right)$$ and the transformed angle of incidence is given by: $$\theta_{I} = \pi - 2*\tan^{-1}\left(\frac{tan(\pi-\theta_{I} ')}{2}\right) * \sqrt{\frac{(1-v/c)}{(1+v/c)}} - \tan^{-1} \left( \frac{ \sqrt{1-v^2/c^2}}{\tan(\theta_{M} ')} \right)$$ All angles are positive in the clockwise direction so although the formulas look almost identical, it must be remembered that if a positive value of $\theta_{R} '$ is used for the angle of reflection, then a negative value of $\theta_{I} '$ must be used for the incident angle and vice versa. For v=0 the expected result of $\theta_{R} '$ = $-\theta_{I} '$ is obtained. The last term in the above equations allows for the change in angle of the moving mirror due to length contraction and the first two terms allow for the relativistic aberration of the light rays. It is also worth noting that a physical rod is welded at right angles to the mirror in its rest frame, then when the mirror is moving relative to an observer, the rod no longer appears to be at right angles to the moving mirror and is not parallel to the assumed normal of the moving mirror. Maybe someone could check the equations, as there is plenty of room for error.
P: 3,914
 Quote by YellowTaxi Shouldn't it look like exactly 60 degrees ? - So that it hits the ceiling vertically. Otherwise if a light detector on the ceiling triggers a bomb, the two observes will disagree about whether the bomb went off.
The attached diagram gives an idea of what is happening. The mirror is red, the normal of the mirror is in solid black and the light rays are blue. The reflected light ray in the transformed diagram appears to go through the mirror but that does not actually happen because the mirror is moving.
Attached Thumbnails

 P: 196 Thanks for taking an interest and making the effort kev. For some reason I imagined everything the exact other way around to you. It seems that great minds actually don't think alike. For simplicity I visualised this : Length contracted mirror moving to the right (looks like it's at 30'), light ray comes in from from the right (parallel to the line of motion) and gets deflected vertically upward. Simple as that... I would check the equations, but unfortunately I can't even see them on my computer, just a bunch of squiggles on a black background.. I'll see if I can log in to physicsforums from a friends comp. Cheers
P: 3,914
 Quote by YellowTaxi For simplicity I visualised this : Length contracted mirror moving to the right (looks like it's at 30'), light ray comes in from from the right (parallel to the line of motion) and gets deflected vertically upward. Simple as that...
Here is another drawing, but this time with mirror moving towards the light source, which might be more in line with what you had in mind (except the mirror is moving to the left).
Attached Thumbnails

 Related Discussions Special & General Relativity 97 Special & General Relativity 25 Special & General Relativity 5


text:
# ${{\boldsymbol t}}$-quark Polarization in ${{\boldsymbol t}}{{\overline{\boldsymbol t}}}$ Events in ${{\boldsymbol p}}{{\boldsymbol p}}$ Collisions at $\sqrt {s }$ = 7 TeV INSPIRE search

The double differential distribution in polar angles, ${{\mathit \theta}_{{1}}}$ (${{\mathit \theta}_{{2}}}$) of the decay particle of the top (anti-top) decay products, is parametrized as (1/${{\mathit \sigma}}$)d${{\mathit \sigma}}$/(dcos ${{\mathit \theta}_{{1}}}$ dcos ${{\mathit \theta}_{{2}}}$) = (1/4) ( 1 + A$_{t}$ cos ${{\mathit \theta}_{{1}}}$ + A$_{{{\overline{\mathit t}}}}$ cos ${{\mathit \theta}_{{2}}}$ $−$ C cos ${{\mathit \theta}_{{1}}}$ cos ${{\mathit \theta}_{{2}}}$ ). The charged lepton is used to tag ${{\mathit t}}$ or ${{\overline{\mathit t}}}$. The coefficient A$_{t}$ and A$_{{{\overline{\mathit t}}}}$ measure the average helicity of ${{\mathit t}}$ and ${{\overline{\mathit t}}}$, respectively. A$_{CPC}$ = A$_{t}$ = A$_{{{\overline{\mathit t}}}}$ assumes $\mathit CP$ conservation, whereas A$_{CPV}$ = A$_{t}$ = $−A_{{{\overline{\mathit t}}}}$ corresponds to maximal $\mathit CP$ violation.
VALUE DOCUMENT ID TECN  COMMENT
• • • We do not use the following data for averages, fits, limits, etc. • • •
$-0.035$ $\pm0.014$ $\pm0.037$ 1
 2013 BE
ATLS A$_{CPC}$
$0.020$ $\pm0.016$ ${}^{+0.013}_{-0.017}$ 1
 2013 BE
ATLS A$_{CPV}$
1  Based on 4.7 fb${}^{-1}$ of data using the final states containing one or two isolated electrons or muons and jets with at least one ${{\mathit b}}$-tag.
References:
PRL 111 232002 Measurement of Top Quark Polarization in Top-Antitop Events from Proton$−$Proton Collisions at $\sqrt {s }$ = 7 TeV using the ATLAS Detector


text:
List of possible dwarf planets

Illustration of the relative sizes, albedos, and colours of the largest trans-Neptunian objects

It is estimated that there may be 200 dwarf planets in the Kuiper belt of the outer Solar System and up to 10,000 in the region beyond.[1][2] The International Astronomical Union (IAU) has accepted four of these: Pluto, Eris, Haumea, and Makemake, as well as Ceres in the inner Solar System. This article lists these and the more likely of the remaining known possibilities.

IAU naming procedures

In 2008, the IAU modified its naming procedures such that objects considered most likely to be dwarf planets receive differing treatment than others. Objects that have an absolute magnitude (H) less than +1 (and hence a mathematically delimited minimum diameter of 838 kilometres (521 mi)[3]) are overseen by two naming committees, one for minor planets and one for planets. Once named, the objects are declared to be dwarf planets. Makemake and Haumea are the only objects to have proceeded through the naming process as presumed dwarf planets; currently there are no other bodies which meet this requirement. All other bodies are named by the minor-planet naming committee alone, and the IAU has not stated how or if they will be accepted as dwarf planets.

Limiting values

Calculation of the diameter of Ixion depends on the albedo (the fraction of light that it reflects), which is currently unknown.

The qualifying feature of a dwarf planet is that it "has sufficient mass for its self-gravity to overcome rigid body forces so that it assumes a hydrostatic equilibrium (nearly round) shape".[4][5][6] Except for Pluto and Ceres, current observations are insufficient for a direct determination if a body meets this definition. However, Michael Brown estimates that an icy body relaxes into hydrostatic equilibrium at a diameter somewhere between 200 and 400 km.[1] Thus, all the trans-Neptunian objects (TNOs) listed below are estimated to be at least 400 kilometres (250 mi) in diameter, though not all bodies estimated to be that size are included. The lists are further complicated by bodies such as (47171) 1999 TC36 that were at first assumed to be large single objects but were later discovered to be smaller binary or triple systems.[7]

Ceres is the only identified dwarf planet in the asteroid belt. 4 Vesta, the second-most-massive asteroid, appears to have a fully differentiated interior and was therefore in equilibrium at some point in its history, but it is not today.[8] The third-most massive object, 2 Pallas, has a somewhat irregular surface and is thought to have only a partially differentiated interior. Brown estimates that, since rocky objects are more rigid than icy objects, rocky objects below 900 kilometres (560 mi) in diameter may not be in hydrostatic equilibrium and thus not dwarf planets.[1]

Probable per Brown

Mike Brown considers a large number of trans-Neptunian bodies, ranked by estimated size, to be "probably" dwarf planets.[9] He did not consider asteroids, stating "In the asteroid belt Ceres, with a diameter of 900 km, is the only object large enough to be round".[9]

The terms for varying degrees of likelihood he split these into:

• Near certainty: diameter estimated/measured to be over 900 kilometres (560 mi). Sufficient confidence to say these must be in hydrostatic equilibrium, even if predominantly rocky.
• Highly likely: diameter estimated/measured to be over 600 kilometres (370 mi). The size would have to be "grossly in error" or they would have to be primarily rocky to not be dwarf planets.
• Likely: diameter estimated/measured to be over 500 kilometres (310 mi). Uncertainties in measurement mean that some of these will be significantly smaller and thus doubtful.
• Probable: diameter estimated/measured to be over 400 kilometres (250 mi). Expected to be dwarf planets, if they are icy, and that figure is correct.
• Possible: diameter estimated/measured to be over 200 kilometres (120 mi). Icy moons transition from a round to irregular shape in the 200–400 km range, suggesting that the same figure holds true for KBOs. Thus, some of these objects could be dwarf planets.
• Probably not: diameter estimated/measured to be under 200 km. No icy moon under 200 km is round, suggesting that the same figure holds true for KBOs. The estimated size of these objects would have to be in error for them to be dwarf planets.

Probable per Tancredi

In 2010, Gonzalo Tancredi presented a report to the IAU evaluating a list of 46 candidates for dwarf-planet status based on light curve amplitude analysis and the assumption that the object was more than 450 kilometres (280 mi) in diameter. Some diameters are measured, some are best-fit estimates, and others use an assumed albedo of 0.10. Of these, he identified 15 as dwarf planets by his criteria, with another nine being considered possible. To be cautious, he advised the IAU to "officially" accept as dwarf planets the top three: Sedna, Orcus, and Quaoar.[10] Although the IAU had anticipated Tancredi's recommendations, as of 2013, they had not responded.

Likeliest possible dwarf planets

Brown's categories
near certainty
highly likely
likely
probably
possibly
probably not

This is a list of the largest objects in the Solar System that are possible dwarf planets. Excepting Ceres, all are trans-Neptunian objects.

The default sort is per Brown's size estimate. The IAU recognised dwarf planets have bold names. Brown's diameter estimates are in red when they are based upon an assumed albedo. Explanations and sources for the measured masses and diameters can be found on the bodies' linked pages.

Body Per Brown[9] Measured per
measured
Diameter
per assumed albedo
Result
per Tancredi[10]
Category Best[a]
Diameter
km
H
Diameter[b]
(km)
Albedo
%
Mass
(Zg)
H Diameter
(km)
Albedo[c]
%
Small
albedo=100%
(km)
Large
albedo=4%
(km)
Eris −1.1 2330 99 16700 −1.2 2326 99 2310 11548 accepted (measured) SDO 2326
Pluto −0.7 2329 64 13100 −0.8 2368 66 1921 9605 accepted (measured) 2:3 resonant 2368
Makemake 0.1 1426 81 −0.4 1430 125 1598 7989 accepted cubewano 1430
(225088) 2007 OR10 2 1290 19 2 1280 17 529 2645 SDO 1280
Haumea 0.4 1252 80 4000 0.1 1430 79 1269 6346 accepted cubewano 1430
Quaoar 2.7 1092 13 1400 2.4 1074 17 440 2200 accepted (and recommended) cubewano 1074
Sedna 1.8 1041 32 1.5 995 45 666 3330 accepted (and recommended) detached 995
Orcus 2.3 983 23 580 2.2 917 28 483 2413 accepted (and recommended) 2:3 resonant 917
(307261) 2002 MS4 4 960 5 3.7 934 7 242 1209 cubewano 934
Ceres 943 3.3 952 9 291 1454 main belt 952
Salacia 4.2 921 4 450 4.2 854 5 192 960 possible cubewano 854
Varuna 3.9 770 9 3.6 757 11 253 1266 accepted cubewano 757
2013 FY27 3.3 765 15 3 334 1669 SDO 765
(208996) 2003 AZ84 3.7 747 11 3.8 727 10 231 1155 accepted 2:3 resonant 727
(55637) 2002 UX25 3.9 704 11 125 3.8 697 11 231 1155 cubewano 697
(55565) 2002 AW197 3.8 704 12 3.5 768 12 265 1326 accepted cubewano 768
(90568) 2004 GV9 4.2 703 8 4 680 10 211 1053 accepted 3:5 resonant 680
(145452) 2005 RN43 3.9 697 11 3.9 679 11 221 1103 possible cubewano 679
(202421) 2005 UQ513 3.7 695 13 3.4 498 31 278 1388 cubewano 498
Varda 3.7 695 13 265 3.4 705 16 278 1388 possible cubewano 705
Ixion 3.8 674 12 3.6 650 15 253 1266 accepted 2:3 resonant 650
(278361) 2007 JJ43 4.2 617 11 3.9 221 1103 cubewano 617
(229762) 2007 UK126 3.7 612 17 3.4 599 21 278 1388 SDO 599
Chaos 5 612 5 4.8 600 6 146 729 cubewano 600
(230965) 2004 XA192 4.3 603 10 4 339 39 211 1053 1:2 resonant 339
2013 FZ27 4.3 603 10 4 211 1053 cubewano 603
2012 VP113 4.3 603 10 4 211 1053 detached 603
2010 KZ39 4.3 603 10 4 211 1053 cubewano 603
(84522) 2002 TC302 4.2 591 12 3.8 584 16 231 1155 2:5 resonant 584
2010 RF43 4.4 588 10 4.1 201 1006 SDO 588
(78799) 2002 XW93 5.4 584 4 5.5 106 528 SDO 584
2003 UZ413 4.5 574 9 4.2 192 960 2:3 resonant 574
(42301) 2001 UR163 4.5 574 9 4.2 192 960 possible SDO 574
2002 XV93 5.4 564 4 5 549 6 133 665 2:3 resonant 549
2010 FX86 4.6 561 9 4.3 183 917 cubewano 561
2010 RE64 4.6 561 9 4.3 183 917 SDO 561
2006 QH181 4.6 561 9 4.3 183 917 SDO 561
2008 ST291 4.6 561 9 4.3 183 917 detached 561
(145451) 2005 RM43 4.7 548 9 4.4 175 876 possible SDO 548
2004 XR190 4.7 548 9 4.4 175 876 detached 548
2004 NT33 4.7 548 9 4.4 423 17 175 876 cubewano 423
(84922) 2003 VS2 4.1 537 15 4.2 523 13 192 960 2:3 resonant 523
(120348) 2004 TY364 4.8 535 8 4.5 167 837 2:3 resonant 535
2008 OG19 4.8 522 8 4.6 160 799 SDO 522
2010 VK201 4.8 522 8 4.6 160 799 cubewano 522
(308379) 2005 RS43 5.5 513 4 5.3 116 579 1:2 resonant 513
2007 JH43 4.9 510 8 4.7 153 763 2:3 resonant 510
2003 QX113 4.9 510 8 4.7 153 763 SDO 510
(82075) 2000 YW134 5 498 7 4.8 146 729 detached 498
(307616) 2003 QW90 5.6 491 4 5.4 111 553 cubewano 491
(119979) 2002 WC19 5.1 486 7 4.9 139 696 1:2 resonant 486
2007 XV50 5.1 486 7 4.9 139 696 cubewano 486
(315530) 2008 AP129 5.1 486 7 4.9 139 696 3:5 resonant 486
(307982) 2004 PG115 5.1 486 7 4.9 139 696 SDO 486
(175113) 2004 PF115 4.5 482 12 4.4 406 19 175 876 2:3 resonant 406
2010 EK139 3.8 475 25 3.8 470 24 231 1155 SDO 470
2010 TJ 5.2 475 7 5 133 665 SDO 475
2010 RF64 5.2 475 7 5 133 665 cubewano 475
2010 VZ98 5.2 475 7 5 133 665 SDO 475
2011 FW62 5.2 475 7 5 133 665 2:3 resonant 475
(26375) 1999 DE9 5.2 474 7 5.1 461 8 127 635 possible SDO 461
(35671) 1998 SN165 5.7 473 4 5.6 393 7 101 504 cubewano 393
(145480) 2005 TB190 4.4 469 15 4.7 464 11 153 763 detached 464
(119951) 2002 KX14 4.9 468 10 4.4 175 876 2:3 resonant 468
(120132) 2003 FY128 5.1 467 8 4.9 460 9 139 696 SDO 460
Huya 5 466 8 4.9 458 9 139 696 accepted 2:3 resonant 458
1999 CD158 5.3 463 6 5.1 127 635 4:7 resonant 463
2010 EL139 5.3 463 6 5.1 127 635 2:3 resonant 463
2013 FC28 5.3 463 6 5.1 127 635 cubewano 463
(84719) 2002 VR128 5.6 459 5 5.7 449 5 96 481 2:3 resonant 449
2003 QX111 6.8 453 2 6.8 58 290 2:3 resonant 453
(26181) 1996 GQ21 5.4 452 6 5.2 121 606 SDO 452
2013 JW63 5.4 452 6 5.2 121 606 1:2 resonant 452
2011 GM27 5.4 452 6 5.2 121 606 cubewano 452
2010 HE79 5.4 452 6 5.2 121 606 2:3 resonant 452
2010 ET65 5.4 452 6 5.2 121 606 SDO 452
2008 NW4 5.4 452 6 5.2 121 606 cubewano 452
(305543) 2008 QY40 5.4 452 6 5.2 121 606 SDO 452
2008 UA332 5.4 452 6 5.2 121 606 cubewano 452
2006 HH123 5.4 452 6 5.2 121 606 2:5 resonant 452
2002 GD32 5.9 430 4 5.7 96 481 cubewano 430
2001 QF298 5.4 421 7 5.1 408 10 127 635 2:3 resonant 408
(303775) 2005 QU182 3.8 415 33 3.5 416 41 265 1326 SDO 416
(144897) 2004 UX10 4.8 409 14 4.5 361 21 167 837 possible 2:3 resonant 361
2003 UA414 5.5 381 8 5.3 116 579 cubewano 381
2002 PJ149 5.5 381 8 5.3 116 579 cubewano 381
2002 CY248 5.5 381 8 5.3 116 579 cubewano 381
2010 JK124 5.5 381 8 5.3 116 579 2:3 resonant 381
2010 RO64 5.5 381 8 5.3 116 579 cubewano 381
2011 JF31 5.5 381 8 5.3 116 579 cubewano 381
2001 QX322 6.2 376 4 6 84 419 SDO 376
1999 CL119 6.2 376 4 6 84 419 cubewano 376
2000 CQ105 6.2 376 4 6 84 419 SDO 376
(48639) 1995 TL8 5.6 364 8 5.4 111 553 detached 364
2001 QS297 5.6 364 8 5.4 111 553 cubewano 364
(126154) 2001 YH140 5.6 364 8 5.4 111 553 cubewano 364
2010 TR19 5.6 364 8 5.4 111 553 SDO 364
2010 TY53 5.6 364 8 5.4 111 553 2:3 resonant 364
2010 VW11 5.6 364 8 5.4 111 553 SDO 364
2010 ER65 5.6 364 8 5.4 111 553 detached 364
2008 CT190 5.6 364 8 5.4 111 553 SDO 364
(82155) 2001 FZ173 6.3 360 4 6.1 80 400 SDO 360
2000 KK4 6.3 360 4 6.1 80 400 cubewano 360
2000 PE30 6.3 360 4 6.1 80 400 SDO 360
2001 XD255 5.7 348 8 5.5 106 528 2:3 resonant 348
2002 GH32 5.7 348 8 5.5 106 528 3:5 resonant 348
2002 XH91 5.7 348 8 5.5 106 528 cubewano 348
2007 PS45 5.7 348 8 5.5 106 528 cubewano 348
(312645) 2010 EP65 5.7 348 8 5.5 106 528 1:2 resonant 348
2010 VR11 5.7 348 8 5.5 106 528 cubewano 348
2013 FB28 5.7 348 8 5.5 106 528 cubewano 348
2007 TG422 6.4 345 4 6.2 76 382 SDO 345
(15874) 1996 TL66 5.4 344 11 5.4 339 11 111 553 accepted SDO 339
(135182) 2001 QT322 6.4 342 4 6.2 76 382 cubewano 342
(82158) 2001 FP185 6.4 336 5 6 84 419 SDO 336
2010 AH2 5.8 333 8 5.6 101 504 1:2 resonant 333
2007 JF43 5.8 333 8 5.6 101 504 2:3 resonant 333
2012 XR157 5.8 333 8 5.6 101 504 1:2 resonant 333
2011 HP83 5.8 333 8 5.6 101 504 SDO 333
2010 RN64 5.8 333 8 5.6 101 504 cubewano 333
2010 PK66 5.8 333 8 5.6 101 504 cubewano 333
2010 PU75 5.8 333 8 5.6 101 504 SDO 333
2001 QC298 6.5 330 4 6.3 73 365 cubewano 330
(148209) 2000 CR105 6.5 330 4 6.3 73 365 detached 330
2001 KA77 5.6 324 10 5 133 665 cubewano 324
(307251) 2002 KW14 5.9 322 8 5 133 665 cubewano 322
2003 UB292 5.9 319 8 5.7 96 481 cubewano 319
2002 GF32 5.9 319 8 5.7 96 481 2:3 resonant 319
2010 VQ11 5.9 319 8 5.7 96 481 cubewano 319
2007 OC10 5.4 315 13 5.7 96 481 SDO 315
2004 VN112 6.6 315 4 6.4 70 349 detached 315
2004 OJ14 6.6 315 4 6.4 70 349 2:5 resonant 315
(150642) 2001 CZ31 6 305 8 5.8 92 460 cubewano 305
(79978) 1999 CC158 6 305 8 5.8 92 460 SDO 305
2005 CA79 6 305 8 5.8 92 460 1:2 resonant 305
2008 SP266 6 305 8 5.8 92 460 cubewano 305
2007 TB418 6 305 8 5.8 92 460 2:5 resonant 305
2007 VK305 6 305 8 5.8 92 460 SDO 305
2010 JC80 6 305 8 5.8 92 460 SDO 305
2013 JV63 6 305 8 5.8 92 460 cubewano 305
2005 SD278 6.7 302 4 6.5 67 333 2:5 resonant 302
2000 CP104 6.7 302 4 6.5 67 333 cubewano 302
1. ^ The measured diameter, else Brown's estimated diameter, else the diameter calculated from H using an assumed albedo of 8%.
2. ^ Diameters in red indicate that Brown derived them from an assumed albedo.
3. ^ The albedo $A$ is calculated from the measured absolute magnitude $H$ and measured diameter $D$ via the formula: $A =\left ( \frac{1329\times10^{-H/5}}{D} \right ) ^2$

References

1. ^ a b c Mike Brown. "The Dwarf Planets". Retrieved 2008-01-20.
2. ^ "Today we know of more than a dozen dwarf planets in the solar system [and] it is estimated that the ultimate number of dwarf planets we will discover in the Kuiper Belt and beyond may well exceed 10,000".The PI's Perspective
3. ^ Dan Bruton. "Conversion of Absolute Magnitude to Diameter for Minor Planets". Department of Physics & Astronomy (Stephen F. Austin State University). Retrieved 2008-06-13.
4. ^ "IAU 2006 General Assembly: Result of the IAU Resolution votes". International Astronomical Union. 2006. Retrieved 2008-01-26.
5. ^ "Dwarf Planets". NASA. Retrieved 2008-01-22.
6. ^ "Plutoid chosen as name for Solar System objects like Pluto" (Press release).
7. ^ "AstDys (47171) 1999TC36 Ephemerides". Department of Mathematics, University of Pisa, Italy. Retrieved 2009-12-07.
8. ^ Savage, Don; Jones, Tammy; Villard, Ray (1995-04-19). "Asteroid or Mini-Planet? Hubble Maps the Ancient Surface of Vesta". Hubble Site News Release STScI-1995-20. Retrieved 2006-10-17.
9. ^ a b c
10. ^ a b Tancredi, G. (2010). "Physical and dynamical characteristics of icy "dwarf planets" (plutoids)". Icy Bodies of the Solar System: Proceedings IAU Symposium No. 263, 2009.
11. ^ "List Of Trans-Neptunian Objects". Minor Planet Center.
12. ^ "List Of Centaurs and Scattered-Disk Objects". Minor Planet Center.


text:
# Source code explanation in R

#### user366312

Gold Member
Summary
Kindly explain the source code in R which meant for calculating stationary distribution of a transition matrix.
Summary: Kindly explain the source code in R which meant for calculating stationary distribution of a transition matrix.

I am trying to understand the following source code meant for finding stationary distribution of a matrix:

R code:
$# Stationary distribution of discrete-time Markov chain$#  (uses eigenvectors)
stationary <- function(mat)
{
x = eigen(t(mat))$vectors[,1] as.double(x/sum(x)) } I tested the following source code myself: R code: > rm(list=ls()) > > P <- matrix(c(0.66, 0.34, + 0.66, 0.34), nrow=2, ncol=2, byrow = TRUE) > > x <- eigen(t(P)) > x$values
[1] 1 0

$vectors [,1] [,2] [1,] 0.8889746 -0.7071068 [2,] 0.4579566 0.7071068 > y <- x$vectors[,1]
> y
[1] 0.8889746 0.4579566
>
looks like the command
Code:
y <- x\$vectors[,1]
is selecting the 1st column of the matrix.

Why wasn't that simply written like the following?

R code:
$# Stationary distribution of discrete-time Markov chain$#  (uses eigenvectors)
stationary <- function(mat)
{
x = eigen(t(mat))
y = x[,1]
as.double(y/sum(y))
}
What was the reason for introduction of a dollar sign and vector keyword?

Last edited:
Related Programming and Computer Science News on Phys.org

#### jedishrfu

Mentor
My suggestion is to begin reading up on R or checking out some online tutorials

@FactChecker suggestion in your other thread is a great technique for teasing out what these constructs mean.

There’s also the Rosetta Code website with examples of R doing various tasks. The code may or may not be the best implementation of any task but they are instructive

And lastly the R reference on the eig function

#### FactChecker

Gold Member
2018 Award
What was the reason for introduction of a dollar sign and vector keyword?
That is what the documentation of the eigen function says that it returns. (see R documentation of eigen function)
I don't think that your code will work. When you encounter an unfamiliar function, it is always good to check the documentation.

#### user366312

Gold Member
That is what the documentation of the eigen function says that it returns. (see R documentation of eigen function)
I don't think that your code will work. When you encounter an unfamiliar function, it is always good to check the documentation.
Got it thanks.

"Source code explanation in R"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving


text:
#### Volume 15, issue 5 (2015)

The Morava $K$–theory of $BO(q)$ and $MO(q)$
 1 N Kitchloo, G Laures, W S Wilson, The Morava $K$–theory of spaces related to $\mathit{BO}$, Adv. Math. 189 (2004) 192 MR2093483 2 N Kitchloo, W S Wilson, The $\mathit{ER}(n)$–cohomology of $\mathit{BO}(q)$ and real Johnson–Wilson orientations for vector bundles, Bull. London Soc. Math. 47 (2015) 835 3 A Kono, N Yagita, Brown–Peterson and ordinary cohomology theories of classifying spaces for compact Lie groups, Trans. Amer. Math. Soc. 339 (1993) 781 MR1139493 4 I Kriz, Morava $K$–theory of classifying spaces: Some calculations, Topology 36 (1997) 1247 MR1452850 5 P S Landweber, Homological properties of comodules over $M\mathrm{U}_\ast (M\mathrm{U})$ and BP$_\ast$(BP), Amer. J. Math. 98 (1976) 591 MR0423332 6 S A Mitchell, S B Priddy, A double coset formula for Levi subgroups and splitting $B\mathrm{GL}_n$, from: "Algebraic topology" (editors G Carlsson, R L Cohen, H R Miller, D C Ravenel), Lecture Notes in Math. 1370, Springer (1989) 325 MR1000386 7 D C Ravenel, W S Wilson, N Yagita, Brown–Peterson cohomology from Morava $K$–theory, $K$–Theory 15 (1998) 147 MR1648284 8 B Totaro, The Chow ring of a classifying space, from: "Algebraic $K$–theory" (editors W Raskind, C Weibel), Proc. Sympos. Pure Math. 67, Amer. Math. Soc. (1999) 249 MR1743244 9 W S Wilson, The complex cobordism of $B\mathrm{O}_{n}$, J. London Math. Soc. 29 (1984) 352 MR744106 10 N Yagita, Coniveau filtration of cohomology of groups, Proc. Lond. Math. Soc. 101 (2010) 179 MR2661245