Displaying 4 results from an estimated 4 matches for "newtemp".
Did you mean:
  new_temp
  
2009 Dec 08
1
Printing 'k' levels of factors 'n' times each, but 'n' is unequal for all levels ?
...unequal number of elements.
Example with code is as below:
vc<-read.table("P:\\Transit\\CORRECT 
files\\Everything-newest.csv",header=T, sep=",", dec=".", na.strings=NA, 
strip.white=T)
vcdf<-data.frame(vc)
tempdf<-data.frame(cbind(vcdf[,1:3], vcdf[,429]))
newtemp<-na.exclude(tempdf)
newtemp[,2]<-factor(newtemp[,2])
groupmean<-tapply(newtemp[,4], newtemp[,2], mean)
newmark<-factor(groupmean, exclude=(groupmean==0 | groupmean==1))
newmark
This is what the output is (going up to 61 levels)
1                  2                  3...
2010 Aug 10
3
sapply/lapply instead of loop
Using the input below, can I do something more elegant (and more efficient)
than the loop also listed below to pad strings to a width of 5? The true
matrix is about 300K rows and 31 columns. 
#######################
#INPUT
#######################
> temp
    DX1   DX2   DX3
1 13761  8125 49178
2 63371   v75 22237
3 51745 77703 93500
4 64081 32826   v72
5 78477 43828 87645
> 
2011 Mar 07
1
Associating the day of week to a daily xts object
...f class: [POSIXct,POSIXt] TZ: GMT
  xts Attributes:  
 NULL
> temp
                  t_n
2010-12-26  2.9500000
2010-12-27  0.8520833
2010-12-28 -0.1390625
...........
I would like to associate another column with the day of week in the form of 1=Mon, 2=Tue, ..., 7=Sun
in order to obtain:
>newtemp
                  t_n                     dow
2010-12-26  2.9500000    7
2010-12-27  0.8520833    1
2010-12-28 -0.1390625    2
..............
How could make this in the shortest (and elegant?) way?
Ciao from Rome
Vittorio
2013 May 11
1
clean wheezy, R intrigue, squeeze-cran3 requires liblzma2?
...t. It takes all pdf in a directory
## and embeds fonts.
##
## Todo: Make command line argument smarter, so that if user
## gives whatever.pdf, it will handle that, or
## if user gives a directory name, it will go in there and do it.
for i in *.pdf; do
base=`basename $i .pdf`;
basenew="${base}newtemp.pdf"
  /usr/bin/gs -o $basenew -dNOPAUSE -dPDFSETTINGS=/prepress
-sDEVICE=pdfwrite $i
mv -f $basenew $i
done;
-- 
Paul E. Johnson
Professor, Political Science      Assoc. Director
1541 Lilac Lane, Room 504      Center for Research Methods
University of Kansas                 University of...