วันศุกร์ที่ 19 ธันวาคม พ.ศ. 2557



How to learn any more with R ?

  
Yes you can !!!


https://www.coursera.org/course/rprog






   It's a free course on line that student who interest in R can use
   It's save your course.
   It's make your skill.
   It's Free for you.



WHEN YOU NEED 
Executing commands from or diverting output to a file



If commands  are stored in an external file, say commands.R in the working directory work, they may be executed at any time in an R session with the command

> source("commands.R")


For Windows Source is also available on the File menu. The function "sink",

> sink("record.lis")



will divert all subsequent output from the console to an external file, record.lis. The command

> sink()



NOTE : when you collect data from the outside you can use this function for made easy with your                     data  to use.


when you need help in R ?

    when you use  R and you need help such as you need to know about the mean of word. you can
  
        
         R has an inbuilt help facility similar to the man facility of UNIX. To get more information on any specific named function, for example solve, the command is 

  
         > help(solve)


         or

        > ?solve

         For a feature specified by special characters, the argument must be enclosed in double or single quotes, making it a “character string”: This is also necessary for a few words with syntactic meaning including iffor and function.

> help("[[")


Either form of quote mark may be used to escape the other, as in the string "It's important". Our convention is to use double quote marks for preference.
On most R installations help is available in HTML format by running


> help.start()


The help.search command allows searching for help in various ways. For example,
> ??solve


The examples on a help topic can normally be run by
> example(topic)



Windows versions of R have other optional help systems: use

> ?help

วันพุธที่ 17 ธันวาคม พ.ศ. 2557

Brief R Manual

Install R program from www.rstudio.com
The basic of using R program


Number 1 is the blank. It use for typing code and run code(ctrl+enter)


Number 2 is the environment and history.For example,

It show the data that you type. When you type only name such as david, the data will know the value of david = 60.

Number 3, It show the result when you run code in the blank (number 1).

and number 4, It show files,plot,packages,help and viewer. For example, when you type "?sd" , number 4 show meaning of sd in "help".


Other sample in program R.

In R program has a lot of displays of data, one of formation of showing the data is " iris".
You can call Iris which is the database.

You can calculate the average,sd,max,min and variance in Iris formation. After that, you run code.
It will show the results.

And then, if you want to understand more than numerics, you can plot graph. It's so easy. Just type the code. For example,
When you run code, it show the result quickly.

Or you want to show the data in other formation such as histogram. You will type hist(  ).
For instance, hist(cars_data$sq_hp)  <--- Drawing histogram between the data of sq and hp.


R program can find the correlation between the variables.
You have to fix the topic which you want to find the correlation such as mtcars.

 You have to type "head(mtcars)". And then, when you run code, r program will show the data  mtcars automatically.
But you want to find the correlation of mtcars, you have to use each variables of mtcars. You has to call it. Just type "names(mtcars)".



And then, you will find the correlation whatever you want.
You will type two variables that you want to find the correlation. And then, you will run code.

Or you want to find the correlation of every variables in mtcars. You just type "cor(mtcars)".

Finally, This is the examples using in R program.









Prediction the future of R programe

The Future

It is the present aim of the R project to produce a free implementation of something "close to" version 3 of the S language and to provide ongoing support and maintenance for the resulting software. Some members of the R core have proposed that future developments in S version 4 should be also tracked. At this point it is unclear whether this will happen.
One development which would help R a good deal would be the development of an integrated graphical user interface. Some initial work has begun on this.


 



Real comment of people who use R programe

The statement
“Were Pfizer to use R in clinical studies, it would run the risk of seeing its research questioned or even rejected by regulators doubting the veracity of results based on what they view as an unknown quantity. ”
is quite misleading. As another post said, FDA places no restrictions on the software used for drug and device registration. And for those who feel (improperly, in my personal opinion) that federal regulations on software used for database engines and medical devices apply also to analytical software, CFR11 compliance for the base R system has already been done.
The increasing use of R within FDA is perhaps testimony enough.
Frank Harrell
Chairman, Biostatistics, Vanderbilt University
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Many of the issues raised thus far with using R in commercial environments (including use of R in regulated areas such as clinical trials) are no different than with other open source software which is widely used. Such issues are generally addressed by commercial open source software vendors. In fact, the commercial open source business is relatively mature, so it’s surprising there has been no reference to this.
Pharmaceutical companies, banks and government agencies around the world are running Red Hat Linux, for example, one of the earlier examples of a commercial open source model. It’s difficult to think of something more fundamental in computing than the operating system. Whilst such companies are still using “Linux”, they are in fact using binary builds from vendors such as Red Hat who are providing a documented, supported build of Linux together with recourse in the event of issues with the software, just like any proprietary software vendor. REvolution Computing is the same in its relationship to R in all these respects.
In such cases, open source software (as opposed to simply “freeware”) is a positive advantage, in that the source code is transparent to both practitioners and regulators – not to mention subject to the oversight of a worldwide community. In the case of REvolution’s binary build of R, REvolution R, support for validation is no different (if not better) than with proprietary software, in that the software is built to validation standards in a controlled and documented software development lifecycle. Of course, we also provide support to our customers in this regard (many of whom were referenced in the original article) in addition to performance benefits when running R internally.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
I work in the field of spatial data analysis and GIS. During my PhD study time (2000-2003), I had a lot of ideas and things I wanted to experiment with (and I did have licenses of commercial software ArcGIS, Erdas Imagine etc.), but somehow, I had problems putting my idea into work. Then, in 2004/05 I started with R. At about the same time, a group of colleagues (http://cran.r-project.org/view=Spatial) developed a support for spatial data in R. Now, 70% of my work goes through R (and we do big projects). I also use it for teaching (no complains so far; as long as you write up good lecture notes and take the right steps). I am looking forward to developing a package or two in the coming years.
I think that there are three main reasons why R makes a big difference: (1) transparency – it allows me too look at the algorithm and data (object) structures; and extend them; (2) quality – many of the (spatial and environmetrics) packages are developed by leading scientists; and I do trust academia more than fancy commercials; (3) enthusiasm – people are ready to share ideas and experiences, without a special ambition to make large profits, to monopolize or to put their personal interest in front (I still do not know how to explain this).
Articles like this help us convience also our colleagues to consider using this software (switching to R). It really is a noble task!
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
For economists and especially financial analysts there is a wonderful series of R packages in Rmetrics.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
SPSS since Version 16 in 2007 has embraced R. SPSS users can install a free plug-in enabling them to run R code on the active SPSS data with output appearing along with regular SPSS output in the Viewer window.
R and SPSS have complementary strengths. R packages can extend the statistical capabilities of SPSS while SPSS can handle heavy-duty data management and present the R results in a high-quality output format. Users can define SPSS-style syntax for R packages and easily build custom dialog boxes for them (as well as other things), so users who don’t want to make the not insignificant investment in learning R can still take advantage of the many available R packages. Details can be found at SPSS Developer Central

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

The burgeoning interest in R demonstrates that there’s demand for analytics to solve real, business-critical problems in a broad spectrum of companies and roles, and that some of the incumbent analytics offerings, in particular SAS and SPSS, don’t sufficiently meet the growing need for analytics in many major companies.
S+ (now TIBCO Spotfire S+, http://spotfire.tibco.com/) is a commercial software package based on the S language, which was a forerunner of R as discussed above, and has been widely adopted. It is currently used in a wide variety of areas, including Life Sciences (including the analysis of Clinical Trial data), Financial Services, and Utilities, for applications such as speeding the analysis of clinical trial data, optimizing portfolios, and assessing potential sites for building wind farms.
We welcome, respect, and appreciate the vitality, creativity, and sheer productivity of the R community, and the high quality of statistical methods the community creates. Because of the close historical ties between the two products, it is generally easy to port most R statistics into the commercial S+ environment, and we have worked to make that easier in recent releases.
Once in S+, these analytic methods can be incorporated into intuitive tools for business decision makers and deployed to automated environments, using visual workflows, web-based applications (using standard web services), Spotfire Guided Applications for dynamic visual analysis, and scalable, event-driven architectures using TIBCO’s IT infrastructure. S+ also provides some unique offerings, such as the ability to flexibly and efficiently analyze very large data sets. In this way, we feel companies can maximize the value of their analytic investments to make rapid business decisions, whether those analytics are developed in R or S+.

History of R programme

R began as an experiment in trying to use the methods of Lisp implementors to build a small tested which could be used to trial some ideas on how a statistical environment might be built. Early on, the decision was made to use an S-like syntax. Once that decision was made, the move toward being more and more like S has been irresistible.
R has now outgrown its origins and its development is now a collaborative effort undertaken using the Internet to exchange ideas and distribute the results. The focus is now on how the initial experiment can be turned into a viable piece of free software.

A Brief History

The initial work on R by Robert Gentleman and I produced what looked like a potentially useful piece of software and we began preparing it for use in our teaching laboratory. We were heartened enough by our progress to place some binary copies of R at Statlib and make a small announcement on the s-news mailing list in August of 1993.
A number of people picked up our binaries and offered feedback. The most persistent of these was Martin Mächler of ETH Zurich, who encouraged us to release the R source code as "free software".
We had some initial doubts about doing this, but Martin's arguments were persuasive, and we agreed to make the source code available by ftp under the terms of the Free Software Foundation's GNU general license. This happened in June of 1995.
At this point, the development of R was a relatively closed process. Robert and I (soon joined by Martin) would get bug reports by e-mail and from time-to-time release updated versions of R. We quickly noticed that there was no real forum for users to discuss R with each other and so we began maintaining a small mailing list.
As interest in R grew (mostly by word of mouth) it became clear that manually maintaining the mailing list was not an effective option. Worse than that, at Auckland we were paying for e-mail, and the cost was beginning to become noticeable. Eventually Martin volunteered the use of facilities at ETH Zurich to establish automated mailing lists to carry discussions about R and R development. In March of 1996 the r-testers mailing list was started. Roughly a year later this was replaced with three newsgroups: r-announcer-help and r-devel.
As R developed and people began porting applications to it, it became clear that we needed a better distribution mechanism. After some discussion it was decided a formal archive mechanism was desirable. Kurt Hornik of TU Wien took on the task of establishing the archive. In addition to the master site in Austria there are a number of mirror sites, including StatLib.
With the introduction of the mailing lists, development on R accelerated. This was partly because we obtained many more reports and suggestions and partly because we also began to receive patches and code contributions. The contributions ranged from fixes for typos through to changes which provided substantial increases in functionality and performance.
The level of contribution was such that Robert, Martin and I couldn't always make changes at a rate which was satisfactory to those asking for changes. As a result, in mid-1997 we established a larger "core group" who can make changes to the source code CVS archive. This group currently consists of:

Doug Bates, Peter Dalgaard, 
Robert Gentleman, Kurt Hornik, 
Ross Ihaka, Friedrich Leisch, 
Thomas Lumley, Martin Mächler, 
Paul Murrell, Heiner Schwarte, 
and Luke Tierney.

Since all work on R is strictly of a voluntary nature, the organisation is very loose, with members contributing when and as they can.