[R] List of Words in BioWordVec

2024-02-01 Thread TJUN KIAT TEO
Is there a way to extract list of words in BioWordVec in R Thank you Tjun Kiat [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Applying a function to dataframe column where the function value depends on the value of another column

2020-06-05 Thread TJUN KIAT TEO
Suppose I have a dataframe in this from a b c g 2 3 h 4 5 i 6 7 I want to apply a function to individual elements of column C where the function value depends on the value of column A [[alternative HTML version deleted]] __

[R] Subclass Prediction

2016-10-13 Thread TJUN KIAT TEO
I am trying to work clustering problem where I actually know the sublcass. For example Suppose I am trying to predict cluster patients a group of people into male and female where I actually know the label male and female but I take it I don't know Suppose my clustering method produces

[R] Installing Caret

2016-06-16 Thread TJUN KIAT TEO
I am trying to install the package but am I keep getting this error messages installation of package ��minqa�� had non-zero exit status 2: In install.packages("caret", repos = "http://cran.stat.ucla.edu/;) : installation of package ��RcppEigen�� had non-zero exit status 3: In

Re: [R] Cut Dates into bins

2016-06-07 Thread TJUN KIAT TEO
ins > To: teotj...@hotmail.com > CC: r-help@r-project.org > > Hi Tjun Kiat, > This seems to work: > > daily_date<-as.Date(paste("2000-01",1:28,sep="-"),"%Y-%m-%d") > weekly_date<-as.Date(paste(c(1,8,15,22,28),"01/2000",sep="

[R] Matrix of Lists containing numbers and characters

2016-01-25 Thread TJUN KIAT TEO
Here is my sample code TunePar<-matrix(list(Null),2,2) TunePar[[1,1]]=list(subclasses=3,model="gen.ridge") tune=paste(colnames(Temp),Temp,sep="=") tune=paste(tune,collapse=",") However when I type tune This is what I get "subclasses=3,model=1" The text "gen.ridge has been converted to the

[R] Writing a matrix of lists as a CSV file

2016-01-14 Thread TJUN KIAT TEO
I have a matrix of lists in R that looks like this Crabs Glass nnet List,2 List,2rf List,1 List,1 An example of what a list looks like in the matrix size decay63 0.1 How can I write it into a csv file in R so I can retrieve it in the same format? Thanks

[R] CSimca

2015-10-05 Thread TJUN KIAT TEO
Does anyone knows how to return the prediction probabilities for CSimca function for rrcovHD package? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

[R] Convert time format to character

2014-11-03 Thread TJUN KIAT TEO
Suppose I have a object in time format 2014-08-13 00:30:00 I want to convert it to a character string 20140813003000 Is is possible ? Tjun Kiat [[alternative HTML version deleted]] __

[R] Variable Length Differ

2014-11-02 Thread TJUN KIAT TEO
This is my code BSUPred-(forecast(BSU,h=h)[[2]]) PressurePred-(forecast(Pressure,h=h)[[2]]) Placer-(rep(1,h)) test-as.data.frame(cbind(BSUPred,PressurePred)) test$Placer-rep(1:2,h/12) test$Placer-i test-as.data.frame((test[c(Placer,BSUPred,PressurePred)]))

[R] Fine Tuning Parameters for LogReg in Caret

2014-10-24 Thread TJUN KIAT TEO
Is there a guide somewhere on how to set the tuning parameters for logistic regression in Caret ? Tjun Kiat [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Loading a rda file for predicton

2014-10-13 Thread TJUN KIAT TEO
I tried this fit-glm(Pred~Pressure+MissingStep, data = Test, family=binomial) save(fit,file=pred.rda) pred-load(pred.rda) predict(pred,Testsamp,type=response)

[R] Assigning a factor to a data frame

2014-01-27 Thread Tjun Kiat Teo
I created an an empty data frame this way: forsentest-data.frame(matrix(nrow=nod,ncol=f)). Then I tried to assign one row of another data frame forsen to it forsentest[1,]-forsen[1,] But the factors in forsen gets converted to numbers in forsentest which is not what I want. Is there another

[R] MDA

2013-08-06 Thread Tjun Kiat Teo
I am trying to use the package mda And this is my command mdfit-mda(factor(forsen[,f]) ~ .,data=forsen[,-f],subclasses=sc) But I keep getting this error message on a particular data set Error in maxdist[l] - x[l, i] : NAs are not allowed in subscripted assignments Can anyone help ? Thanks

[R] EMMIX

2013-08-01 Thread Tjun Kiat Teo
Is the R package EMMIX available ? I tried installing it and it keeps saying the package is not available for R verseion 3.0.1 teotjunk [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Fitting Mixture distributions

2013-07-16 Thread Tjun Kiat Teo
distributions ? Tjun Kiat Teo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] Generalized Cholesky Inverse

2013-07-02 Thread Tjun Kiat Teo
Yap. I did load the package bdsmatrix On Fri, Jun 21, 2013 at 8:26 AM, Pascal Oettli kri...@ymail.com wrote: Hi, Did you load bdsmatrix? Regards, Pascal 2013/6/21 Tjun Kiat Teo teotj...@gmail.com What are the possible options I have for Generalized choleksy Inverse in R. I tried

[R] Installing Jags on 64 Bit Fedora

2013-06-20 Thread Tjun Kiat Teo
I know this has been covered before but I have read all the posts on this subject but I still cannot resolve it. I tried to install rjags on a 64bit Fedora 17 and I got this error message Error : .onLoad failed in loadNamespace() for 'rjags', details: call: dyn.load(file, DLLpath = DLLpath,

[R] Generalized Cholesky Inverse

2013-06-20 Thread Tjun Kiat Teo
What are the possible options I have for Generalized choleksy Inverse in R. I tried to use the package bdsmatrix and and was given the error message function solve.gchol does not exist. Thanks Tjun Kiat [[alternative HTML version deleted]] __

[R] Bayes Logit and Cholesky Decomposition

2013-05-27 Thread Tjun Kiat Teo
I am trying to use the package Bayes Logit and I keep getting this error message. chol2inv(chol(P1.j)) : error in evaluating the argument 'x' in selecting a method for function 'chol2inv': Error in chol.default(P1.j) : the leading minor of order 5 is not positive definite I can't see why

[R] ODE solver

2013-05-02 Thread Tjun Kiat Teo
I am trying to use the package ode and periodically it will come up with this error message Warning..Internal T (=R1) and H (=R2) are such that in the machine, T + H = T on the next step (H = step size). Solver will continue anyway. And then the program just take very long to run. Is there

[R] Multicore/Parallel

2012-12-27 Thread Tjun Kiat Teo
I am using the package Multicore/Parallel to do importance sampling. I have 5 cores on my computer. And I have let's say 10 000 particles to generate. What I did was to send 5 particles in each time, calling the package parallel. Which means in all I am calling the parallel command 2000 times.

[R] Picking out certain elements in an matrix

2012-12-15 Thread Tjun Kiat Teo
Suppose I have a matrix of data A 1 2 3 4 5 6 7 8 9 And I have a vector of indexes 2,1,3 For row 1 of matrix A I want the 2nd element 2 For row 2 of matrix A I want the 1st element 4 For row 3 of matrix A I want the 3rd element 9. Is there a quick way to do it ? Tjun Kiat

[R] Bayes Logit

2012-11-24 Thread Tjun Kiat Teo
I tried to use mlogit.R in the package Bayes Logit and got this error message Error in .C(rpg_devroye, x, as.integer(n), z, as.integer(num), PACKAGE = BayesLogit) : C symbol name rpg_devroye not in DLL for package BayesLogit) Can anyone help? Thanks Tjun Kiat [[alternative HTML

[R] Up key is not the previous command

2012-10-08 Thread Tjun Kiat Teo
I am using R on Fedora 17 and the up arrow is not the previous command. On my command line on my terminal, the up arrow is the previous command Tjun Kiat __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] Simulating from probit

2012-09-25 Thread Tjun Kiat Teo
Is there anyway to simulate random deviates from probit ? Tjun Kiat __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented,

[R] parallel

2012-09-24 Thread Tjun Kiat Teo
Does the function parallel work for windows ? Tjun Kiat __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

[R] Parallel Programming

2012-09-20 Thread Tjun Kiat Teo
I am trying to do parallel programming and I tried this library(doSNOW) library(foreach) testfunc-function(x){ x-x+1 x } noc-2 cl - makeCluster(do.call(rbind,rep(list(localhost),noc)), type = SOCK) registerDoSNOW(cl) clusterExport(cl=cl,c(testfunc.r)) testl-foreach(pp=1:2) %dopar% {

[R] Defining a variable outside of optim or differential equation solver.

2012-07-17 Thread Tjun Kiat Teo
This is applicable to either using optim or the differential equation solver or any similar solver Suppose I want to use the differential equation solver and this is my code d-y[2] vdpol-function(t,y) { list(c(1, d, 3, 4 ) }

[R] Wrapper function for multivariate arrays for ode

2012-07-02 Thread Tjun Kiat Teo
I am trying to to write a wrapper function for the ode solver (under the package desolve) to enable it to take multivariate arrays. I know how to do it for 1 dimension arrays but my code breaks down when I try to do it for 2 dimensional arrays. Here is my code