monkeymike.co.uk

September 3, 2010

auto save on exit with R

Filed under: R hints and Tips — @ 7:49 pm

"C:\Program Files\R\R-2.10.0\bin\Rgui.exe" --save

May 20, 2010

Dual ordinate plots

Filed under: LaTEX — @ 9:25 pm

###dual ordinate Plot in R
###################################
###par(mar=c(5,4,4,4))
plot(ae3$wait.med,type="l", col=2, ylim=c(0,150))
par(new=T)
plot(ae3$wait.N,type="l",axes=F, col=4,ylim=c(0,6500))
axis(side=4)
#######################################

May 12, 2010

sql access part 2 with boxplot and big query

Filed under: R hints and Tips — @ 8:05 pm

##load the required bits
library(RODBC)
library(lattice)
##set up the connection
channel<-odbcConnect("mike_db", uid="mike")
##sqlTables(channel)
##a<-sqlFetch(channel,"AnE")
##b<-sqlFetch(channel,"vwAnE")
##b<-sqlQuery(channel, paste("select * from vwAnE order by loc, month_val"))
##xyplot(N~month_val|LOC,b, type="l")

##c<-sqlQuery(channel, paste("select CM,sum(numerator)"
## ,"from EP_2010_2011_ENHANCED"#
## , "WHERE not parnt like 'z_%' "
## ," group by CM"
## ))

##execute a query for the data
e<-sqlQuery(channel, paste("select CM,aggregate_02,spect,Numerator,denominator,value,target, year_month+'-01' as year_month"
,"from EP_2010_2011_ENHANCED"
,"where 1=1 and CM like '%e_01%'and TIME_TYPE='per-month'"
,"and parnt like 'z_t%'order by aggregate_02,spect,year_month"))
##convert the year_month value to a date

e$year_month<-as.Date(e$year_month)

##plot the lattice

xyplot(value~year_month|spect,e, type="l", cex=3)

xyplot(value+target~year_month|spect,e, type="l", size=5)

MS SQL access

Filed under: R hints and Tips — @ 5:20 am

library(RODBC)
channel<-odbcConnect("mike_db", uid="mike")
sqlTables(channel)
a<-sqlFetch(channel,"AnE")
b<-sqlFetch(channel,"vwAnE")
b<-sqlQuery(channel, paste("select * from vwAnE order by loc, month_val"))
xyplot(N~month_val|LOC,b, type="l")

April 15, 2010

add a username to receive ROOTs system mail

Filed under: Linux — @ 5:49 am

sudo gedit /etc/aliases

then change the line
#root: marc

February 23, 2010

dumping shell output to a file

Filed under: LaTEX — @ 6:48 am

find /home/user_name/Music > file_list_text_file_name.txt

December 28, 2009

http://www.cs.virginia.edu/~evans/cs216/guides/x86.html

Filed under: LaTEX — @ 8:44 pm

http://www.cs.virginia.edu/~evans/cs216/guides/x86.html

December 17, 2009

Update query syntax

Filed under: T-SQL Hints tips and snippets — @ 6:46 am

UPDATE Your_table_name_here
SET Your_field_name_here = your_value_to_update_here
WHERE your_logical_condition_here

December 15, 2009

Extract data from a ‘challenged’ tar.gz archive

Filed under: Linux — @ 7:26 am

gunzip < yourfilenamehere.tar.gz > OutputFileName.tar.part

October 31, 2009

Stop firefox using konquerer to open folders

Filed under: LaTEX — @ 8:11 pm

under fedora 11 look in /usr/share/applications/ for the file gnome-nautilus-folder-handler and remove the line with the semi colon near the end.

Older Posts »

Powered by WordPress