Re: [R] RStudio: Place for Storing Options

2017-02-22 Thread Martin Maechler
> Jeff Newmiller 
> on Sat, 11 Feb 2017 08:09:36 -0800 writes:

> For the record, then, Google listened to my incantation of
> "rstudio configuration file" and the second result was:

> 
https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State

> RStudio Desktop is also open source, so you can download
> the source code and look at the operating-system-specific
> bits (for "where") if the above link goes out of date or
> disappears.

Thanks a lot, Jeff!

And for the archives:  On reasonable OS's,  the hidden
directory/folder containing all the info is
 ~/.rstudio-desktop/
and if "things are broken" the recommendation is to rename that
   mv ~/.rstudio-desktop  ~/backup-rstudio-desktop
and (zip and) send along with your e-mail to the experts for diagnosis.


> On Thu, 9 Feb 2017, Martin Maechler wrote:

>> 
>>> Ulrik Stervbo  on Thu, 9
>>> Feb 2017 14:37:57 + writes:
>> 
>> > Hi Georg, > maybe someone here knows, but I think you
>> are more likely to get answers to > Rstudio related
>> questions with RStudio support: >
>> https://support.rstudio.com/hc/en-us
>> 
>> > Best, > Ulrik
>> 
>> Indeed, thank you, Ulrik.
>> 
>> In this special case, however, I'm quite sure many
>> readers of R-help would be interested in the answer; so
>> once you receive an answer, please post it (or a link to
>> a public URL with it) here on R-help, thank you in
>> advance.
>> 
>> We would like to be able to *save*, or sometimes *set* /
>> *reset* such options "in a scripted manner", e.g. for
>> controlled exam sessions.
>> 
>> Martin Maechler, ETH Zurich
>> 
>> > On Thu, 9 Feb 2017 at 12:35 
>> wrote:
>> 
>> >> Hi All, >> I would like to make a backup of my RStudio
>> IDE options I configure using >> "Tools/Global Options"
>> from the menu bar. Searching the >> web did not reveal
>> anything.
>> 
>> >> Can you tell me where RStudio IDE does store its
>> configuration?
>> 
>> >> Kind regards >> Georg
>> 
>> __
>> 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.
>> 

> 
---
> Jeff Newmiller The .  .  Go Live...
> DCN: Basics: ##.#.  ##.#.  Live
> Go...  Live: OO#.. Dead: OO#..  Playing Research Engineer
> (Solar/Batteries O.O#.  #.O#.  with /Software/Embedded
> Controllers) .OO#.  .OO#.  rocks...1k
> 
---

__
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] vars package - irf() does not work

2017-02-22 Thread PIKAL Petr
Hi

You sent it to wrong person. I am not the one who have problems with vars code. 
It was T.Riedle who had. I am cc’ing it to R help so he can answer you if he 
read it.

Cheers
Petr

From: John C Frain [mailto:fra...@gmail.com]
Sent: Wednesday, February 22, 2017 9:51 PM
To: PIKAL Petr 
Subject: Re: [R] vars package - irf() does not work



John C Frain
3 Aranleigh Park
Rathfarnham
Dublin 14
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:fra...@tcd.ie
mailto:fra...@gmail.com

On 22 February 2017 at 13:51, PIKAL Petr 
> wrote:
Hi

I have no knowledge of vars package. However from what you describe that it 
sometimes works and sometimes not (although I wonder what it does mean) it 
seems to me that you either mask some arguments used by the function in your 
environment or misspell sometimes arguments or use invalid string in response 
argument.

It would be very unusual if

irf.USAg<-irf(varest.USA, response = "g", n.ahead = 48, boot = TRUE, ci=0.95)

resulted in error and when you repeat it, it does not.

If you want better answer maybe from more knowledgeable people  than myself, 
you should provide an example which works and which does not with some data 
(either your own or from e.g. package data).

Cheers
Petr

The following script
The following example taken from the help files for the vars package and your 
script works fine for me

rm(list=ls())
library(vars)
data(Canada)
test.var <- VAR(Canada, lag.max = 4, ic = "SC", type = "both")
test.var
summary(test.var)
#irf.test<-irf(test.var, response = "g", n.ahead = 48, boot = TRUE, ci=0.95)
irf.test<-irf(test.var, response = "e", n.ahead = 48, boot = TRUE, ci=0.95)
plot(irf.test)

adapted from the vars package help files and your script works fine for me. 
Your script looks ok to me. Can you send a minimum example of a complete script 
and data that shows the problem. Otherwise no one will be able to tell you what 
is wrong.

If you are cutting and pasting from a pdf some characters (e.g. quote marks, ^  
etc.) may not copy correctly. There may also be hidden characters in spaces 
that may be causing problems. If this is the case it is easily fixed by 
deleting the offending characters and spaces.

> -Original Message-
> From: R-help 
> [mailto:r-help-boun...@r-project.org] On 
> Behalf Of T.Riedle
> Sent: Wednesday, February 22, 2017 10:57 AM
> To: R-help@r-project.org
> Subject: [R] vars package - irf() does not work
>
>
>
>
> Dear all,
>
> I have not received any response on this email. Is there anybody who can
> help me?
>
> I want to run an impulse response analysis using the vars() package. The code
> looks as follwows.
>
>
> # list of class varest
> varest.USA<-VAR(VAR_analsis_DataUSA, lag.max = 24, ic = "SC", type =
> "both")
>
> varest.USA
>
> summary(varest.USA)
>
>
>
> #Run irf analysis
> irf.USAg<-irf(varest.USA, response = "g", n.ahead = 48, boot = TRUE, ci=0.95)
>
> plot(irf.USAg)
>
>
> The problem is that R returns an error that the arguments in irf are unused.
> That is, unused arguments (response="g", n.ahead = 48, boot = TRUE,
> ci=0.95) The strangeness is that it sometimes works but most of the time it
> does not. I installed vars() last month and irf() worked well but now it does
> only occasionally. I have just edited the data but kept the code unchanged.
>
>
> In addition, I have the same problem when I am trying to replicate the
> example on irf() in the vars vignette althoug it also worked well when I
> installed vars and run the example.
>
>
> Does anybody have an idea what is wrong?
>
>
>
>
>
>
>
> [[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.


__
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.



Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 

[R] forecast using linear model

2017-02-22 Thread Mayukh Dass
Hello,

I have a time series with sales data of two products A and B. The sales
data are reported weekly.

I want to forecast next 26 weeks sales data for product A using trend,
seasonality and sales of B.

So first I forecast next 26 weeks sales of B with only trend and season.
Next, I tried to create a data frame with these new 26 values of B, and
forecast sales of A. Unfortunately, I am getting the following error:

> train.lm.trend.season.pred <- forecast(train.lm.trend.season, h=26,
newdata=future_data)
Error in eval(expr, envir, enclos) : object 'solvedFN___1' not found

The code used:



nFuture <- 26
trainc1.ts <- window(pB.ts) #sales of Product B
train.ts <- window(pA.ts) #sales of Product A

trainc1.lm.trend.season <- tslm(trainc1.ts ~ trend + season)
summary(trainc1.lm.trend.season)
trainc1.lm.trend.season.pred <- forecast(trainc1.lm.trend.season, h =
nFuture, level = 0)

future_data <- data.frame(
  com1 = trainc1.lm.trend.season.pred$mean
)

forecast(fit, newdata=future_data)

train.lm.trend.season <- tslm(train.ts ~ trend + season+trainc1.ts)
summary(train.lm.trend.season)

train.lm.trend.season.pred <- forecast(train.lm.trend.season, h=26,
newdata=future_data)


It will be great if you can help me.

Mayukh

[[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] single strip for the same group in dotplot lattice

2017-02-22 Thread Duncan Mackay
Resending the previous email as the data = mdata2 is wrong for the first
plot should be mdata

dotplot(
  value ~ type|ct,
  mdata,
  groups = typeT,
  par.settings = list(strip.background = list(col="paleturquoise"),
  superpose.symbol = list(col = c(2:4),
  pch = rep(c(1,20),each = 3))),
# type
  scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
  main = "Luminex analysis MTb humans",
  xlab = "Target", 
  ylab = "Reading",
  auto.key = T
)


Adding:
Depending on preferences for cluster (run) and target the new columns could
be changed to suit.

With "duplication" pch and col, rather than arguments themselves can be
adjusted to suit in par.settings which makes doing the key easier

Regards

Duncan


-Original Message-
From: Duncan Mackay [mailto:dulca...@bigpond.com] 
Sent: Thursday, 23 February 2017 13:50
To: R; 'Luigi Marongiu'
Subject: RE: [R] single strip for the same group in dotplot lattice

Hi Liugi

Here are some ideas quickly

4 panels diagonals are blank

mdata = my.data
mdata$ct <- paste(target, "Run", rep(1:2, each = 6))
mdata$typeT <- paste(mdata$target,mdata$type)

dotplot(
  value ~ type|ct,
  mdata2,
  groups = typeT,
  par.settings = list(strip.background = list(col="paleturquoise"),
  superpose.symbol = list(col = c(2:4),
  pch = rep(c(1,20),each = 3))),
# type
  scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
  main = "Luminex analysis MTb humans",
  xlab = "Target", 
  ylab = "Reading",
  auto.key = T,
  panel = panel.superpose
)

# for when the 4 panels have plots not 2 as now
 mdata2 = mdata
 mdata2$target = rep(LETTERS[2:1], ea=6)
 mdata2$value= mdata2$value+0.1
 mdata2 <- rbind(mdata,mdata2)

mdata2$typeT <- paste(mdata2$target,mdata2$type)

 dotplot(
   value ~ type|target + cluster,
   mdata2,
   groups = typeT,
   par.settings = list(strip.background = list(col="paleturquoise"),
   superpose.symbol = list(col = c(2:4),
   pch = rep(c(1,20),each =
3))), # type
   scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
   main = "Luminex analysis MTb humans",
   xlab = "Target", 
   ylab = "Reading",
   auto.key = T,
   panel = panel.superpose
 )


 dotplot(
   value ~ type|ct,
   mdata2,
   groups = typeT,
   par.settings = list(strip.background = list(col="paleturquoise"),
   superpose.symbol = list(col = c(2:4),
   pch = rep(c(1,20),each =
3))), # type
   scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
   main = "Luminex analysis MTb humans",
   strip= strip.custom(factor.levels = paste("Run",1:2),
par.strip.text = list(cex = 1) ),
   xlab = "Target", 
   ylab = "Reading",
   auto.key = T,
   panel = panel.superpose
 )

dotplot(
  value ~ type|cluster,
  mdata2,
  groups = typeT,
  par.settings = list(strip.background = list(col="paleturquoise"),
  superpose.symbol = list(col = c(2:4),
  pch = rep(c(1,20),each = 3))),
# type
  scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
  main = "Luminex analysis MTb humans",
  xlab = "Target", 
  ylab = "Reading",
  auto.key = T,
  panel = panel.superpose
)


Regards

Duncan

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Luigi
Marongiu
Sent: Wednesday, 22 February 2017 21:26
To: P Tennant; r-help
Subject: Re: [R] single strip for the same group in dotplot lattice

Dear Philip,
the data is indeed a toy data: the real one will have 15 panels (=targets)
and two or three clusters. this means that I will have 15 strips with the
label "run 1" = "cluster 1" etc. the point of the toy data is that I get a
4x4 panel plot with 8 strips labelled "run 1", "run 2", "A" and "B". What I
am looking for is to collapse the strips so to get only one label "run 1"
and only one with "run 2" in order to simplify the plot. Hope this helps.
Thanks
Luigi

On Wed, Feb 22, 2017 at 9:53 AM, P Tennant  wrote:

> Hi Luigi,
>
> I'm afraid I don't understand your toy data as you've described it, but if
> you really don't have run 2 for target A, and don't have run 1 for target
> B, why not just create another factor that reflects this, and plot that?
>
>  my.data$clus2 <- with(my.data, interaction(cluster, target))
>
>  and call: dotplot(value ~ type| clus2, ... )
>
>
> Philip
>
>
> On 22/02/2017 8:03 PM, Luigi Marongiu wrote:
>
>> dear all,
>> I have a set of data that is subdivided in cluster (run 1/run 2) and in
>> target (A/B). When plotting, I obtain a panel strip with "run 1" and "run
>> 2" for each "A" and "B" panel, so "run 1" appears twice and so does "run
>> 2". It is possible to merge the strip together so that I will have "run
1"
>> or "run 

Re: [R] single strip for the same group in dotplot lattice

2017-02-22 Thread Duncan Mackay
Hi Liugi

Here are some ideas quickly

4 panels diagonals are blank

mdata = my.data
mdata$ct <- paste(target, "Run", rep(1:2, each = 6))
mdata$typeT <- paste(mdata$target,mdata$type)

dotplot(
  value ~ type|ct,
  mdata2,
  groups = typeT,
  par.settings = list(strip.background = list(col="paleturquoise"),
  superpose.symbol = list(col = c(2:4),
  pch = rep(c(1,20),each = 3))),
# type
  scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
  main = "Luminex analysis MTb humans",
  xlab = "Target", 
  ylab = "Reading",
  auto.key = T,
  panel = panel.superpose
)

# for when the 4 panels have plots not 2 as now
 mdata2 = mdata
 mdata2$target = rep(LETTERS[2:1], ea=6)
 mdata2$value= mdata2$value+0.1
 mdata2 <- rbind(mdata,mdata2)

mdata2$typeT <- paste(mdata2$target,mdata2$type)

 dotplot(
   value ~ type|target + cluster,
   mdata2,
   groups = typeT,
   par.settings = list(strip.background = list(col="paleturquoise"),
   superpose.symbol = list(col = c(2:4),
   pch = rep(c(1,20),each =
3))), # type
   scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
   main = "Luminex analysis MTb humans",
   xlab = "Target", 
   ylab = "Reading",
   auto.key = T,
   panel = panel.superpose
 )


 dotplot(
   value ~ type|ct,
   mdata2,
   groups = typeT,
   par.settings = list(strip.background = list(col="paleturquoise"),
   superpose.symbol = list(col = c(2:4),
   pch = rep(c(1,20),each =
3))), # type
   scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
   main = "Luminex analysis MTb humans",
   strip= strip.custom(factor.levels = paste("Run",1:2),
par.strip.text = list(cex = 1) ),
   xlab = "Target", 
   ylab = "Reading",
   auto.key = T,
   panel = panel.superpose
 )

dotplot(
  value ~ type|cluster,
  mdata2,
  groups = typeT,
  par.settings = list(strip.background = list(col="paleturquoise"),
  superpose.symbol = list(col = c(2:4),
  pch = rep(c(1,20),each = 3))),
# type
  scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
  main = "Luminex analysis MTb humans",
  xlab = "Target", 
  ylab = "Reading",
  auto.key = T,
  panel = panel.superpose
)


Regards

Duncan

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Luigi
Marongiu
Sent: Wednesday, 22 February 2017 21:26
To: P Tennant; r-help
Subject: Re: [R] single strip for the same group in dotplot lattice

Dear Philip,
the data is indeed a toy data: the real one will have 15 panels (=targets)
and two or three clusters. this means that I will have 15 strips with the
label "run 1" = "cluster 1" etc. the point of the toy data is that I get a
4x4 panel plot with 8 strips labelled "run 1", "run 2", "A" and "B". What I
am looking for is to collapse the strips so to get only one label "run 1"
and only one with "run 2" in order to simplify the plot. Hope this helps.
Thanks
Luigi

On Wed, Feb 22, 2017 at 9:53 AM, P Tennant  wrote:

> Hi Luigi,
>
> I'm afraid I don't understand your toy data as you've described it, but if
> you really don't have run 2 for target A, and don't have run 1 for target
> B, why not just create another factor that reflects this, and plot that?
>
>  my.data$clus2 <- with(my.data, interaction(cluster, target))
>
>  and call: dotplot(value ~ type| clus2, ... )
>
>
> Philip
>
>
> On 22/02/2017 8:03 PM, Luigi Marongiu wrote:
>
>> dear all,
>> I have a set of data that is subdivided in cluster (run 1/run 2) and in
>> target (A/B). When plotting, I obtain a panel strip with "run 1" and "run
>> 2" for each "A" and "B" panel, so "run 1" appears twice and so does "run
>> 2". It is possible to merge the strip together so that I will have "run
1"
>> or "run 2" only once? this will reduce the complexity of the data and
>> allow
>> more space for more detailed information in the strip.
>> the data follows,
>> thank you
>> L
>>
>> cluster<- c(rep("run_1", 6), rep("run_2", 6))
>> type<- rep(c("blank", "positive", "negative"),2)
>> target<- c(rep("A", 6), rep("B", 6))
>> value<- c(0.01, 1.1, 0.5,
>> 0.02, 1.6, 0.8,
>> 0.07, 1.4, 0.7,
>> 0.03, 1.4, 0.4)
>> my.data<- data.frame(cluster, type, target, value)
>>
>> library(lattice)
>> dotplot(
>>value ~ type|target + cluster,
>>my.data,
>>groups = type,
>>pch=21,
>>main = "Luminex analysis MTb humans",
>>xlab = "Target", ylab = "Reading",
>>col = c("grey", "green", "red"),
>>par.settings = list(strip.background = list(col="paleturquoise")),
>>scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
>>key = list(
>>  space = "top",
>>  columns = 3,
>>  text = list(c("Blank", "Negative", "Positive"), 

Re: [R] optimisation - Error in checkFunc(Func2, times, y, rho) : The number of derivatives returned by func() (22) must equal the length of the initial conditions vector (2)

2017-02-22 Thread Jim Lemon
I'm not really familiar with what you are doing. when I try to debug
something like this, I run each step separately to determine where the
error is. For example, if I clean up the code a bit and run the derivs
function:

 derivs(time,y,parms)
[[1]]
 [1]  429.709540  438.844035  281.741953  404.175692  435.341449  447.532442
 [7]  448.103560  443.722972  419.132716  345.992428  363.259812 -182.179223
[13] -220.477447 -115.238330 -113.710739   -8.218996 -146.384226  -92.999563
[19] -921.027854  -61.074252 -885.550697  -40.281082

Warning messages:
1: In k4 * ((1 + k5 * cP)/(1 + k7 * cE)) * x :
  longer object length is not a multiple of shorter object length
2: In (1/k8) * k4 * ((1 + k5 * cP)/(1 + k7 * cE)) * x :
  longer object length is not a multiple of shorter object length

Obviously there is a problem with the length of "x" as it is recycled
within the function. Also, your cE and cP values are not causing a
problem as the function runs and returns what may be reasonable
values. As I don't have the deSolve package installed (and I have my
own work to do) I can only suggest trying a stepwise debugging
process.

Jim

On Wed, Feb 22, 2017 at 8:58 PM, Malgorzata Wieteska
 wrote:
> Thank you Jim,
>
> I've installed XLConnect using Tools tab (install.packages option didn't
> work for some reason -I've tried before) and fixed the bracket. However, I
> still get the same error message. I've checked what cause this error and is
> caused by external data (cE and cP) fed into equations in derivs function.
>
> Do you have any suggestion how to input those values at corresponding time
> points into equations to make ode in the model_cost to integrate?
>
> Malgosia
>
>
> On Tuesday, 21 February 2017, 22:03:10, Jim Lemon 
> wrote:
>
>
> Hi Malgorzata,
> Did you try to _install_ rather than just _load_ the XLConnect package?
>
> install.packages("XLConnect")
>
> Sad to say, your code:
>
> time=c(16,17,18,19,20,21,22,23,24,25,26)
> #x=c(20.2,18.9,16.5)
> y=c(7.63,9.22,4.86,4.78,0.38,6.13,3.91,38.41,2.58,36.95,1.73)
> cE=c(15.05,38.01,41.09,31.41,3.54,15.92,24.01,25.29,14.82,43.93,2.45)
> cP=c(0.47,0.43,4.8,1.07,0.38,0.3,0.14,0.29,0.9,2.51,1.94)
> #df<-data.frame(time,y,cE,cP)
> #dfrequire(FME)
> ### this will fail unless XLConnect has been installed
> require(XLConnect)
> #Initial values of the parameters
> parms=c(k1=500, k2=4500, k3=200,k4=2.42, k5=0.26,k6=12.2,k7=0.004,
> k8=55,k9=24,k10=8)
> #definition of the parameters function
> derivs<-function(time,y,pars){
> with(as.list(c(pars,y)),{
>   cE=c(15.05,38.01,41.09,31.41,3.54,15.92,24.01,25.29,14.82,43.93,2.45)
>   cP=c(0.47,0.43,4.8,1.07,0.38,0.3,0.14,0.29,0.9,2.51,1.94)
>   dx=(k1+(k2*cE^k10)/(k3^k10+cE^k10))/(1+cP/k6)-
>   k4*((1+k5*cP)/(1+k7*cE))*x;
>   #dRP_LH/dt
>   dy=(1/k8)*k4*((1+k5*cP)/(1+k7*cE))*x-k9*y
>   #dL/dt
>   list(c(dx,dy))
> })
> }
> initial<-c(x=x[1],y=y[1])
> model_cost<-function(pars){
> out<-ode(y=initial,time=time,func=derivs,parms=pars)
> cost<-modCost(model=out,obs=df,x="time")
> return(cost)
> } ### you seem to be missing a closing brace here
> model_cost(parms)$model
> # model fitting
> model_fit<-modFit(f=model_cost,p=parms)
> } ### maybe this is the missing closing brace
> model_cost(parms)
>
> is pretty messy with several lines commented out that may be
> necessary, and has a number of possible errors. I have pointed out a
> few (see ### comments). If the problem is the missing XLConnect
> package, perhaps installing it will produce some meaningful error
> messages.
>
> Jim
>
> On Tue, Feb 21, 2017 at 10:03 PM, Malgorzata Wieteska via R-help
>  wrote:
>> Hello,
>> I get an error message:Error in checkFunc(Func2, times, y, rho) :  The
>> number of derivatives returned by func() (22) must equal the length of the
>> initial conditions vector (2)
>> I try to optimise system of differential equations with 2 extra variables
>> derived from the data.frame.
>> I didn't manage to install XLConnect package, so I don't know if this is
>> the source of the problem.
>> Loading required package: XLConnectWarning message:In library(package,
>> lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :  there
>> is no package called ‘XLConnect’
>> I have missing data, so time frame is limited. I haven't got values for
>> solution of the first equation, but I hope that it isn't problem, I've got
>> the same message when putting random numbers as x values.
>
>

__
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] converting time format

2017-02-22 Thread Jim Lemon
Sure:

df.count.mon$time<-format(as.Date(paste(df.count.mon$year,  df.count.mon$mon,1),
 '%Y %m %d'),"%Y %m")
> df.count.mon
   count year montime
1 22 2014   1 2014 01
2 12 2014   2 2014 02
...

Jim

On Thu, Feb 23, 2017 at 8:18 AM, lily li  wrote:
> Yes, it is a little different. Is there a way to get '-mm' format?
> Thanks.
>
> On Wed, Feb 22, 2017 at 2:10 PM, Jim Lemon  wrote:
>>
>> Hi Lily.
>> Two problems. You have named the month field "mon" and then refer to
>> it as "month". Second, as the resolution of as.Date is days, it can't
>> produce a valid date without specifying the day. Thus:
>>
>> df.count.mon<-data.frame(count=sample(1:24,24),
>>  year=rep(2014:2015,each=2),mon=rep(1:12,2))
>> # make each day the first day of the month
>> df.count.mon$time<-
>>  as.Date(paste(df.count.mon$year, df.count.mon$mon,1),
>>  '%Y %m %d')
>> df.count.mon
>>count year mon   time
>> 1 22 2014   1 2014-01-01
>> 2 12 2014   2 2014-02-01
>> ...
>> You will get values, but I don't think they are the ones you want.
>>
>> Jim
>>
>> On Thu, Feb 23, 2017 at 6:33 AM, lily li  wrote:
>> > Hi R users,
>> >
>> > I have a dataframe, with year, month, day, and other variables. I wanted
>> > to
>> > calculated monthly values of the variables. For example, there is one
>> > variable called 'count'. I use the code below to convert daily data to
>> > monthly data.
>> >
>> > df.count.mon = aggregate(count ~ year+month, data= df, sum)
>> >
>> > The new dataframe has three columns: year, month, and count. Now I want
>> > to
>> > add one more column as 'time', which has the format '-mm'. I use the
>> > code below but the new column has all NA values. What is the problem and
>> > how to solve it?
>> >
>> > df.count.mon$time = as.Date(paste(df.count.mon$year,
>> > df.count.mon$month),
>> > '%Y %m')
>> >
>> > I had experience to add one more column with the format '-mm-dd',
>> > which
>> > works, but not with monthly format. Thanks for your help.
>> >
>> > [[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] converting time format

2017-02-22 Thread lily li
Yes, it is a little different. Is there a way to get '-mm' format?
Thanks.

On Wed, Feb 22, 2017 at 2:10 PM, Jim Lemon  wrote:

> Hi Lily.
> Two problems. You have named the month field "mon" and then refer to
> it as "month". Second, as the resolution of as.Date is days, it can't
> produce a valid date without specifying the day. Thus:
>
> df.count.mon<-data.frame(count=sample(1:24,24),
>  year=rep(2014:2015,each=2),mon=rep(1:12,2))
> # make each day the first day of the month
> df.count.mon$time<-
>  as.Date(paste(df.count.mon$year, df.count.mon$mon,1),
>  '%Y %m %d')
> df.count.mon
>count year mon   time
> 1 22 2014   1 2014-01-01
> 2 12 2014   2 2014-02-01
> ...
> You will get values, but I don't think they are the ones you want.
>
> Jim
>
> On Thu, Feb 23, 2017 at 6:33 AM, lily li  wrote:
> > Hi R users,
> >
> > I have a dataframe, with year, month, day, and other variables. I wanted
> to
> > calculated monthly values of the variables. For example, there is one
> > variable called 'count'. I use the code below to convert daily data to
> > monthly data.
> >
> > df.count.mon = aggregate(count ~ year+month, data= df, sum)
> >
> > The new dataframe has three columns: year, month, and count. Now I want
> to
> > add one more column as 'time', which has the format '-mm'. I use the
> > code below but the new column has all NA values. What is the problem and
> > how to solve it?
> >
> > df.count.mon$time = as.Date(paste(df.count.mon$year,
> df.count.mon$month),
> > '%Y %m')
> >
> > I had experience to add one more column with the format '-mm-dd',
> which
> > works, but not with monthly format. Thanks for your help.
> >
> > [[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.


Re: [R] converting time format

2017-02-22 Thread Jim Lemon
Hi Lily.
Two problems. You have named the month field "mon" and then refer to
it as "month". Second, as the resolution of as.Date is days, it can't
produce a valid date without specifying the day. Thus:

df.count.mon<-data.frame(count=sample(1:24,24),
 year=rep(2014:2015,each=2),mon=rep(1:12,2))
# make each day the first day of the month
df.count.mon$time<-
 as.Date(paste(df.count.mon$year, df.count.mon$mon,1),
 '%Y %m %d')
df.count.mon
   count year mon   time
1 22 2014   1 2014-01-01
2 12 2014   2 2014-02-01
...
You will get values, but I don't think they are the ones you want.

Jim

On Thu, Feb 23, 2017 at 6:33 AM, lily li  wrote:
> Hi R users,
>
> I have a dataframe, with year, month, day, and other variables. I wanted to
> calculated monthly values of the variables. For example, there is one
> variable called 'count'. I use the code below to convert daily data to
> monthly data.
>
> df.count.mon = aggregate(count ~ year+month, data= df, sum)
>
> The new dataframe has three columns: year, month, and count. Now I want to
> add one more column as 'time', which has the format '-mm'. I use the
> code below but the new column has all NA values. What is the problem and
> how to solve it?
>
> df.count.mon$time = as.Date(paste(df.count.mon$year, df.count.mon$month),
> '%Y %m')
>
> I had experience to add one more column with the format '-mm-dd', which
> works, but not with monthly format. Thanks for your help.
>
> [[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] [FORGED] function for remove white space

2017-02-22 Thread José Luis
Oh, thank you so much!!

It's perfect!!



Enviado desde mi iPhone

> El 22 feb 2017, a las 17:49, William Dunlap  escribió:
> 
> Try the following function to apply gsub to all character or factor
> columns of a data.frame (and maintain change the class of all
> columns):
> 
> gsubDataFrame <- function(pattern, replacement, x, ...) {
>stopifnot(is.data.frame(x))
>for(i in seq_len(ncol(x))) {
>if (is.character(x[[i]])) {
>x[[i]] <- gsub(pattern, replacement, x[[i]], ...)
>} else if (is.factor(x[[i]])) {
>levels(x[[i]]) <- gsub(pattern, replacement, levels(x[[i]]), ...)
>} # else do nothing for numeric or other column types
>}
>x
> }
> 
> E.g.,
>> d <- data.frame(stringsAsFactors = FALSE,
> + Int=1:5,
> + Char=c("a a", "baa", "a a ", " aa", "b a a"),
> + Fac=factor(c("x x", "yxx", "x x ", " xx", "y x x")))
>> str(d)
> 'data.frame':   5 obs. of  3 variables:
> $ Int : int  1 2 3 4 5
> $ Char: chr  "a a" "baa" "a a " " aa" ...
> $ Fac : Factor w/ 5 levels " xx","x x","x x ",..: 2 5 3 1 4
>> str(gsubDataFrame(" ", "", d)) # delete spaces, use "[[:space:]]" for 
>> whitespace
> 'data.frame':   5 obs. of  3 variables:
> $ Int : int  1 2 3 4 5
> $ Char: chr  "aa" "baa" "aa" "aa" ...
> $ Fac : Factor w/ 2 levels "xx","yxx": 1 2 1 1 2
> 
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
> 
> 
>> On Tue, Feb 21, 2017 at 11:35 PM, José Luis  wrote:
>> Thank's for your answer.
>> 
>> I'm using read.csv.
>> 
>> Enviado desde mi iPad
>> 
>>> El 22/2/2017, a las 3:39, William Michels  escribió:
>>> 
>>> Hi José (and Rolf),
>>> 
>>> It's not entirely clear what type of 'whitespace' you're referring to,
>>> but if you're using read.table() or read.csv() to create your
>>> dataframe in the first place, setting 'strip.white = TRUE' will remove
>>> leading and trailing whitespace 'from unquoted character fields
>>> (numeric fields are always stripped).'
>>> 
 ?read.table
 ?read.csv
>>> 
>>> Cheers,
>>> 
>>> Bill
>>> 
>>> 
> On 2/21/17, Rolf Turner  wrote:
> On 22/02/17 12:51, José Luis Aguilar wrote:
> Hi all,
> 
> i have a dataframe with 34 columns and 1534 observations.
> 
> In some columns I have strings with spaces, i want remove the space.
> Is there a function that removes whitespace from the entire dataframe?
> I use gsub but I would need some function to automate this.
 
 Something like
 
 X <- as.data.frame(lapply(X,function(x){gsub(" ","",x)}))
 
 Untested, since you provide no reproducible example (despite being told
 by the posting guide to do so).
 
 I do not know what my idea will do to numeric columns or to factors.
 
 However it should give you at least a start.
 
 cheers,
 
 Rolf Turner
 
 --
 Technical Editor ANZJS
 Department of Statistics
 University of Auckland
 Phone: +64-9-373-7599 ext. 88276
 
 __
 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-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-es] [OT] Sobre gráficos

2017-02-22 Thread hibiki

Gracias


On 22/02/17 04:28, miguel.angel.rodriguez.mui...@sergas.es wrote:

Hola Nivaildo.

Por desgracia, tu email a los administradores de la lista, con la
solicitud de cambio de dirección de correo, no ha llegado (a qué
dirección lo has enviado?). Me alegro de que hayas podido resolverlo
dando de alta la nueva dirección (en esa misma URL puedes gestionar tus
suscripciones).

Aprovecho para recordar a la lista que la URL de solicitud de alta/baja
y/o de gestión de nuestra suscripción (cambio de email, contraseña,
formatos...) es https://stat.ethz.ch/mailman/listinfo/r-help-es

Un saludo,
Miguel.



El 21/02/2017 a las 20:44, hibiki escribió:

Much�simas gracias Eric, lo del rebote debe ser porque en la escuela
cambiaron el dominio y debes estar mandando el mensaje al la direcci�n
vieja 'npolanco@*cuij*.edu.cu', como cambiaron el dominio *CUIJ* por
*UIJ* ahora la direcci�n es 'npolanco@*uij*.edu.cu' que es como me
registre a la lista recientemente, como no sabia cambiar el correo en el
usuario y le envi� un mensaje con la duda al administrador de la lista
pero nunca recib� respuesta, no me quedo de otra que volverme a
registrar con la nueva direcci�n estando ahora las 2 activas para un
mismo usuario o algo as�. Espero entonces a que me env�es el link para
poder descargarlos. Yo estoy cursando una maestr�a en miner�a de datos y
estoy muy desinformado tanto del tema como de R, pues no soy muy ...
inteligente por decirlo de alguna manera y nunca hab�a escuchado sobre
esto, pero he le�do muchas veces que el R es un software fenomenal y
libre, de hecho el profesor que me imparti� el modulo de estad�stica nos
dijo que era de los software estad�sticos el que tenia los mejores
algoritmos y los mejores gr�ficos por lo que estoy decidido a aprender
de �l y trabajarlo y como nuestra universidad es peque�a, reciente y con
poca experiencia, desarrollo y un claustro muy joven asociado a otros
problemas de recursos quiero conocer de R lo suficiente como para
preparar a los profesores y estudiantes con lo m�nimo necesario para que
sea el software estad�stico de nuestra carrera para la investigaci�n y
el desarrollo.


PD: ENVI� EL MENSAJE A TODA LA LISTA Y NO SOLO A ERIC POR SI ALG�N OTRO
NECESITE MANDARME UN MENSAJE PRIVADO TENGA EN CUENTA LA DIRECCI�N DE
CORREO A LA QUE ENV�A.

Fraternalmente, Nivaildo.












Nota: A información contida nesta mensaxe e os seus posibles documentos 
adxuntos é privada e confidencial e está dirixida únicamente ó seu 
destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por 
favor elimínea. A distribución ou copia desta mensaxe non está autorizada.

Nota: La información contenida en este mensaje y sus posibles documentos 
adjuntos es privada y confidencial y está dirigida únicamente a su 
destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, 
por favor elimínelo. La distribución o copia de este mensaje no está autorizada.

See more languages: http://www.sergas.es/aviso-confidencialidad


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

[R] converting time format

2017-02-22 Thread lily li
Hi R users,

I have a dataframe, with year, month, day, and other variables. I wanted to
calculated monthly values of the variables. For example, there is one
variable called 'count'. I use the code below to convert daily data to
monthly data.

df.count.mon = aggregate(count ~ year+month, data= df, sum)

The new dataframe has three columns: year, month, and count. Now I want to
add one more column as 'time', which has the format '-mm'. I use the
code below but the new column has all NA values. What is the problem and
how to solve it?

df.count.mon$time = as.Date(paste(df.count.mon$year, df.count.mon$month),
'%Y %m')

I had experience to add one more column with the format '-mm-dd', which
works, but not with monthly format. Thanks for your help.

[[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 we combine more than one matrix aafter finding their variance

2017-02-22 Thread Tahira Perveen


[[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] [FORGED] function for remove white space

2017-02-22 Thread William Dunlap via R-help
Try the following function to apply gsub to all character or factor
columns of a data.frame (and maintain change the class of all
columns):

gsubDataFrame <- function(pattern, replacement, x, ...) {
stopifnot(is.data.frame(x))
for(i in seq_len(ncol(x))) {
if (is.character(x[[i]])) {
x[[i]] <- gsub(pattern, replacement, x[[i]], ...)
} else if (is.factor(x[[i]])) {
levels(x[[i]]) <- gsub(pattern, replacement, levels(x[[i]]), ...)
} # else do nothing for numeric or other column types
}
x
}

E.g.,
> d <- data.frame(stringsAsFactors = FALSE,
+ Int=1:5,
+ Char=c("a a", "baa", "a a ", " aa", "b a a"),
+ Fac=factor(c("x x", "yxx", "x x ", " xx", "y x x")))
> str(d)
'data.frame':   5 obs. of  3 variables:
 $ Int : int  1 2 3 4 5
 $ Char: chr  "a a" "baa" "a a " " aa" ...
 $ Fac : Factor w/ 5 levels " xx","x x","x x ",..: 2 5 3 1 4
> str(gsubDataFrame(" ", "", d)) # delete spaces, use "[[:space:]]" for 
> whitespace
'data.frame':   5 obs. of  3 variables:
 $ Int : int  1 2 3 4 5
 $ Char: chr  "aa" "baa" "aa" "aa" ...
 $ Fac : Factor w/ 2 levels "xx","yxx": 1 2 1 1 2

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Tue, Feb 21, 2017 at 11:35 PM, José Luis  wrote:
> Thank's for your answer.
>
> I'm using read.csv.
>
> Enviado desde mi iPad
>
>> El 22/2/2017, a las 3:39, William Michels  escribió:
>>
>> Hi José (and Rolf),
>>
>> It's not entirely clear what type of 'whitespace' you're referring to,
>> but if you're using read.table() or read.csv() to create your
>> dataframe in the first place, setting 'strip.white = TRUE' will remove
>> leading and trailing whitespace 'from unquoted character fields
>> (numeric fields are always stripped).'
>>
>>> ?read.table
>>> ?read.csv
>>
>> Cheers,
>>
>> Bill
>>
>>
>>> On 2/21/17, Rolf Turner  wrote:
 On 22/02/17 12:51, José Luis Aguilar wrote:
 Hi all,

 i have a dataframe with 34 columns and 1534 observations.

 In some columns I have strings with spaces, i want remove the space.
 Is there a function that removes whitespace from the entire dataframe?
 I use gsub but I would need some function to automate this.
>>>
>>> Something like
>>>
>>> X <- as.data.frame(lapply(X,function(x){gsub(" ","",x)}))
>>>
>>> Untested, since you provide no reproducible example (despite being told
>>> by the posting guide to do so).
>>>
>>> I do not know what my idea will do to numeric columns or to factors.
>>>
>>> However it should give you at least a start.
>>>
>>> cheers,
>>>
>>> Rolf Turner
>>>
>>> --
>>> Technical Editor ANZJS
>>> Department of Statistics
>>> University of Auckland
>>> Phone: +64-9-373-7599 ext. 88276
>>>
>>> __
>>> 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-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] How to search t value when you know degree of freedom?

2017-02-22 Thread Rui Barradas

Hello,

It would be ?pt not pnorm.
And as you can see in that help page you need another value, the value 
of the quantile. (Don't worry about the arguments ncp or log just q and df)


Hope this helps,

Rui Barradas

Em 22-02-2017 15:53, vod vos escreveu:


Hi everyone,

How to search t value when you know degree of freedom?

For example, the degree of freedom is 29, how to use R to calculate the t value 
for it?

t.test does not help, or pnorm? I am not sure.

Thanks.

__
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] How to search t value when you know degree of freedom?

2017-02-22 Thread vod vos

Hi everyone,

How to search t value when you know degree of freedom? 

For example, the degree of freedom is 29, how to use R to calculate the t value 
for it? 

t.test does not help, or pnorm? I am not sure.

Thanks.

__
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] vars package - irf() does not work

2017-02-22 Thread PIKAL Petr
Hi

I have no knowledge of vars package. However from what you describe that it 
sometimes works and sometimes not (although I wonder what it does mean) it 
seems to me that you either mask some arguments used by the function in your 
environment or misspell sometimes arguments or use invalid string in response 
argument.

It would be very unusual if

irf.USAg<-irf(varest.USA, response = "g", n.ahead = 48, boot = TRUE, ci=0.95)

resulted in error and when you repeat it, it does not.

If you want better answer maybe from more knowledgeable people  than myself, 
you should provide an example which works and which does not with some data 
(either your own or from e.g. package data).

Cheers
Petr

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of T.Riedle
> Sent: Wednesday, February 22, 2017 10:57 AM
> To: R-help@r-project.org
> Subject: [R] vars package - irf() does not work
>
>
>
>
> Dear all,
>
> I have not received any response on this email. Is there anybody who can
> help me?
>
> I want to run an impulse response analysis using the vars() package. The code
> looks as follwows.
>
>
> # list of class varest
> varest.USA<-VAR(VAR_analsis_DataUSA, lag.max = 24, ic = "SC", type =
> "both")
>
> varest.USA
>
> summary(varest.USA)
>
>
>
> #Run irf analysis
> irf.USAg<-irf(varest.USA, response = "g", n.ahead = 48, boot = TRUE, ci=0.95)
>
> plot(irf.USAg)
>
>
> The problem is that R returns an error that the arguments in irf are unused.
> That is, unused arguments (response="g", n.ahead = 48, boot = TRUE,
> ci=0.95) The strangeness is that it sometimes works but most of the time it
> does not. I installed vars() last month and irf() worked well but now it does
> only occasionally. I have just edited the data but kept the code unchanged.
>
>
> In addition, I have the same problem when I am trying to replicate the
> example on irf() in the vars vignette althoug it also worked well when I
> installed vars and run the example.
>
>
> Does anybody have an idea what is wrong?
>
>
>
>
>
>
>
> [[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.


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such 

[R] Facebook package error - Can't get reactions

2017-02-22 Thread Vivek kumar Singh
Hi All,

 

I am using facebook package in R. Following is my code.

 

install.packages('Rfacebook',dependencies = T)

library('Rfacebook')

#create a favebook app and add http://localhost:1410/ to your app

fb_oauth <- fbOAuth(app_id="***",

app_secret="*")

 

fb_page <- getPage(page="subway", token=fb_oauth,n=50,feed = T,reactions =
T)

 

I get an error when I try to get reactions (i.e., reactions=T). When I
remove the 'reactions' argument, it works.

 

fb_page <- getPage(page="subway", token=fb_oauth,n=50,feed = T)  works.

 

Please let me know why am I getting error with reactions? Also, suggest if
there are alternate packages for Facebook in R.

 

Regards,

 

Vivek

 


[[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-es] Comparar dos fechas

2017-02-22 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal?

Usa & y no &&. Mira

?`&`

para los detalles. Más:

1) Te sobra el which. No es necesario.
2) Te recomendaría que transformases tu columna COFECHA a Date cuanto
antes. El código sería más simple.

Salud,

Carlos J. Gil Bellosta
http://www.datanalytics.com

El día 22 de febrero de 2017, 12:46, Andoni Alda
 escribió:
> Hola,
> soy bastante nuevo con R y estoy haciendo mis pruebas.
> Tengo un data.frame que contiene un campo de fecha, y me gustaria conseguir
> otro data.frame con los valores entre un rango de fechas.
> Ahora mismo estoy haciendolo de la siguiente manera:
>
> consulta[which(as.Date(consulta$COFECHA) >
> as.Date(input$dateRange[1])&(consulta$COFECHA) <
> as.Date(input$dateRange[2]) ), ]
>
> El problema es que solo consigo una fecha pero deberia haber mas
> Un saludo
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es

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


[R-es] Comparar dos fechas

2017-02-22 Thread Andoni Alda
Hola,
soy bastante nuevo con R y estoy haciendo mis pruebas.
Tengo un data.frame que contiene un campo de fecha, y me gustaria conseguir
otro data.frame con los valores entre un rango de fechas.
Ahora mismo estoy haciendolo de la siguiente manera:

consulta[which(as.Date(consulta$COFECHA) >
as.Date(input$dateRange[1])&(consulta$COFECHA) <
as.Date(input$dateRange[2]) ), ]

El problema es que solo consigo una fecha pero deberia haber mas
Un saludo

[[alternative HTML version deleted]]

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


Re: [R] single strip for the same group in dotplot lattice

2017-02-22 Thread Luigi Marongiu
Dear Philip,
the data is indeed a toy data: the real one will have 15 panels (=targets)
and two or three clusters. this means that I will have 15 strips with the
label "run 1" = "cluster 1" etc. the point of the toy data is that I get a
4x4 panel plot with 8 strips labelled "run 1", "run 2", "A" and "B". What I
am looking for is to collapse the strips so to get only one label "run 1"
and only one with "run 2" in order to simplify the plot. Hope this helps.
Thanks
Luigi

On Wed, Feb 22, 2017 at 9:53 AM, P Tennant  wrote:

> Hi Luigi,
>
> I'm afraid I don't understand your toy data as you've described it, but if
> you really don't have run 2 for target A, and don't have run 1 for target
> B, why not just create another factor that reflects this, and plot that?
>
>  my.data$clus2 <- with(my.data, interaction(cluster, target))
>
>  and call: dotplot(value ~ type| clus2, ... )
>
>
> Philip
>
>
> On 22/02/2017 8:03 PM, Luigi Marongiu wrote:
>
>> dear all,
>> I have a set of data that is subdivided in cluster (run 1/run 2) and in
>> target (A/B). When plotting, I obtain a panel strip with "run 1" and "run
>> 2" for each "A" and "B" panel, so "run 1" appears twice and so does "run
>> 2". It is possible to merge the strip together so that I will have "run 1"
>> or "run 2" only once? this will reduce the complexity of the data and
>> allow
>> more space for more detailed information in the strip.
>> the data follows,
>> thank you
>> L
>>
>> cluster<- c(rep("run_1", 6), rep("run_2", 6))
>> type<- rep(c("blank", "positive", "negative"),2)
>> target<- c(rep("A", 6), rep("B", 6))
>> value<- c(0.01, 1.1, 0.5,
>> 0.02, 1.6, 0.8,
>> 0.07, 1.4, 0.7,
>> 0.03, 1.4, 0.4)
>> my.data<- data.frame(cluster, type, target, value)
>>
>> library(lattice)
>> dotplot(
>>value ~ type|target + cluster,
>>my.data,
>>groups = type,
>>pch=21,
>>main = "Luminex analysis MTb humans",
>>xlab = "Target", ylab = "Reading",
>>col = c("grey", "green", "red"),
>>par.settings = list(strip.background = list(col="paleturquoise")),
>>scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
>>key = list(
>>  space = "top",
>>  columns = 3,
>>  text = list(c("Blank", "Negative", "Positive"), col="black"),
>>  rectangles = list(col=c("grey", "green", "red"))
>>)
>> )
>>
>> [[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/posti
>> ng-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] vars package - irf() does not work

2017-02-22 Thread T.Riedle



Dear all,

I have not received any response on this email. Is there anybody who can help 
me?

I want to run an impulse response analysis using the vars() package. The code 
looks as follwows.


# list of class varest
varest.USA<-VAR(VAR_analsis_DataUSA, lag.max = 24, ic = "SC", type = "both")

varest.USA

summary(varest.USA)



#Run irf analysis
irf.USAg<-irf(varest.USA, response = "g", n.ahead = 48, boot = TRUE, ci=0.95)

plot(irf.USAg)


The problem is that R returns an error that the arguments in irf are unused. 
That is, unused arguments (response="g", n.ahead = 48, boot = TRUE, ci=0.95)
The strangeness is that it sometimes works but most of the time it does not. I 
installed vars() last month and irf() worked well but now it does only 
occasionally. I have just edited the data but kept the code unchanged.


In addition, I have the same problem when I am trying to replicate the example 
on irf() in the vars vignette althoug it also worked well when I installed vars 
and run the example.


Does anybody have an idea what is wrong?







[[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] single strip for the same group in dotplot lattice

2017-02-22 Thread P Tennant

Hi Luigi,

I'm afraid I don't understand your toy data as you've described it, but 
if you really don't have run 2 for target A, and don't have run 1 for 
target B, why not just create another factor that reflects this, and 
plot that?


 my.data$clus2 <- with(my.data, interaction(cluster, target))

 and call: dotplot(value ~ type| clus2, ... )


Philip

On 22/02/2017 8:03 PM, Luigi Marongiu wrote:

dear all,
I have a set of data that is subdivided in cluster (run 1/run 2) and in
target (A/B). When plotting, I obtain a panel strip with "run 1" and "run
2" for each "A" and "B" panel, so "run 1" appears twice and so does "run
2". It is possible to merge the strip together so that I will have "run 1"
or "run 2" only once? this will reduce the complexity of the data and allow
more space for more detailed information in the strip.
the data follows,
thank you
L

cluster<- c(rep("run_1", 6), rep("run_2", 6))
type<- rep(c("blank", "positive", "negative"),2)
target<- c(rep("A", 6), rep("B", 6))
value<- c(0.01, 1.1, 0.5,
0.02, 1.6, 0.8,
0.07, 1.4, 0.7,
0.03, 1.4, 0.4)
my.data<- data.frame(cluster, type, target, value)

library(lattice)
dotplot(
   value ~ type|target + cluster,
   my.data,
   groups = type,
   pch=21,
   main = "Luminex analysis MTb humans",
   xlab = "Target", ylab = "Reading",
   col = c("grey", "green", "red"),
   par.settings = list(strip.background = list(col="paleturquoise")),
   scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
   key = list(
 space = "top",
 columns = 3,
 text = list(c("Blank", "Negative", "Positive"), col="black"),
 rectangles = list(col=c("grey", "green", "red"))
   )
)

[[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-es] [OT] Sobre gráficos

2017-02-22 Thread miguel.angel.rodriguez.muinos
Hola Nivaildo.

Por desgracia, tu email a los administradores de la lista, con la
solicitud de cambio de dirección de correo, no ha llegado (a qué
dirección lo has enviado?). Me alegro de que hayas podido resolverlo
dando de alta la nueva dirección (en esa misma URL puedes gestionar tus
suscripciones).

Aprovecho para recordar a la lista que la URL de solicitud de alta/baja
y/o de gestión de nuestra suscripción (cambio de email, contraseña,
formatos...) es https://stat.ethz.ch/mailman/listinfo/r-help-es

Un saludo,
Miguel.



El 21/02/2017 a las 20:44, hibiki escribió:
> Much�simas gracias Eric, lo del rebote debe ser porque en la escuela
> cambiaron el dominio y debes estar mandando el mensaje al la direcci�n
> vieja 'npolanco@*cuij*.edu.cu', como cambiaron el dominio *CUIJ* por
> *UIJ* ahora la direcci�n es 'npolanco@*uij*.edu.cu' que es como me
> registre a la lista recientemente, como no sabia cambiar el correo en el
> usuario y le envi� un mensaje con la duda al administrador de la lista
> pero nunca recib� respuesta, no me quedo de otra que volverme a
> registrar con la nueva direcci�n estando ahora las 2 activas para un
> mismo usuario o algo as�. Espero entonces a que me env�es el link para
> poder descargarlos. Yo estoy cursando una maestr�a en miner�a de datos y
> estoy muy desinformado tanto del tema como de R, pues no soy muy ...
> inteligente por decirlo de alguna manera y nunca hab�a escuchado sobre
> esto, pero he le�do muchas veces que el R es un software fenomenal y
> libre, de hecho el profesor que me imparti� el modulo de estad�stica nos
> dijo que era de los software estad�sticos el que tenia los mejores
> algoritmos y los mejores gr�ficos por lo que estoy decidido a aprender
> de �l y trabajarlo y como nuestra universidad es peque�a, reciente y con
> poca experiencia, desarrollo y un claustro muy joven asociado a otros
> problemas de recursos quiero conocer de R lo suficiente como para
> preparar a los profesores y estudiantes con lo m�nimo necesario para que
> sea el software estad�stico de nuestra carrera para la investigaci�n y
> el desarrollo.
>
>
> PD: ENVI� EL MENSAJE A TODA LA LISTA Y NO SOLO A ERIC POR SI ALG�N OTRO
> NECESITE MANDARME UN MENSAJE PRIVADO TENGA EN CUENTA LA DIRECCI�N DE
> CORREO A LA QUE ENV�A.
>
> Fraternalmente, Nivaildo.












Nota: A información contida nesta mensaxe e os seus posibles documentos 
adxuntos é privada e confidencial e está dirixida únicamente ó seu 
destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por 
favor elimínea. A distribución ou copia desta mensaxe non está autorizada.

Nota: La información contenida en este mensaje y sus posibles documentos 
adjuntos es privada y confidencial y está dirigida únicamente a su 
destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, 
por favor elimínelo. La distribución o copia de este mensaje no está autorizada.

See more languages: http://www.sergas.es/aviso-confidencialidad
___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es

[R] single strip for the same group in dotplot lattice

2017-02-22 Thread Luigi Marongiu
dear all,
I have a set of data that is subdivided in cluster (run 1/run 2) and in
target (A/B). When plotting, I obtain a panel strip with "run 1" and "run
2" for each "A" and "B" panel, so "run 1" appears twice and so does "run
2". It is possible to merge the strip together so that I will have "run 1"
or "run 2" only once? this will reduce the complexity of the data and allow
more space for more detailed information in the strip.
the data follows,
thank you
L

>>>
cluster <- c(rep("run_1", 6), rep("run_2", 6))
type <- rep(c("blank", "positive", "negative"),2)
target <- c(rep("A", 6), rep("B", 6))
value <- c(0.01, 1.1, 0.5,
   0.02, 1.6, 0.8,
   0.07, 1.4, 0.7,
   0.03, 1.4, 0.4)
my.data <- data.frame(cluster, type, target, value)

library(lattice)
dotplot(
  value ~ type|target + cluster,
  my.data,
  groups = type,
  pch=21,
  main = "Luminex analysis MTb humans",
  xlab = "Target", ylab = "Reading",
  col = c("grey", "green", "red"),
  par.settings = list(strip.background = list(col="paleturquoise")),
  scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
  key = list(
space = "top",
columns = 3,
text = list(c("Blank", "Negative", "Positive"), col="black"),
rectangles = list(col=c("grey", "green", "red"))
  )
)

[[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.