Last active
February 11, 2016 13:03
-
-
Save Millnert/c4e01f7b5e33741ba5d0 to your computer and use it in GitHub Desktop.
dfri-nmembers-rscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
infile=$1 | |
echo "date,members" > out.data | |
sed -e 's/^nmembers[ \t]*\([0-9\-]*\)[ \t]*\(.*\)$/\1,\2/g' $infile >> out.data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# requires r-base installed (providing RScript binary) | |
bash preproc.sh sampledata.txt | |
Rscript script.R |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nmembers 2014-04-11 34 | |
nmembers 2015-04-11 54 | |
nmembers 2015-05-11 66 | |
nmembers 2015-10-11 76 | |
nmembers 2016-01-11 84 | |
nmembers 2016-02-10 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mydata = read.csv('out.data') | |
mydata$date <- strptime(mydata$date, "%Y-%m-%d") | |
png("dfri_members.png") | |
plot(mydata$date, mydata$members, main="DFRI Members", xlab="Time", ylab="Members") | |
lines(mydata$date, mydata$members, type='o') | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment