How to plot the data I read from a file in R?
up vote
0
down vote
favorite
Our instructor assigned us with typing a R script. We don't have any study paper or source for the codes that the instructor typed on class so I'm trying to get help from the articles on internet but I still couldn't find a guide for what I need. Please don't get me wrong, I don't request for someone to do my homework I'm just looking for some tips or any guide links that can help me. When I search on google, not all of the results are related to this and they are usually not helping me or too complicated. The assignment is:
- Read data from a .txt file. (I researched and learned how to read data but my problem is I don't know which type of data should I type on the text file to make it plottable by average, standart deviation, histogram etc.)
- On the first screen, plot the data, plot the average and plot the standart deviation as line
- on the second screen, plot a line from corner to corner and sort the values on it
- third screen, plot the data as histogram and plot the distribution function on it
- 4th screen, plot the anomaly and anomaly line = 0, then make the values that are higher than the anomaly line with different pch than the ones that is lower
- finally get the png of 4 screens (i found how to do this)
Thanks.
r plot
add a comment |
up vote
0
down vote
favorite
Our instructor assigned us with typing a R script. We don't have any study paper or source for the codes that the instructor typed on class so I'm trying to get help from the articles on internet but I still couldn't find a guide for what I need. Please don't get me wrong, I don't request for someone to do my homework I'm just looking for some tips or any guide links that can help me. When I search on google, not all of the results are related to this and they are usually not helping me or too complicated. The assignment is:
- Read data from a .txt file. (I researched and learned how to read data but my problem is I don't know which type of data should I type on the text file to make it plottable by average, standart deviation, histogram etc.)
- On the first screen, plot the data, plot the average and plot the standart deviation as line
- on the second screen, plot a line from corner to corner and sort the values on it
- third screen, plot the data as histogram and plot the distribution function on it
- 4th screen, plot the anomaly and anomaly line = 0, then make the values that are higher than the anomaly line with different pch than the ones that is lower
- finally get the png of 4 screens (i found how to do this)
Thanks.
r plot
There were no books assigned for the class? Given the scope of this assignment, it's difficult to believe that there hasn't been a lead up to this assignment.
– hrbrmstr
Nov 8 at 11:33
This is a very usefull guide: cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf
– Santiago I. Hurtado
Nov 8 at 11:37
@SantiagoHurtado I disagree. For one thing it’s severely outdated. For another, it starts off with lots of irrelevant low-level details. That’s a bad way of teaching. I recommend a modern approach, e.g.*R for Data Science* by Grolemund and Wickham instead.
– Konrad Rudolph
Nov 8 at 11:48
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Our instructor assigned us with typing a R script. We don't have any study paper or source for the codes that the instructor typed on class so I'm trying to get help from the articles on internet but I still couldn't find a guide for what I need. Please don't get me wrong, I don't request for someone to do my homework I'm just looking for some tips or any guide links that can help me. When I search on google, not all of the results are related to this and they are usually not helping me or too complicated. The assignment is:
- Read data from a .txt file. (I researched and learned how to read data but my problem is I don't know which type of data should I type on the text file to make it plottable by average, standart deviation, histogram etc.)
- On the first screen, plot the data, plot the average and plot the standart deviation as line
- on the second screen, plot a line from corner to corner and sort the values on it
- third screen, plot the data as histogram and plot the distribution function on it
- 4th screen, plot the anomaly and anomaly line = 0, then make the values that are higher than the anomaly line with different pch than the ones that is lower
- finally get the png of 4 screens (i found how to do this)
Thanks.
r plot
Our instructor assigned us with typing a R script. We don't have any study paper or source for the codes that the instructor typed on class so I'm trying to get help from the articles on internet but I still couldn't find a guide for what I need. Please don't get me wrong, I don't request for someone to do my homework I'm just looking for some tips or any guide links that can help me. When I search on google, not all of the results are related to this and they are usually not helping me or too complicated. The assignment is:
- Read data from a .txt file. (I researched and learned how to read data but my problem is I don't know which type of data should I type on the text file to make it plottable by average, standart deviation, histogram etc.)
- On the first screen, plot the data, plot the average and plot the standart deviation as line
- on the second screen, plot a line from corner to corner and sort the values on it
- third screen, plot the data as histogram and plot the distribution function on it
- 4th screen, plot the anomaly and anomaly line = 0, then make the values that are higher than the anomaly line with different pch than the ones that is lower
- finally get the png of 4 screens (i found how to do this)
Thanks.
r plot
r plot
edited Nov 8 at 11:32
hrbrmstr
59.6k585146
59.6k585146
asked Nov 8 at 11:31
user10623131
There were no books assigned for the class? Given the scope of this assignment, it's difficult to believe that there hasn't been a lead up to this assignment.
– hrbrmstr
Nov 8 at 11:33
This is a very usefull guide: cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf
– Santiago I. Hurtado
Nov 8 at 11:37
@SantiagoHurtado I disagree. For one thing it’s severely outdated. For another, it starts off with lots of irrelevant low-level details. That’s a bad way of teaching. I recommend a modern approach, e.g.*R for Data Science* by Grolemund and Wickham instead.
– Konrad Rudolph
Nov 8 at 11:48
add a comment |
There were no books assigned for the class? Given the scope of this assignment, it's difficult to believe that there hasn't been a lead up to this assignment.
– hrbrmstr
Nov 8 at 11:33
This is a very usefull guide: cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf
– Santiago I. Hurtado
Nov 8 at 11:37
@SantiagoHurtado I disagree. For one thing it’s severely outdated. For another, it starts off with lots of irrelevant low-level details. That’s a bad way of teaching. I recommend a modern approach, e.g.*R for Data Science* by Grolemund and Wickham instead.
– Konrad Rudolph
Nov 8 at 11:48
There were no books assigned for the class? Given the scope of this assignment, it's difficult to believe that there hasn't been a lead up to this assignment.
– hrbrmstr
Nov 8 at 11:33
There were no books assigned for the class? Given the scope of this assignment, it's difficult to believe that there hasn't been a lead up to this assignment.
– hrbrmstr
Nov 8 at 11:33
This is a very usefull guide: cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf
– Santiago I. Hurtado
Nov 8 at 11:37
This is a very usefull guide: cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf
– Santiago I. Hurtado
Nov 8 at 11:37
@SantiagoHurtado I disagree. For one thing it’s severely outdated. For another, it starts off with lots of irrelevant low-level details. That’s a bad way of teaching. I recommend a modern approach, e.g.*R for Data Science* by Grolemund and Wickham instead.
– Konrad Rudolph
Nov 8 at 11:48
@SantiagoHurtado I disagree. For one thing it’s severely outdated. For another, it starts off with lots of irrelevant low-level details. That’s a bad way of teaching. I recommend a modern approach, e.g.*R for Data Science* by Grolemund and Wickham instead.
– Konrad Rudolph
Nov 8 at 11:48
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
Which type of data?
You should use metric data. For example the height/age of pople.
For example let's assuhe you have a dataframe yourDataframe:
height
160
155
176
153
185
On the first screen, plot the data
You can use R's standard plot function there: lines(yourDataframe$height)
plot the average and plot the standart deviation
There are already function for those things (for example mean(yourDataframe$height)). Just ask Google.
You can add those values to your linechart using points(mean(yourDataframe$height)).
I think after you did this you will be able to solve the rest of your assignment by yourself. R has quite a big community and you will find everything you need by googling. I guess this is how most people learn R.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Which type of data?
You should use metric data. For example the height/age of pople.
For example let's assuhe you have a dataframe yourDataframe:
height
160
155
176
153
185
On the first screen, plot the data
You can use R's standard plot function there: lines(yourDataframe$height)
plot the average and plot the standart deviation
There are already function for those things (for example mean(yourDataframe$height)). Just ask Google.
You can add those values to your linechart using points(mean(yourDataframe$height)).
I think after you did this you will be able to solve the rest of your assignment by yourself. R has quite a big community and you will find everything you need by googling. I guess this is how most people learn R.
add a comment |
up vote
1
down vote
Which type of data?
You should use metric data. For example the height/age of pople.
For example let's assuhe you have a dataframe yourDataframe:
height
160
155
176
153
185
On the first screen, plot the data
You can use R's standard plot function there: lines(yourDataframe$height)
plot the average and plot the standart deviation
There are already function for those things (for example mean(yourDataframe$height)). Just ask Google.
You can add those values to your linechart using points(mean(yourDataframe$height)).
I think after you did this you will be able to solve the rest of your assignment by yourself. R has quite a big community and you will find everything you need by googling. I guess this is how most people learn R.
add a comment |
up vote
1
down vote
up vote
1
down vote
Which type of data?
You should use metric data. For example the height/age of pople.
For example let's assuhe you have a dataframe yourDataframe:
height
160
155
176
153
185
On the first screen, plot the data
You can use R's standard plot function there: lines(yourDataframe$height)
plot the average and plot the standart deviation
There are already function for those things (for example mean(yourDataframe$height)). Just ask Google.
You can add those values to your linechart using points(mean(yourDataframe$height)).
I think after you did this you will be able to solve the rest of your assignment by yourself. R has quite a big community and you will find everything you need by googling. I guess this is how most people learn R.
Which type of data?
You should use metric data. For example the height/age of pople.
For example let's assuhe you have a dataframe yourDataframe:
height
160
155
176
153
185
On the first screen, plot the data
You can use R's standard plot function there: lines(yourDataframe$height)
plot the average and plot the standart deviation
There are already function for those things (for example mean(yourDataframe$height)). Just ask Google.
You can add those values to your linechart using points(mean(yourDataframe$height)).
I think after you did this you will be able to solve the rest of your assignment by yourself. R has quite a big community and you will find everything you need by googling. I guess this is how most people learn R.
edited Nov 8 at 12:23
answered Nov 8 at 12:16
Ramona
689
689
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206898%2fhow-to-plot-the-data-i-read-from-a-file-in-r%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
There were no books assigned for the class? Given the scope of this assignment, it's difficult to believe that there hasn't been a lead up to this assignment.
– hrbrmstr
Nov 8 at 11:33
This is a very usefull guide: cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf
– Santiago I. Hurtado
Nov 8 at 11:37
@SantiagoHurtado I disagree. For one thing it’s severely outdated. For another, it starts off with lots of irrelevant low-level details. That’s a bad way of teaching. I recommend a modern approach, e.g.*R for Data Science* by Grolemund and Wickham instead.
– Konrad Rudolph
Nov 8 at 11:48