One way to do so is the following: Open a new document-perhaps in WORD or a PowerPoint slideshow. Suppose you wish to take output-including plots-from R and place it in a document.Except for an occasional quick test-or accessing the help-it is strongly suggested that you enter all your commands in the upper left. However, in this case they will not be saved. – You could actually just type in your commands into the console and run them line-by-line. Temperature Save (It is good practice to regularly save a file on which you are working during your R-session). (Make sure that you follow each line with a carriage return.) Then use the “mean” function to find the mean of the 8 temperature values. Enter the temperature data as a vector with the 8 values (2, 4, 6, 8, 10, 12, 14, 16) as the components of the vector. Start by entering the following code in the upper left quadrant.You have observations on temperature and heart rate for 8 frogs. Suppose now that you wish to analyze some data from a study examining the relationship between heart rate (in beats per minute) and environmental temperature (in degrees C) for the common grass frog. Save it with a name that conveys some meaning to you-such as rtest.R (the “.R” at the end is necessary and indicates that your file is a R file extension). Using the menu, choose “File > New File > R Script”. E.g., type in 3 + 6 and return and observe that the answer given is 9. Experiment a little using just the console.However, R-studio provides many advantages and you should use that for your work.) (If you were to open the R program by itself-and not R-studio-you would essentially be seeing the lower left-or console-portion of the R-studio screen. The bottom left part, “Console”, contains the commands that are actually run by R. You can think of the top left portion as an editor. You will be entering all of your commands on the two parts on the left. You will notice that the screen is roughly divided into 4 parts. Start R-Studio by clicking on it (Do not start R directly). ![]() This is where you will place your R files, data files, and also files with computer output, including plots. ![]()
0 Comments
Leave a Reply. |