Displaying 6 results from an estimated 6 matches for "suphajak".
2010 Jul 20
3
Sequence from 2 Vectors
...at is a sequence from 2 vectors. Could
anyone provide suggestion on this?
For example
> a<-c(1,2,3)
> b<-a+2
> b
[1] 3 4 5
I would like to have a vector that is a sequence which starting from a
and ending at b
c = c(1:3,2:4,3:5)
c = c(1,2,3,2,3,4,3,4,5)
Thank you
Best Regards,
Suphajak Ngamlak
Equity and Derivatives Trading
Phatra Securities Public Company Limited
Tel: +662-305-9179
Email: suphajak@phatrasecurities.com
[[alternative HTML version deleted]]
2010 Sep 15
2
Get File Names in Folder, Read Files, Update, and Write
...Import<-"C:/A0810.RSK"
Table<-read.table(file= Import, sep = ",", head=TRUE, na.strings = "NA")
Table$VALUE <-0
Export<-"C:/A_XVal0810.RSK"
write.table(Table, file= Export, sep = ",", col.names = TRUE)
Thank you
Best Regards,
Suphajak Ngamlak
Equity and Derivatives Trading
Phatra Securities Public Company Limited
Tel: +662-305-9179
Email: suphajak@phatrasecurities.com
[[alternative HTML version deleted]]
2010 Nov 09
2
Calculate Mean from List
...[2,1])/n
Average cor(A,C) = (A[[1]][3,1] + A[[2]] [3,1] + ... + A[[n]] [3,1])/n
Average cor(B,C) = (A[[1]][3,2] + A[[2]] [3,2] + ... + A[[n]] [3,2])/n
Please note that some cells are NA; so I need to remove them when calculating average.
How could I get this efficiently? Thank you
Best Regards,
Suphajak Ngamlak
Equity and Derivatives Trading
Phatra Securities Public Company Limited
Tel: (66)2-305-9179
Email: suphajak@phatrasecurities.com
[[alternative HTML version deleted]]
2010 Aug 04
1
SQLDF from Variable Matrix
...;-function(Input,Bygroup){
AVG<-fn$sqldf("select A, avg(B) as Average, median(B) as Median
from $Input
group by $Bygroup")
return(AVG)
}
Result<-GetAvg(Test,'A')
The only difference is with $Input. How can I refer to this variable in
sqldf. Thank you
Best Regards,
Suphajak Ngamlak
Equity and Derivatives Trading
Phatra Securities Public Company Limited
Tel: +662-305-9179
Email: suphajak@phatrasecurities.com
[[alternative HTML version deleted]]
2011 Sep 07
1
Weight in Function RM
...-paste("IndSub3")
Weight <- c(0.1,0.4,0.3,0.2)
Result<- lm(formula = MatY~IndSub1+IndSub2+IndSub3-1, data = Data, weight = Weight)
summary(Result)
Data2 <- Data*Weight
Result2<- lm(formula = MatY~IndSub1+IndSub2+IndSub3-1, data = Data2)
summary(Result2)
Best Regards,
Suphajak Ngamlak
Asset Management (Hedge Fund)
Phatra Securities Public Company Limited
Tel: (66)2-305-9179
Email: suphajak@phatrasecurities.com
---------------------------------------------------------------------------------------------------------------------------------------------------------------...
2010 Nov 25
1
Execute SQL Stored Procedure in R
...table resulting from execute sql stored procedures. What function can I use? Can RODBC do it.
I tried
channel1 <- odbcConnect("ptsecmstqa01-alpha")
query <- paste("execute DB.dbo.usp_test")
Data<- sqlQuery(channel1, query)
However, it returned blank.
Best Regards,
Suphajak Ngamlak
Equity and Derivatives Trading
Phatra Securities Public Company Limited
Tel: (66)2-305-9179
Email: suphajak@phatrasecurities.com
[[alternative HTML version deleted]]