[R] i am trying to teach myself R

2016-12-01 Thread hotprojects
having been reasonably fluent a decade ago in spss and sas
can I do everything in R I did in these two formats?
eg multiple and logistic regression
time series ; anova ancova etc
?
[[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] confidence intervals for orthogonal contrasts

2016-12-01 Thread Richard M. Heiberger
James,

Please look at the maiz example, the last example in ?MMC
help("MMC", package="HH")
where I show how to construct and calculate a set of orthogonal contrasts
for a factor in an analysis of variance setting.  mmc and mmcplot use glht
in the multcomp package for the underlying calculations.

If yo don't have HH, you can get it with
install.packages("HH")

See the references in ?MMC to my book and paper.  The second edition
of the book is now available.

Rich

On Thu, Dec 1, 2016 at 4:17 PM, James Henson  wrote:
> Hi R users,
> Is there a way to calculate a confidence interval for each contrast in
> a set of orthogonal contrasts?  The ‘multcomp’ package will calculate
> a CIs at the 95% family-wise confidence level.  But, these confidence
> intervals are extremely wide.
> Thanks for your help.
> Best regards,
> James
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.

Re: [R] R & MongoDB

2016-12-01 Thread Nordlund, Dan (DSHS/RDA)
Here are some links that may get you started.

https://www.r-bloggers.com/r-and-mongodb/
https://cran.r-project.org/web/packages/mongolite/vignettes/intro.html
https://www.opencpu.org/posts/mongolite-release-0-3/


You may also want to ask your question on the R-sig-DB Mailing list.

https://stat.ethz.ch/mailman/listinfo/r-sig-db


Good luck!

Dan

Daniel Nordlund, PhD
Research and Data Analysis Division
Services & Enterprise Support Administration
Washington State Department of Social and Health Services

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Fernando
> Mozas Enguita
> Sent: Thursday, December 01, 2016 12:07 AM
> To: r-help@R-project.org
> Subject: [R] R & MongoDB
> 
> Hi Everyone!
> 
> I�m new in R-world and I need help.
> I need to make an R-script for PowerBI to connect with a MongoDB data
> source and I don�t have so much idea
> 
> I have a dataset in a Mongo DB like this:
> 
> /* 1 */
> {
> "_id" : ObjectId("5819ad77d8828e871ce09297"),
> "Date" : 1478077741,
> "Receptor" : "CORMAD",
> "Position" : "02112016",
> "clients" : [
> {
> "mac" : "A2:C2:CA:18:F0:5E",
> "vendor" : "",
> "lastSeen" : 1478077746,
> "power" : -80,
> "R" : "",
> "bssid" : "(not associated) ",
> "essid" : [],
> "probedESSID" : [
> "any"
> ]
> },
> {
> "mac" : "D6:B0:C2:0E:2B:A0",
> "vendor" : "",
> "lastSeen" : 1478077755,
> "power" : -78,
> "R" : "",
> "bssid" : "(not associated) ",
> "essid" : [],
> "probedESSID" : [
> "any"
> ]
> }
> /* 2 */
> {
> "_id" : ObjectId("5819b009d8828e871ce092dc"),
> "Date" : 1478078401,
> "Receptor" : "CORMAD",
> "Position" : "02112016",
> "clients" : [
> {
> "mac" : "C0:38:96:86:1E:91",
> "vendor" : "HonHaiPr",
> "lastSeen" : 1478078443,
> "power" : -80,
> "R" : "",
> "bssid" : "0A:18:D6:2B:7F:EB",
> "essid" : [],
> "probedESSID" : [
> "any"
> ]
> },
> {
> "mac" : "F4:F1:E1:60:73:D2",
> "vendor" : "Motorola",
> "lastSeen" : 1478078410,
> "power" : -78,
> "R" : "",
> "bssid" : "(not associated) ",
> "essid" : [],
> "probedESSID" : [
> "JAZZTEL_HY7S"
> ]
> }
> 
> How can I iterate throw all the clients to extract the information?
> I need to have a classic table with the information.
> One row with the fields :
> _id | Date | Receptor | Position | clients | mac | vendor | lastSeen | power |
> R | bssid | essid | probedESSID
> 
> 
> Thanks!
> Fernando.
> 
> 
> 
> 
> 
>   [[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Identifying Gender

2016-12-01 Thread Jim Lemon
On Fri, Dec 2, 2016 at 7:58 AM, Ismail SEZEN  wrote:
>
> So, it’s more reasonable to identify the gender manually.
>
Both Paul ("Crocodile Dundee") Hogan and Donald Trump agree on that.

Jim

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.

Re: [R] Plotting Confidence Intervals into a density plot

2016-12-01 Thread David Winsemius

> On Dec 1, 2016, at 12:10 PM, Elysa Mitova  wrote:
> 
> Hi,
> 
> I am desperately looking for a way to plot confidence intervals into a
> density plot of only one variable (not a scatter plot etc.)
> 
> Have you any advice how to do this?
> 
> I've only found manual ways to do with "abline", but this is a rather
> bothersome method and only works with ggplot (and not ggplot2).

This makes it appear that you expect this to be done in ggplot2 automagically. 
I suspect you must instead first find the right approach to construction of 
those upper and lower bounds before plotting. It's not clear what methods you 
expect to be needed. Your desperation is not a guide. Perhaps trying a bit of 
searching?

install.packages("sos")
library(sos)
findFn("confidence intervals density estimates")


Delivers quite a few results. Then searching on the text within that webpage 
you find 


208 2   27  54  nprobustkdrobust2016-11-14 
16:41:50 27  Kernel Density Estimation with Robust Confidence Intervals
209 2   27  54  nprobustlprobust2016-11-14 
16:41:50 27  Local-Polynomial Estimation with Robust Confidence 
Intervals

Is that what you seek?

> 
> Thank you!
> 
>   [[alternative HTML version deleted]]
I know you just subscribed, so now is the time to read the Posing Guide.

== 

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


Re: [R] Bootstrap using ARIMA model

2016-12-01 Thread Ashwini Patil
Hi David,

here is my code including what i did for the tsboot:
rm(list = ls())
library(boot)
library(tseries)
library(TTR)
library(quantmod)
library(scales)
library(forecast)
library(zoo)
library(TSA)
security<-"NFLX"
startDate<-"2012-06-01"
endDate<-"2016-10-31"
qte_list<-c("AdjClose")

data=get.hist.quote(instrument = security, startDate, endDate, quote =
qte_list,   provider = "yahoo" )

func.ar<- ar(logret)
func.model<-list(order = c(func.ar$order,0,0),ar=func.ar$ar)
func.res<- func.ar$resid[!is.na(func.ar$resid)]
func.res<-func.res - mean()
func<- function(logret,formula){
  d = logret
  return(RSI(exp(logret)))
}
func.sim<-function(res,n.sim,ran.args){
  rg1<- function(n, res) sample(res, n, replace=TRUE)
  ts.orig<-ran.args$ts
  ts.mod<-ran.args$model
  mean(ts.orig)+ts(arima.sim(model=ts.mod,n=n.sim, ran.gen=rg1,
res=as.vestor(res)))
}
myboot<-tsboot(exp(logret),func,R=500,sim="model", ran.gen=func.sim,
ran.args = List(ts=log(data[,1],model=func.sim))


Best,
Ash


On Thu, Dec 1, 2016 at 1:50 PM, Bert Gunter  wrote:

> Just briefly to follow up David's comment, though this is mainly about
> statistics and therefore off topic here...
>
> Bootstrapping time series is a subtle issue that requires familiarity
> with the technical details-- and maybe even current research. The
> tsboot() function gives you several options from which you must choose
> *appropriately* -- or maybe choose something else entirely. The Help
> doc gives you a sense of the difficulties:
>
> ***
> Model based resampling is very similar to the parametric bootstrap and
> all simulation must be in one of the user specified functions. This
> avoids the complicated problem of choosing the block length but relies
> on an accurate model choice being made.
>
> Phase scrambling is described in Section 8.2.4 of Davison and Hinkley
> (1997). The types of statistic for which this method produces
> reasonable results is very limited and the other methods seem to do
> better in most situations. Other types of resampling in the frequency
> domain can be accomplished using the function boot with the argument
> sim = "parametric".
> 
>
> Moral: If you don't know what you're doing, seek local expertise to
> help -- remote sites offering suggestions from those who aren't
> familiar with the details of your data and analysis goals (maybe you
> don't need to do this at all!) may lead you to irreproducible
> nonsense.
>
> Cheers,
> Bert
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Thu, Dec 1, 2016 at 7:45 AM, Ashwini Patil 
> wrote:
> > Hi,
> >
> > I want to implement a bootstrap method for time series.
> > I am taking the adj close values from yahoo for NFLX and now I need to
> > bootstrap these values using ARIMA model.
> >
> > here is my code so far:
> > rm(list = ls())
> > library(boot)
> > library(tseries)
> > library(TTR)
> > library(quantmod)
> > library(scales)
> > library(forecast)
> > library(zoo)
> > library(TSA)
> > security<-"NFLX"
> > startDate<-"2012-06-01"
> > endDate<-"2016-10-31"
> > qte_list<-c("AdjClose")
> >
> > data=get.hist.quote(instrument = security, startDate, endDate, quote =
> > qte_list,   provider = "yahoo" )
> > logret<-diff(log(data[,1]))
> > fit11<-auto.arima(logret, max.order=10)
> >
> > When i use auto.arima, I get an order of (0,0,0) with non-zero mean.
> After
> > this, I tried to use tsboot function but it is not yielding any answers.
> >
> > Any and all help is appreciated.
> >
> > Thank you!
> >
> > [[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 read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>

[[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] confidence intervals for orthogonal contrasts

2016-12-01 Thread James Henson
Hi R users,
Is there a way to calculate a confidence interval for each contrast in
a set of orthogonal contrasts?  The ‘multcomp’ package will calculate
a CIs at the 95% family-wise confidence level.  But, these confidence
intervals are extremely wide.
Thanks for your help.
Best regards,
James

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.

[R] DocumentTermMatrix

2016-12-01 Thread Patrick Casimir
My dtm is showing the 4 files in the corpus correctly, but the number of terms 
is incorrect at 0. What can cause that?

dtm <- DocumentTermMatrix(docs)
dtm
## <>


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
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, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[R] Plotting Confidence Intervals into a density plot

2016-12-01 Thread Elysa Mitova
Hi,

I am desperately looking for a way to plot confidence intervals into a
density plot of only one variable (not a scatter plot etc.)

Have you any advice how to do this?

I've only found manual ways to do with "abline", but this is a rather
bothersome method and only works with ggplot (and not ggplot2).

Thank you!

[[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Splitting or Subsetting Using foreach

2016-12-01 Thread David Winsemius

> On Dec 1, 2016, at 9:27 AM, Doran, Harold  wrote:
> 
> I am having tremendous fortune using the foreach function in the foreach 
> package sending work out to multiple cores in order to reduce computational 
> time.
> 
> I am experimenting with which types of tasks benefit from running in parallel 
> and which do not and so this is a bit of a learning experience by trial and 
> error.
> 
> One particular task I cannot seem to realize a benefit from (in terms of 
> reduced time) is splitting or subsetting a large data frame. I realize there 
> are other "fast" options like using data.table, but current goal is to see if 
> this can benefit from multiple cores or not. 
> 
> So, a very small toy example of how I am approaching the "traditional" and 
> "parallel" way is as follows. My actual data is much, much larger and it 
> turns out the parallel version of doing it this way vis-à-vis the traditional 
> way is unbelievably slow. Hence Im not sure if there is a good theoretical 
> reason why such a task cannot run faster when sent out to multiple cores if 
> there is a user error that I need to better understand and correct
> 
> library(foreach)
> library(doParallel)
> registerDoParallel(cores=4)
> 
> tmp <- data.frame(id = rep(1:200, each = 10), foo = rnorm(2000))
> 
> ff1 <- split(tmp, tmp$id)
> 
> myList <- unique(tmp$id)
> N <- length(myList)
> ff2 <- foreach(i = 1:N) %dopar% { tmp[which(tmp$id == myList[i]),]}

I would have imagined that using split to deliver separate instance of separate 
data.frame parcels to the `i` -argument would be more sensible. Otherwise you 
are sending full copies to each worker and then doing the extraction N times 
rather than once.There's a lot of checking using data.frame methods. I also 
think you would want to avoid making reference to objects "outside" the 
parallel function application.

ff2 <- foreach( z = iter( ff1) ) %dopar% { max(z$id) }


> 
> Thanks,
> Harold
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


Re: [R] Identifying Gender

2016-12-01 Thread Ismail SEZEN

> On 1 Dec 2016, at 23:42, Rich Shepard  wrote:
> 
> On Thu, 1 Dec 2016, Saba Sehrish via R-help wrote:
> 
>> I have a csv file of Names based on male and female managers. Is there
>> some code in R to identify the gender by names?
> 
> Saba,
> 
>  Despite the availability of some tools you'll never find a satisfactory
> answer. Consider Lynn, Alex, Ari, Blaine, Blake, Bobby, etc. Then you'll get
> others that don't fall into any discrete category.
> 
>  Perhaps a separate column in your CSV file for gender?
> 

Rich is right and I don’t think that you have thousands of "managers". Perhaps 
maximum 100? So, it’s more reasonable to identify the gender manually.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.

Re: [R] Identifying Gender

2016-12-01 Thread Rich Shepard

On Thu, 1 Dec 2016, Saba Sehrish via R-help wrote:


I have a csv file of Names based on male and female managers. Is there
some code in R to identify the gender by names?


Saba,

  Despite the availability of some tools you'll never find a satisfactory
answer. Consider Lynn, Alex, Ari, Blaine, Blake, Bobby, etc. Then you'll get
others that don't fall into any discrete category.

  Perhaps a separate column in your CSV file for gender?

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


Re: [R] Identifying Gender

2016-12-01 Thread Duncan Murdoch

On 01/12/2016 2:40 PM, Saba Sehrish via R-help wrote:

Hi
I have a csv file of Names based on male and female managers. Is there some 
code in R to identify the gender by names?


There was a package called genderNames on CRAN for a couple of months, 
but the maintainer abandoned it.  You could recover it from the CRAN 
archive and see if you can get it to build.


Look for it in .

Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


Re: [R] Identifying Gender

2016-12-01 Thread Ismail SEZEN

> On 1 Dec 2016, at 22:40, Saba Sehrish via R-help  wrote:
> 
> Hi
> I have a csv file of Names based on male and female managers. Is there some 
> code in R to identify the gender by names?
> ThanksSaba
> 

A simple google search gives the what you are after [1]. But I think it works 
only for English names. Consider this before use.

1- https://cran.r-project.org/web/packages/gender/index.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


Re: [R] Identifying Gender

2016-12-01 Thread Rui Barradas

Hello,

I doubt there is, at least a search with package sos didn't show 
anything usefull.

But a google search found
https://github.com/KartikTalwar/LeGenderary

Maybe you can get inspiration from there and adapt to R code.

Rui Barradas

Em 01-12-2016 19:40, Saba Sehrish via R-help escreveu:

identify the gender by name


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[R] Identifying Gender

2016-12-01 Thread Saba Sehrish via R-help
Hi
I have a csv file of Names based on male and female managers. Is there some 
code in R to identify the gender by names?
ThanksSaba

[[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Run a Python code from R

2016-12-01 Thread Nelly Reduan

Hello,



Thanks a lot for your answers. Finally, I'm using the function system2() to run 
the python script. However, I don't know how to define a list of numeric values 
in the character vector of arguments for the function system2 (i.e., in �args� 
of the function system2() ) ?



In the Python script, the list of numeric values is defined as follows:

import sys

import nlmpy



weights = sys.argv[1] ## where weights = [0.5, 0.5]



outputNLM = nlmpy.classifyArray(�, weights)



print outputNLM



In the script R, how can I specify the argument weights = [0.5, 0.5] to run the 
Python script ?



Thanks a lot for your time.

Have a nice day

Nell



De : Robert Baer 
Envoy� : samedi 19 novembre 2016 16:05:13
� : David Winsemius; Nelly Reduan
Cc : r-help@r-project.org
Objet : Re: [R] Run a Python code from R


>From https://www.r-bloggers.com/rpithon-vs-rpython/

"Similar to rPython, the 
rPithon package (http://rpithon.r-forge.r-project.org) allows users to execute 
Python code from R and exchange the data between Python and R. However, the 
underlying mechanisms between these two packages are fundamentally different. 
Wihle rPithon communicates with Python from R through pipes, rPython 
accomplishes the same task with json. A major advantage of rPithon over rPython 
is that multiple Python processes can be started within a R session. However, 
rPithon is not very robust while exchanging large data objects between R and 
Python."

On 11/16/2016 7:10 PM, David Winsemius wrote:




On Nov 16, 2016, at 4:53 PM, Nelly Reduan 
 wrote:

[[elided Hotmail spam]]


I 'm trying to use the package "rPithon" but I obtain this error message:



Are you sure you are not just misspelling rPython? If that's not the issue than 
you need to say where you got rPithon,


>From https://www.r-bloggers.com/rpithon-vs-rpython/

"Similar to rPython, the rPithon package (http://rpithon.r-forge.r-project.org) 
allows users to execute Python code from R and exchange the data between Python 
and R. However, the underlying mechanisms between these two packages are 
fundamentally different. While rPithon communicates with Python from R through 
pipes, rPython accomplishes the same task with json. A major advantage of 
rPithon over rPython is that multiple Python processes can be started within a 
R session. However, rPithon is not very robust while exchanging large data 
objects between R and Python."


On Wed, Nov 16, 2016 at 4:53 PM, Nelly Reduan 
 wrote:


Hello,


How can I run this Python code from R ?




import nlmpy
nlm = nlmpy.mpd(nRow=50, nCol=50, h=0.75)
nlmpy.exportASCIIGrid("raster.asc", nlm)




Nlmpy is a Python package to build neutral landscape models

https://pypi.python.org/pypi/nlmpy . The example comes from this website. I 
tried to use the function system2 but I don't know how to use it.


path_script_python <- "C:/Users/Anaconda2/Lib/site-packages/nlmpy/nlmpy.py"

test <- system2("python", args = c(path_script_python, as.character(nRow), 
as.character(nCol), as.character(h)))

Thanks a lot for your help.
Nell


nlmpy 0.1.3 : Python Package 
Index
pypi.python.org
NLMpy. NLMpy is a Python package for the creation of neutral landscape models 
that are widely used in the modelling of ecological patterns and processes 
across ...



   [[alternative HTML version deleted]]


David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To 
UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Bootstrap using ARIMA model

2016-12-01 Thread Bert Gunter
Just briefly to follow up David's comment, though this is mainly about
statistics and therefore off topic here...

Bootstrapping time series is a subtle issue that requires familiarity
with the technical details-- and maybe even current research. The
tsboot() function gives you several options from which you must choose
*appropriately* -- or maybe choose something else entirely. The Help
doc gives you a sense of the difficulties:

***
Model based resampling is very similar to the parametric bootstrap and
all simulation must be in one of the user specified functions. This
avoids the complicated problem of choosing the block length but relies
on an accurate model choice being made.

Phase scrambling is described in Section 8.2.4 of Davison and Hinkley
(1997). The types of statistic for which this method produces
reasonable results is very limited and the other methods seem to do
better in most situations. Other types of resampling in the frequency
domain can be accomplished using the function boot with the argument
sim = "parametric".


Moral: If you don't know what you're doing, seek local expertise to
help -- remote sites offering suggestions from those who aren't
familiar with the details of your data and analysis goals (maybe you
don't need to do this at all!) may lead you to irreproducible
nonsense.

Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Dec 1, 2016 at 7:45 AM, Ashwini Patil  wrote:
> Hi,
>
> I want to implement a bootstrap method for time series.
> I am taking the adj close values from yahoo for NFLX and now I need to
> bootstrap these values using ARIMA model.
>
> here is my code so far:
> rm(list = ls())
> library(boot)
> library(tseries)
> library(TTR)
> library(quantmod)
> library(scales)
> library(forecast)
> library(zoo)
> library(TSA)
> security<-"NFLX"
> startDate<-"2012-06-01"
> endDate<-"2016-10-31"
> qte_list<-c("AdjClose")
>
> data=get.hist.quote(instrument = security, startDate, endDate, quote =
> qte_list,   provider = "yahoo" )
> logret<-diff(log(data[,1]))
> fit11<-auto.arima(logret, max.order=10)
>
> When i use auto.arima, I get an order of (0,0,0) with non-zero mean. After
> this, I tried to use tsboot function but it is not yielding any answers.
>
> Any and all help is appreciated.
>
> Thank you!
>
> [[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 read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


Re: [R] Bootstrap using ARIMA model

2016-12-01 Thread David Winsemius

> On Dec 1, 2016, at 7:45 AM, Ashwini Patil  wrote:
> 
> Hi,
> 
> I want to implement a bootstrap method for time series.
> I am taking the adj close values from yahoo for NFLX and now I need to
> bootstrap these values using ARIMA model.
> 
> here is my code so far:
> rm(list = ls())
> library(boot)
> library(tseries)
> library(TTR)
> library(quantmod)
> library(scales)
> library(forecast)
> library(zoo)
> library(TSA)
> security<-"NFLX"
> startDate<-"2012-06-01"
> endDate<-"2016-10-31"
> qte_list<-c("AdjClose")
> 
> data=get.hist.quote(instrument = security, startDate, endDate, quote =
> qte_list,   provider = "yahoo" )
> logret<-diff(log(data[,1]))
> fit11<-auto.arima(logret, max.order=10)
> 
> When i use auto.arima, I get an order of (0,0,0) with non-zero mean. After
> this, I tried to use tsboot function but it is not yielding any answers.

_How_ did you use tsboot?


> 
> Any and all help is appreciated.
> 
> Thank you!
> 
>   [[alternative HTML version deleted]]

Plain text. Please. Per the Posting Guide.

> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


Re: [R] R re-base/compile problem

2016-12-01 Thread Jeff Newmiller
You MIGHT get an answer here,  but this type of question is more likely to 
belong on the R-devel mailing list than here. See the Posting Guide. 
-- 
Sent from my phone. Please excuse my brevity.

On December 1, 2016 8:20:52 AM PST, lejeczek via R-help  
wrote:
>hi everyone.
>
>this will be a bit rpm packaging related, not sure if more 
>than R itself but before going to rpm gang I hoped someone 
>here knows:
>why this:
>
>byte-compiling package 'compiler'
>Warning in file(datafile, "wb") :
>   cannot open file 
>'/usr/lib64/R-MY/lib64/R/library/compiler/R/compiler.rdb': 
>Permission denied
>Error in file(datafile, "wb") : cannot open the connection
>Calls:  -> code2LazyLoadDB -> makeLazyLoadDB -> 
>close -> file
>Execution halted
>
>happens when I rpmbuild R?
>I do a bit of mangling there, but nothing in the sources of 
>R, just rpm spec files & paths.
>
>Why build process would call this file? (which is not there 
>anyway)
>
>Weirder is that if rpm packages (of that my custom build) 
>are already installed that problem occurs, build fails only 
>then. Suffice to yum/rpm uninstall those R-MY* packages and 
>rpm build process is successful.
>
>To me it's strangest thing, but an expert hopefully knows 
>what is going on there.
>many thanks,
>L.
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[R] Splitting or Subsetting Using foreach

2016-12-01 Thread Doran, Harold
I am having tremendous fortune using the foreach function in the foreach 
package sending work out to multiple cores in order to reduce computational 
time.

I am experimenting with which types of tasks benefit from running in parallel 
and which do not and so this is a bit of a learning experience by trial and 
error.

One particular task I cannot seem to realize a benefit from (in terms of 
reduced time) is splitting or subsetting a large data frame. I realize there 
are other "fast" options like using data.table, but current goal is to see if 
this can benefit from multiple cores or not. 

So, a very small toy example of how I am approaching the "traditional" and 
"parallel" way is as follows. My actual data is much, much larger and it turns 
out the parallel version of doing it this way vis-à-vis the traditional way is 
unbelievably slow. Hence Im not sure if there is a good theoretical reason why 
such a task cannot run faster when sent out to multiple cores if there is a 
user error that I need to better understand and correct

library(foreach)
library(doParallel)
registerDoParallel(cores=4)

tmp <- data.frame(id = rep(1:200, each = 10), foo = rnorm(2000))

ff1 <- split(tmp, tmp$id)

myList <- unique(tmp$id)
N <- length(myList)
ff2 <- foreach(i = 1:N) %dopar% { tmp[which(tmp$id == myList[i]),]}

Thanks,
Harold

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[R] Bootstrap using ARIMA model

2016-12-01 Thread Ashwini Patil
Hi,

I want to implement a bootstrap method for time series.
I am taking the adj close values from yahoo for NFLX and now I need to
bootstrap these values using ARIMA model.

here is my code so far:
rm(list = ls())
library(boot)
library(tseries)
library(TTR)
library(quantmod)
library(scales)
library(forecast)
library(zoo)
library(TSA)
security<-"NFLX"
startDate<-"2012-06-01"
endDate<-"2016-10-31"
qte_list<-c("AdjClose")

data=get.hist.quote(instrument = security, startDate, endDate, quote =
qte_list,   provider = "yahoo" )
logret<-diff(log(data[,1]))
fit11<-auto.arima(logret, max.order=10)

When i use auto.arima, I get an order of (0,0,0) with non-zero mean. After
this, I tried to use tsboot function but it is not yielding any answers.

Any and all help is appreciated.

Thank you!

[[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to setup a multiplicative dummy function in R

2016-12-01 Thread lolo koko
Hello?

Does anyone know how I can implement the below equation in R? I would
like to estimate the following equation:

  y=beta_ij * (1+gamma_j * dummy) * x_ij

where y is continuous, and all the x variables (j of them) are i=3
level categorical variables. The intuition is that instead of
estimating the additive value for a dummy variable, I would like to
estimate the multiplicative value for the dummy variable. Thus the
presence of the dummy would scale the beta. Note that for each x
variable there is only one gamma.

For concreteness, you can imagine that y is a continious test score, x
are categorical variables indicating different types of education
achievements, each type of education achievement is categorised in 3
levels (none, some, a lot), and the dummy indicates race. In this
model I believe that race affects test scores proportionally to
estimated beta of each education level. This avoids having to estimate
a gamma for each education achievement level.

Is the solution to simply use nls {stats} and type out the equation?

Hope the explanation makes sense, happy to explain further.

Best wishes,

Peter

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


Re: [R] Ajdustment of data symbols

2016-12-01 Thread Giovanni Petris

That's exactly what I was looking for! 

Thank you,
Giovanni


From: David L Carlson 
Sent: Thursday, December 1, 2016 10:18
To: Giovanni Petris; r-help@r-project.org
Subject: RE: Ajdustment of data symbols

Try this. The par("cxy") gets a vector of character width and height in user 
coordinates.

points(0.25, par("usr")[3]-par("cxy")[2]/2, pch = 17, col = "red", cex = 2, xpd 
= TRUE)

-
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Giovanni Petris
Sent: Thursday, December 1, 2016 10:01 AM
To: r-help@r-project.org
Cc: Giovanni Petris
Subject: [R] Ajdustment of data symbols


Hello,

Is there a way to specify a non-default adjustment for data symbols, similar to 
what "adj" does for text?

For example, the following lines of code produce a red triangle on the bottom 
border of the plot:

plot(0, 0, type = 'n', xlab = "", ylab = "")
points(0.25, par("usr")[3], pch = 17, col = "red", cex = 2, xpd = TRUE)

I would like to draw the triangle completely outside the plotting area, with 
the upper vertex touching the x-axis...

Thank you in advance!

Best,
Giovanni



--
Giovanni Petris, PhD
Professor
Director of Statistics
Department of Mathematical Sciences
University of Arkansas - Fayetteville, AR 72701
Ph: (479) 575-6324, 575-8630 (fax)
http://definetti.uark.edu/


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DgIFAg&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=C3DNvy_azplKSvJKgvsgjA&m=eJAlQ1Qalin1IVzkWmqtiDeAOsMhi2ionhGq4KT4u7g&s=SkVbrPUxN4YKUKSG8tTpDTqYcf8VixPuh9HHA38yCuo&e=
PLEASE do read the posting guide 
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DgIFAg&c=7ypwAowFJ8v-mw8AB-SdSueVQgSDL4HiiSaLK01W8HA&r=C3DNvy_azplKSvJKgvsgjA&m=eJAlQ1Qalin1IVzkWmqtiDeAOsMhi2ionhGq4KT4u7g&s=jW3W6tyyH73FqGxaGgFKnmreBfxV0cwwV9dw0o0gdPc&e=
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[R] (no subject)

2016-12-01 Thread Sandeep Reddy Marla
Hello,

I'm trying to generate heat map for differential expression data. I ranked
each data row and used that for heat map visualization (included an example
data set with script). When difference between numbers within each row is
small, still heat map is not representing correctly as it is ranking that
was used for heat map. Therefore, I tried using scale='row', but the heat
map is not looking as good as ranked data heat map.

In scale = row argument, I want the highest value and lowest values color
to be colors that I have provided and the intermediate values (example:
values of 0,1,500,700 - 0 with royalblue3, 700 with yellow, and 1 and 500
adjusted as per the scale) be colored according to their value. Are there
any arguments to fix this problem in R heatmap.2, your help will be greatly
appreciated.

#creating a sample data set
Bo <- c(0,32,200,1500)
No <- c(5,100, 250, 70)
Bc <- c(700,523,80,3000)
Nc <- c(1,0, 300, 30)
GeneID <- c("G1", "G2","G3","G4")

DEG <- data.frame(GeneID, Bo,No,Bc,Nc)
DEG_data <- DEG[ -(1)]
DEG_data <- as.matrix(DEG_data)
class(DEG_data) <- 'numeric'

ranked_DEG_data <- t(apply(DEG_data, 1, rank))


#generating a heat map using ranked values for each row
#rank 1 is royalblue3 and rank4 is yellow
heatmap.2(ranked_DEG_data, cellnote=DEG_data, notecex=0.7,
  notecol="black",cexRow =0.6,cexCol =1.5, srtCol=360,
  trace="none", dendrogram ='none', Rowv=F, Colv=F, keysize=1,
scale="row",
  ,adjCol=c(0.5,0.25),
  col=colorpanel(100, low="royalblue3", high="yellow"))

#generating a heat map using real values
#rank 1 is royalblue3 and rank4 is yellow in the above heat map but scaling
is not providing similar map for high and low values
heatmap.2(DEG_data, cellnote=DEG_data, notecex=0.7,
  notecol="black",cexRow =0.6,cexCol =1.5, srtCol=360,
  trace="none", dendrogram ='none', Rowv=F, Colv=F, keysize=1,
scale="row",
,adjCol=c(0.5,0.25),
  col=colorpanel(100, low="royalblue3", high="yellow"))

Thanks

[[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R re-base/compile problem

2016-12-01 Thread lejeczek via R-help

hi everyone.

this will be a bit rpm packaging related, not sure if more 
than R itself but before going to rpm gang I hoped someone 
here knows:

why this:

byte-compiling package 'compiler'
Warning in file(datafile, "wb") :
  cannot open file 
'/usr/lib64/R-MY/lib64/R/library/compiler/R/compiler.rdb': 
Permission denied

Error in file(datafile, "wb") : cannot open the connection
Calls:  -> code2LazyLoadDB -> makeLazyLoadDB -> 
close -> file

Execution halted

happens when I rpmbuild R?
I do a bit of mangling there, but nothing in the sources of 
R, just rpm spec files & paths.


Why build process would call this file? (which is not there 
anyway)


Weirder is that if rpm packages (of that my custom build) 
are already installed that problem occurs, build fails only 
then. Suffice to yum/rpm uninstall those R-MY* packages and 
rpm build process is successful.


To me it's strangest thing, but an expert hopefully knows 
what is going on there.

many thanks,
L.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


Re: [R] Ajdustment of data symbols

2016-12-01 Thread David L Carlson
Try this. The par("cxy") gets a vector of character width and height in user 
coordinates.

points(0.25, par("usr")[3]-par("cxy")[2]/2, pch = 17, col = "red", cex = 2, xpd 
= TRUE)

-
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Giovanni Petris
Sent: Thursday, December 1, 2016 10:01 AM
To: r-help@r-project.org
Cc: Giovanni Petris
Subject: [R] Ajdustment of data symbols


Hello,

Is there a way to specify a non-default adjustment for data symbols, similar to 
what "adj" does for text? 

For example, the following lines of code produce a red triangle on the bottom 
border of the plot:

plot(0, 0, type = 'n', xlab = "", ylab = "")
points(0.25, par("usr")[3], pch = 17, col = "red", cex = 2, xpd = TRUE)

I would like to draw the triangle completely outside the plotting area, with 
the upper vertex touching the x-axis...

Thank you in advance!

Best,
Giovanni



--
Giovanni Petris, PhD
Professor
Director of Statistics
Department of Mathematical Sciences
University of Arkansas - Fayetteville, AR 72701
Ph: (479) 575-6324, 575-8630 (fax)
http://definetti.uark.edu/


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[R] Ajdustment of data symbols

2016-12-01 Thread Giovanni Petris

Hello,

Is there a way to specify a non-default adjustment for data symbols, similar to 
what "adj" does for text? 

For example, the following lines of code produce a red triangle on the bottom 
border of the plot:

plot(0, 0, type = 'n', xlab = "", ylab = "")
points(0.25, par("usr")[3], pch = 17, col = "red", cex = 2, xpd = TRUE)

I would like to draw the triangle completely outside the plotting area, with 
the upper vertex touching the x-axis...

Thank you in advance!

Best,
Giovanni



--
Giovanni Petris, PhD
Professor
Director of Statistics
Department of Mathematical Sciences
University of Arkansas - Fayetteville, AR 72701
Ph: (479) 575-6324, 575-8630 (fax)
http://definetti.uark.edu/


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[R] Interpreting summary.lm for a 2 factor anova

2016-12-01 Thread Ashim Kapoor
Dear all,

Here is a small example : -

> model <- aov(breaks ~ wool * tension, data = warpbreaks)
> summary.lm(model)

Call:
aov(formula = breaks ~ wool * tension, data = warpbreaks)

Residuals:
 Min   1Q   Median   3Q  Max
-19.5556  -6.8889  -0.6667   7.1944  25.

Coefficients:
   Estimate Std. Error t value Pr(>|t|)
(Intercept)  44.556  3.647  12.218 2.43e-16 ***
woolB   -16.333  5.157  -3.167 0.002677 **
tensionM-20.556  5.157  -3.986 0.000228 ***
tensionH-20.000  5.157  -3.878 0.000320 ***
woolB:tensionM   21.111  7.294   2.895 0.005698 **
woolB:tensionH   10.556  7.294   1.447 0.154327
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 10.94 on 48 degrees of freedom
Multiple R-squared:  0.3778,Adjusted R-squared:  0.3129
F-statistic: 5.828 on 5 and 48 DF,  p-value: 0.0002772

> model.tables(model,"e")
Tables of effects

 wool
wool
  A   B
 2.8889 -2.8889

 tension
tension
 L  M  H
 8.241 -1.759 -6.481

 wool:tension
tension
wool L  M  H
   A  5.278 -5.278  0.000
   B -5.278  5.278  0.000


> model.tables(model,"m")
Tables of means
Grand mean

28.14815

 wool
wool
 A  B
31.037 25.259

 tension
tension
L M H
36.39 26.39 21.67

 wool:tension
tension
wool L M H
   A 44.56 24.00 24.56
   B 28.22 28.78 18.78
>

I don't follow the output of summary.lm. I understand the output of
model.tables for effects and means. For instance what does 44.556 represent
? Is it the grand average ? The grand mean is 28.14815. Can someone help me
understand the output of summary.lm ?

Best Regards,
Ashim

[[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] [R-pkgs] New package queuecomputer

2016-12-01 Thread Anthony Ebert
Dear R users,

queuecomputer is a new R package now available on CRAN. It is a very
fast method for simulating queueing networks.

The user supplies the arrival and service times and the departure
times are computed deterministically. The name queuecomputer is meant
in the sense that the package 'computes queues'.

The page for the package:

https://CRAN.R-project.org/package=queuecomputer

The github repo is:

https://github.com/AnthonyEbert/queuecomputer

All feedback is welcome anthonyebert+c...@gmail.com

Please send any reports of bugs to anthonyebert+c...@gmail.com or
create an issue on github.

Kind regards,

Anthony Ebert

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[R] Question about proxy setting of R

2016-12-01 Thread qwertyui_period
Hello,

I use R 3.0.2 on Win 7 through proxy server using ".Rprofile" in home
directory that includes "Sys.setenv(http_proxy=proxy_server:port)".
There has been no problem to access the internet for some years.
In this situation, I installed R 3.3.1 and then entered "update.packages
()", however, "Proxy Authentification" window didn't show up and
failed to access the internet. Error messages are as below.

---
> update.packages(ask='graphics',checkBuilt=TRUE)
--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file (cannot open URL
'https://cran.r-project.org/CRAN_mirrors.csv'); using local file
'C:/PROGRA~1/R/R-33~1.2/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository
https://cran.ism.ac.jp/src/contrib: 
  cannot open URL 'https://cran.ism.ac.jp/src/contrib/PACKAGES' 
Warning: unable to access index for repository
http://www.stats.ox.ac.uk/pub/RWin/src/contrib: 
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES' 
Warning message:
In download.file(url, destfile = f, quiet = TRUE) :
  cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv': HTTP
status was '407 Proxy Authentication Required'

---

Strange to say, R 3.0.2 is able to access to the internet, and R 3.3.1
shows collect proxy setting in ".Rprofile"  by "Sys.getenv("http_proxy")"
>From internet information, I added "http_proxy_user=ask" to ".Rprofile", or
" --internet2" to the desktop icon of R 3.3.1, ending up in the same
result.

Please show me the way of proxy setting of R 3.3.1.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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, self-contained, reproducible code.


[R] R & MongoDB

2016-12-01 Thread Fernando Mozas Enguita
Hi Everyone!

I�m new in R-world and I need help.
I need to make an R-script for PowerBI to connect with a MongoDB data source 
and I don�t have so much idea

I have a dataset in a Mongo DB like this:

/* 1 */
{
"_id" : ObjectId("5819ad77d8828e871ce09297"),
"Date" : 1478077741,
"Receptor" : "CORMAD",
"Position" : "02112016",
"clients" : [
{
"mac" : "A2:C2:CA:18:F0:5E",
"vendor" : "",
"lastSeen" : 1478077746,
"power" : -80,
"R" : "",
"bssid" : "(not associated) ",
"essid" : [],
"probedESSID" : [
"any"
]
},
{
"mac" : "D6:B0:C2:0E:2B:A0",
"vendor" : "",
"lastSeen" : 1478077755,
"power" : -78,
"R" : "",
"bssid" : "(not associated) ",
"essid" : [],
"probedESSID" : [
"any"
]
}
/* 2 */
{
"_id" : ObjectId("5819b009d8828e871ce092dc"),
"Date" : 1478078401,
"Receptor" : "CORMAD",
"Position" : "02112016",
"clients" : [
{
"mac" : "C0:38:96:86:1E:91",
"vendor" : "HonHaiPr",
"lastSeen" : 1478078443,
"power" : -80,
"R" : "",
"bssid" : "0A:18:D6:2B:7F:EB",
"essid" : [],
"probedESSID" : [
"any"
]
},
{
"mac" : "F4:F1:E1:60:73:D2",
"vendor" : "Motorola",
"lastSeen" : 1478078410,
"power" : -78,
"R" : "",
"bssid" : "(not associated) ",
"essid" : [],
"probedESSID" : [
"JAZZTEL_HY7S"
]
}

How can I iterate throw all the clients to extract the information?
I need to have a classic table with the information.
One row with the fields :
_id | Date | Receptor | Position | clients | mac | vendor | lastSeen | power | 
R | bssid | essid | probedESSID


Thanks!
Fernando.





[[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 read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.