It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a .csv file in my workstation. How can I open that file in R and do statistical calculation?
You would use the read.csv function; for example:
dat = read.csv("spam.csv", header = TRUE)
You can also reference this tutorial for more details.
Note: make sure the .csv file to read is in your working directory (using getwd()) or specify the right path to file. If you want, you can set the current directory using setwd.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How do we find the solution of x
say in
2*x=6
using R?
It must be very trivial but I cant find out the appropriate answer.
You can use the solve() function, which can actually handle multiple equations:
solve(2, 6)
The first argument is the left side of the equation, the second is the right side.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How to find all the files that were last modified in some particular month, Lets say March.
LANG=C find -printf '%AY %Ab %p\n' | awk '$1=="2013" && $2="Mar"{$1=$2="";print}'
And like stated before in the thread, ls is a tool for interactively looking at file information. Its output is formatted for humans and will cause bugs in scripts. Use find instead. Understand why: http://mywiki.wooledge.org/ParsingLs
This is a great command for this problem:
find . -mtime +100 -mtime -200
In particular, this will find all files modified more than 100 days ago and less than 200 days ago. Modify the numbers accordingly!
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I would like to generate an interactive plot with R, for example an xyplot that shows information of the data points on mouseover, and I've read about D3. I would like to be able to write R code to generate the D3 html pages automatically. Is there any R package able to do that?
I've seen there is a r2d3 package on github but I am not sure how far that project is. Any ideas?
Looks to be fairly early in its development: https://github.com/hadley/r2d3. Hadley generally makes announcements when things are ready to test and then puts his packages on CRAN when they are ready for prime-time. (There's also confusion in that some versions of D3 on Github are named r2d3 when they have nothing to do with R): https://www.google.com/url?q=https://github.com/mhemesath/r2d3&sa=U&ei=Ig-YULraMueimQWxhYHgCA&ved=0CAwQFjAC&client=internal-uds-cse&usg=AFQjCNGe9p5iKH6deoHDpd2yKHJds8Qdow
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a huge csv file of sports (EPL) data which encompasses player performance in every game for their respective teams. I would like to run a loop to compare the amount of times a team has scored first in a match (the data is called First.Goal).
I know how to calculate them individually, e.g for Liverpool from a csv called Prem1112:
Prem<-read.csv("Prem1112.csv")
sum(subset(Prem,Team=='Liverpool',First.Goal))
Ideally I'd like to run the loop so I wouldn't have to calculate all 20 teams individually. Any ideas?
What about this:
aggregate(First.Goal ~ Team, Prem, sum)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
write command to print time in 24 hour format in unix.
Just use the date command:
Details:
man date
Just Try:
date -d %R