[R] Using Foreach for downloading data

2016-04-27 Thread samarvir singh
Hi! I have this code which is working formula <- function(x){ return(x) } For( x in names) { x5 <- rbind(x5,formula(x)) } Now, I want to convert this code to parallel processing, so i am using foreach function foreach(x=names, .packages="checkpoint"

[R] using foreach function with gtrendsR

2016-04-27 Thread samarvir singh
I have this code which is working library("checkpoint") library("gtrendsR") library("doParallel") cl<-makeCluster(4) registerDoParallel(cl) gconnect(usr = "em...@gmail.com", psw = "password", verbose = FALSE) names <- c("apple","shit", "android", "rocks") formula <- function(x){ x0 <-

Re: [R] Need help with lm function on MAC OS X. R version - 3.2.0

2015-05-15 Thread samarvir singh
, samarvir singh samarvir1...@gmail.com wrote: I Have a data frame named BSE and CP is my independent variable and here;s the error I get if I try to run an lm function any idea whats wrong P.S - all my data is in numeric except company which is a factor. I have 2700 row and 450 variable

[R] Need help with lm function on MAC OS X. R version - 3.2.0

2015-05-14 Thread samarvir singh
I Have a data frame named BSE and CP is my independent variable and here;s the error I get if I try to run an lm function any idea whats wrong P.S - all my data is in numeric except company which is a factor. I have 2700 row and 450 variable P.P.S - I have no missing data, I have 0 in Empty

[R] Selecting cell values with XLSX package

2015-04-23 Thread samarvir singh
Hello, I am working with some 2700 files in .xlsx format Like the one attached below I want to transform all tabular data to a single row as shown below in example or in attachment so that all data can be used as a variable. and replicate all to make a single csv file which has all the data

[R] Can't load CARET package, on Mac OS X (latest), on R version 3.1.2 (2014-10-31)

2015-04-12 Thread samarvir singh
I installed CARET package, but when I try to load CARET. I see this error. Please help. thank you install.packages(caret) trying URL ' http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/caret_6.0-41.tgz' Content type 'application/x-gzip' length 3997718 bytes (3.8 Mb) opened URL

Re: [R] how to Subset based on partial matching of columns?

2015-04-09 Thread samarvir singh
it hard to copy and paste. Alternatively, don't post in HTML, because it screws up your code. On Wed, Apr 8, 2015 at 8:57 PM, samarvir singh samarvir1...@gmail.com wrote: So I have a list that contains certain characters as shown below `list - c(MY,GM+ ,TY,RS,LG)` That's a character vector

[R] how to Subset based on partial matching of columns?

2015-04-09 Thread samarvir singh
So I have a list that contains certain characters as shown below `list - c(MY,GM+ ,TY,RS,LG)` And I have a variable named CODE in the data frame as follows `code - c(MY GM+, ,LGTY, RS,TY)` 'x - c(1:5) `df - data.frame(x,code)` df x code 1 MY GM+ 2 3 LGTY 4 RS 5 TY

[R] How to subset data, by sorting names alphabetically.

2015-02-12 Thread samarvir singh
hello, I am cleaning some large data with 4 million observation and 7 variable. Of the 7 variables , 1 is name/string I want to subset data, which have same name Example- Name var1 var2 var3 var4 var5 var6 aa- - - - -- ab bd ac ad af ba bd aa av i want