From aayushi.gupta94 at yahoo.com Mon Jun 5 08:10:02 2017 From: aayushi.gupta94 at yahoo.com (aayushi gupta) Date: Sun, 4 Jun 2017 23:10:02 -0700 (PDT) Subject: [datatable-help] craeating vectors Message-ID: <1496643002921-4736241.post@n4.nabble.com> Hi How can I create 100 vectors with 1000elements each such that my first vector has 1st and 501th element as 1 and rest all elements are 0, second vector has 2nd and 502th element as 1 and rest all are 0 and so on. -- View this message in context: http://r.789695.n4.nabble.com/craeating-vectors-tp4736241.html Sent from the datatable-help mailing list archive at Nabble.com. From rluech at gmail.com Mon Jun 5 17:24:38 2017 From: rluech at gmail.com (rlue) Date: Mon, 5 Jun 2017 08:24:38 -0700 (PDT) Subject: [datatable-help] craeating vectors In-Reply-To: <1496643002921-4736241.post@n4.nabble.com> References: <1496643002921-4736241.post@n4.nabble.com> Message-ID: <1496676278581-4736374.post@n4.nabble.com> mx <- matrix(rep(rep(0L, 1000), 100), ncol = 100) index <- c(0, 500) for(i in seq(ncol(mx))) mx[index+i, i] <- 1 # check mx[c(1:5, 500:505), 1:10] # check apply(mx, 2, function(x) which(x == 1)) -- View this message in context: http://r.789695.n4.nabble.com/craeating-vectors-tp4736241p4736374.html Sent from the datatable-help mailing list archive at Nabble.com. From kvsreddy.sas at gmail.com Thu Jun 15 12:33:55 2017 From: kvsreddy.sas at gmail.com (srt123) Date: Thu, 15 Jun 2017 03:33:55 -0700 (PDT) Subject: [datatable-help] How to replace missing value with immediate matching/+-5 of corresponding previous value Message-ID: <1497522835510-4738088.post@n4.nabble.com> Hi, I have a data frame as below , how to replace NA values with immediate matching value with col2 (eg. for row.id == 3 - if we round col2 value then value is 36 and its immediate matching previous value is 35.96 and same for row.id == 6 and row.id == 4) row.id date col1 col2 1 2014-02-28 23 38.1 2 2014-02-26 20 35.96 3 2014-02-27 NA 36.1 4 2014-02-08 10 25.22 5 2014-02-09 11 26.23 6 2014-02-11 NA 25.10 output would be row.id date col1 col2 1 2014-02-28 23 38.1 2 2014-02-26 20 35.96 3 2014-02-27 20 36.1 4 2014-02-08 10 25.22 5 2014-02-09 11 26.23 6 2014-02-11 10 25.10 -- View this message in context: http://r.789695.n4.nabble.com/How-to-replace-missing-value-with-immediate-matching-5-of-corresponding-previous-value-tp4738088.html Sent from the datatable-help mailing list archive at Nabble.com. From christophe.crambes at univ-montp2.fr Thu Jun 15 16:14:01 2017 From: christophe.crambes at univ-montp2.fr (crambeschris) Date: Thu, 15 Jun 2017 07:14:01 -0700 (PDT) Subject: [datatable-help] Mclust function Message-ID: <1497536041849-4738111.post@n4.nabble.com> Hello, I am using the R function Mclust for clustering. My database is called motivensclassif My R command is >motivens.clust.3=Mclust(motivensclassif,G=3) The means of the 3 groups are given by >motivens.clust.3$parameters$mean I am surprized that these means does not correspond of the means computed directly with the R function mean. Does anyone have some experience with this? Thanks in advance -- View this message in context: http://r.789695.n4.nabble.com/Mclust-function-tp4738111.html Sent from the datatable-help mailing list archive at Nabble.com. From jkc.kiran at yahoo.co.in Thu Jun 22 08:16:20 2017 From: jkc.kiran at yahoo.co.in (JKC) Date: Wed, 21 Jun 2017 23:16:20 -0700 (PDT) Subject: [datatable-help] R - tm.plugin.webmining Package's WebCorpus function is not working Message-ID: <1498112180745-4739987.post@n4.nabble.com> Hi. I am currently working on an assignment where I need to fetch news feed from various sources and store in a corpus in R.I have successfully installed the packages "tm" and "tm.plugin.webmining". But when I execute the following command it is ending up with an error mentioned further below.install.packages("tm")install.packages("tm.plugin.webmining")library(tm)library(tm.plugin.webmining)*corpus <- WebCorpus(GoogleFinanceSource("AAPL"))*/No such file or directoryfailed to load external entity "http://www.google.com/finance/company_news?hl=en&q=AAPL&ie=utf-8&start=0&num=20&output=rss"Error: 1: No such file or directory2: failed to load external entity "http://www.google.com/finance/company_news?hl=en&q=AAPL&ie=utf-8&start=0&num=20&output=rss"/Can anyone please help me on this. Thanks in advance guys.Please note that I am using the R version 3.3.2 -- View this message in context: http://r.789695.n4.nabble.com/R-tm-plugin-webmining-Package-s-WebCorpus-function-is-not-working-tp4739987.html Sent from the datatable-help mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From videotocao at yahoo.es Thu Jun 22 15:25:32 2017 From: videotocao at yahoo.es (Reynaldo2007) Date: Thu, 22 Jun 2017 06:25:32 -0700 (PDT) Subject: [datatable-help] Usage of alrtest function in urca (for weak exogeneity) Message-ID: <1498137932936-4740045.post@n4.nabble.com> At first, I want to say that I searched during long time on Internet and on several R books in order to clarify this question, but although there are some insights in some materials that I found in internet I need to be sure. I am not a coder, then to take a look to the function to see how it was coded is impossible for me. I want to test for weak exogeneity in R. Lets consider the situation described under this link Finding significance levels for cointegrating coefficients in cajorls where the code is the following library(vars) library(urca) finland # lets imagine that there are just 2 time series GDP in the first column and FDI in the second column sjf.vecm <- ca.jo(finland, ecdet = "none", type = "eigen", K = 2) # lets imagine that there is cointegration and, of course, one long run equation. In the documentation of alrtest, this function has 3 arguments z, A and r which are a ca.jo object, a matrix containing the restrictions and the rank of the cointegration space (r=1, in this case), then my code should look like this test_on_alpha <- alrtest(z = sjf.vecm, A = A1,r = 1) My questions are: 1.How should I build the matrix A1 to test for weak exogeneity of GDP? 2.How should I build the matrix A1 to test for weak exogeneity of FDI? In addition, Lets consider now 3 variables in the database finland (GDP, FDI and SAVING by this order) and r=2 (the second equation is between FDI and SAVING. Then the alrtest would be test_on_alpha <- alrtest(z = sjf.vecm, A = A1,r = 2) This leads to my last question: 3. How the inclusion of the second equation modifies the settings of the matrix A1? I read this lecture https://sites.ualberta.ca/~sfossati/e509/files/slides/Lec12.pdf but still is not clear for me. Very much thank you in advance Lastly, If someone knows about a book or link with a clear explanation about this, (s)he can go ahead and just provide the link or the title of the book. I really understand that we are all busy and time is very scarce resource. -- View this message in context: http://r.789695.n4.nabble.com/Usage-of-alrtest-function-in-urca-for-weak-exogeneity-tp4740045.html Sent from the datatable-help mailing list archive at Nabble.com. From mrg2 at princeton.edu Sat Jun 24 23:47:08 2017 From: mrg2 at princeton.edu (mrg2) Date: Sat, 24 Jun 2017 14:47:08 -0700 (PDT) Subject: [datatable-help] Error with Tukey Test Message-ID: <1498340828993-4740231.post@n4.nabble.com> I'm trying to run a Tukey Test but it keeps saying that my class is none and my mode is numeric. I've tried changing my variables into factors as other posts have suggested, but it is still not working. Any help is much appreciated. dol1351_groupsize_1yr <- read.csv("1351_Group_Size_1yr.csv") anov1yr <- aov(dol1351_groupsize_1yr$Number~as.factor(dol1351_groupsize_1yr$Time)) tuk1yr <- TukeyHSD(anov1yr) summary(anov1yr) summary(tuk1yr) -- View this message in context: http://r.789695.n4.nabble.com/Error-with-Tukey-Test-tp4740231.html Sent from the datatable-help mailing list archive at Nabble.com. From serdar.akin76 at gmail.com Wed Jun 28 11:42:23 2017 From: serdar.akin76 at gmail.com (Serdar Akin) Date: Wed, 28 Jun 2017 11:42:23 +0200 Subject: [datatable-help] unique values in data.table Message-ID: Hi all I'm using data.table 1.10.5 and tried to the get unique values and keeping NA values unique( data.table( email = c(rep(NA,4), rep("david", 3), "frank"), nr = 1:8) , by = 'email', na.rm = FALSE) But this still removes the NA values. Regards Serdar From crosspide at hotmail.com Thu Jun 29 15:56:04 2017 From: crosspide at hotmail.com (agent dunham) Date: Thu, 29 Jun 2017 06:56:04 -0700 (PDT) Subject: [datatable-help] svm e1071 call - different results Message-ID: <1498744564442-4740595.post@n4.nabble.com> Dear community, I don't know which is the proper call for svm at e1071, as I'm obtaining really different results when predicting. Find attached my data. This is what I'm trying: *TYPE1* mod = svm(train[, 8] ~ . , data= train) pred.svm <- predict (mod, train) error.svm <- train$revenues - pred.svm pred.svm.test <- predict (mod, test) svmPredictionRMSE <- rmse(error.svm) /*0.05239259*/ error.svm.test <- test$revenues - pred.svm.test svmPredictionRMSE.test <- rmse(error.svm.test) /*0.06932511*/ *TYPE2* mod.1 = svm(train[, -8] , train[, 8]) pred.1.svm <- predict (mod.1, train[, -8]) error.1.svm <- train$revenues - pred.1.svm rmse(error.1.svm) /*0.3695311*/ pred.1.svm.test <- predict (mod.1, test[, -8]) error.1.svm.test <- test$revenues - pred.1.svm.test rmse(error.1.svm.test) /*0.412292*/ train.txt test.txt And rmse: function(error) { sqrt(mean(error^2, na.rm= TRUE)) } I also tried: mod2 = svm(formula = train1[, 8] ~ as.matrix(train1[, -8]), data = train) If this is correct, how do I have to write the corresponding predict? Thanks in advance, -- View this message in context: http://r.789695.n4.nabble.com/svm-e1071-call-different-results-tp4740595.html Sent from the datatable-help mailing list archive at Nabble.com. From anbyrley at buffalo.edu Thu Jun 29 19:03:22 2017 From: anbyrley at buffalo.edu (numbers) Date: Thu, 29 Jun 2017 10:03:22 -0700 (PDT) Subject: [datatable-help] Packages for Learning Algorithm Independent Branch and Bound for Feature Selection Message-ID: <1498755802840-4740605.post@n4.nabble.com> I am looking for packages that can run a branch-and-bound algorithm to maximize a distance measure (such as Bhattacharyya or Mahalanobis) on a set of features. I would like this to be learning algorithm independent, so that the method just looks at the features, and selects the subset of a user-defined size that maximizes a distance criteria such as those stated above. Can anyone give some suggestions? -- View this message in context: http://r.789695.n4.nabble.com/Packages-for-Learning-Algorithm-Independent-Branch-and-Bound-for-Feature-Selection-tp4740605.html Sent from the datatable-help mailing list archive at Nabble.com. From Noa.Kay at kingcounty.gov Thu Jun 29 19:22:47 2017 From: Noa.Kay at kingcounty.gov (Kay, Noa) Date: Thu, 29 Jun 2017 17:22:47 +0000 Subject: [datatable-help] Unsubscribe Message-ID: <605DE1F527F56D438E1D03D7D6AEC2B4301D2D50@MAILQDC2.kc.kingcounty.lcl> How do I unsubscribe from this list? Noa Kay Department of Community and Human Services (DCHS) - King County Performance Measurement & Evaluation Noa.Kay at kingcounty.gov 206.477.7779 -------------- next part -------------- An HTML attachment was scrubbed... URL: