[R] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread Chris Evans
I am trying to read activity data created by Garmin. It outputs dates like this:

"Thu, 25 Aug 2016 6:34 PM"

The problem that has stumped me is this:

> strftime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")
Error in as.POSIXlt.character(x, tz = tz) : 
  character string is not in a standard unambiguous format

I _thought_ I had this running OK but that error is catching me now.  I think 
I've read ?strftime and written that format string correctly to match the input 
but I'm stumped now.

Can someone advise me?  Many thanks in advance,

Chris


> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 10586)

locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C   
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base 

loaded via a namespace (and not attached):
[1] compiler_3.3.1 tools_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.


Re: [R] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread Daniel Nordlund

On 9/11/2016 10:57 PM, Chris Evans wrote:

I am trying to read activity data created by Garmin. It outputs dates like this:

"Thu, 25 Aug 2016 6:34 PM"

The problem that has stumped me is this:


strftime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")

Error in as.POSIXlt.character(x, tz = tz) :
  character string is not in a standard unambiguous format

I _thought_ I had this running OK but that error is catching me now.  I think 
I've read ?strftime and written that format string correctly to match the input 
but I'm stumped now.

Can someone advise me?  Many thanks in advance,

Chris



sessionInfo()

R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 10586)

locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.3.1 tools_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.



I have always used strptime() for this task, and

> strptime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")
[1] "2016-08-25 18:34:00 PDT"

works for me.


Hope this is helpful,

Dan

--
Daniel Nordlund
Port Townsend, WA  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] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread peter dalgaard

> On 12 Sep 2016, at 07:57 , Chris Evans  wrote:
> 
>> strftime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")

strptime, not strftime...

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
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] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread Ismail SEZEN
It should be strptime for character vectors.

strptime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p”)

> On 12 Sep 2016, at 08:57, Chris Evans  wrote:
> 
>> strftime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")


[[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] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread peter dalgaard

On 12 Sep 2016, at 12:33 , Chris Evans  wrote:

> OK. I'm an idiot (not for the first time and, sadly, no doubt not for the 
> last). strptime() was all that was needed: just that one pesky character and 
> I can't remember now why I went astray there, but thanks to all who supplied 
> the answer and all who supplied additional useful information. 

Usually happens because you think it is p for print, so the other one must be 
f. (It's really _p_arse and _f_ormat.)

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
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] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread Jeff Newmiller
Perhaps use the correct function.  (Just one little letter off...)
-- 
Sent from my phone. Please excuse my brevity.

On September 11, 2016 10:57:39 PM PDT, Chris Evans  wrote:
>I am trying to read activity data created by Garmin. It outputs dates
>like this:
>
>"Thu, 25 Aug 2016 6:34 PM"
>
>The problem that has stumped me is this:
>
>> strftime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")
>Error in as.POSIXlt.character(x, tz = tz) : 
>  character string is not in a standard unambiguous format
>
>I _thought_ I had this running OK but that error is catching me now.  I
>think I've read ?strftime and written that format string correctly to
>match the input but I'm stumped now.
>
>Can someone advise me?  Many thanks in advance,
>
>Chris
>
>
>> sessionInfo()
>R version 3.3.1 (2016-06-21)
>Platform: x86_64-w64-mingw32/x64 (64-bit)
>Running under: Windows 10 x64 (build 10586)
>
>locale:
>[1] LC_COLLATE=English_United Kingdom.1252 
>[2] LC_CTYPE=English_United Kingdom.1252   
>[3] LC_MONETARY=English_United Kingdom.1252
>[4] LC_NUMERIC=C   
>[5] LC_TIME=English_United Kingdom.1252
>
>attached base packages:
>[1] stats graphics  grDevices utils datasets  methods   base   
> 
>
>loaded via a namespace (and not attached):
>[1] compiler_3.3.1 tools_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-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] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread jeremiah rounds
Not sure what the issue is with the provided code  but note:
library(lubridate)
 lubridate::dmy_hm("Thu, 25 Aug 2016 6:34 PM")
[1] "2016-08-25 18:34:00 UTC"


Though if you go that route: set the TZ because on the timestamp it is
ambiguous.

On Sun, Sep 11, 2016 at 10:57 PM, Chris Evans  wrote:

> I am trying to read activity data created by Garmin. It outputs dates like
> this:
>
> "Thu, 25 Aug 2016 6:34 PM"
>
> The problem that has stumped me is this:
>
> > strftime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")
> Error in as.POSIXlt.character(x, tz = tz) :
>   character string is not in a standard unambiguous format
>
> I _thought_ I had this running OK but that error is catching me now.  I
> think I've read ?strftime and written that format string correctly to match
> the input but I'm stumped now.
>
> Can someone advise me?  Many thanks in advance,
>
> Chris
>
>
> > sessionInfo()
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 10586)
>
> locale:
> [1] LC_COLLATE=English_United Kingdom.1252
> [2] LC_CTYPE=English_United Kingdom.1252
> [3] LC_MONETARY=English_United Kingdom.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United Kingdom.1252
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] compiler_3.3.1 tools_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.
>

[[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] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread Chris Evans
OK. I'm an idiot (not for the first time and, sadly, no doubt not for the 
last). strptime() was all that was needed: just that one pesky character and I 
can't remember now why I went astray there, but thanks to all who supplied the 
answer and all who supplied additional useful information. 

As ever, deeply indebted to the R and R-help communities, 

Chris 

> From: "Ismail SEZEN" 
> To: "Chris Evans" 
> Cc: "r-help" 
> Sent: Monday, 12 September, 2016 10:36:51
> Subject: Re: [R] Help with strftime error "character string is not in a 
> standard
> unambiguous format"

> It should be strptime for character vectors.

> strptime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p”)

>> On 12 Sep 2016, at 08:57, Chris Evans < chrish...@psyctc.org > wrote:

>>> strftime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")
[[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] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread Enrico Schumann
On Mon, 12 Sep 2016, Chris Evans  writes:

> I am trying to read activity data created by Garmin. It outputs dates like 
> this:
>
> "Thu, 25 Aug 2016 6:34 PM"
>
> The problem that has stumped me is this:
>
>> strftime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")
> Error in as.POSIXlt.character(x, tz = tz) : 
>   character string is not in a standard unambiguous format


Didn't you mean strptime?
   ^
  > strptime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p")

  ## [1] "2016-08-25 18:34:00 CEST"


> I _thought_ I had this running OK but that error is catching me now.
> I think I've read ?strftime and written that format string correctly
> to match the input but I'm stumped now.
>
> Can someone advise me?  Many thanks in advance,
>
> Chris
>
>
>> sessionInfo()
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 10586)
>
> locale:
> [1] LC_COLLATE=English_United Kingdom.1252 
> [2] LC_CTYPE=English_United Kingdom.1252   
> [3] LC_MONETARY=English_United Kingdom.1252
> [4] LC_NUMERIC=C   
> [5] LC_TIME=English_United Kingdom.1252
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base 
>
> loaded via a namespace (and not attached):
> [1] compiler_3.3.1 tools_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.

-- 
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net

__
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] commercial license

2016-09-12 Thread benjamin . stocker
Dear r-project Team

How does It cost a commercial license for the R Console and the R-comander GUI 
without the Rstudio enviroment.
Thanks for helping me.


Freundliche Gr�sse/Kind regards

Benjamin Stocker
Reporting/Controlling MBC
Mercedes-Benz Schweiz AG
Bernstrasse 55
8952 Schlieren/Switzerland

Phone +41 44 755 84 24
Fax +41 44 755 82 17
mailto:benjamin.stoc...@daimler.com

www.mercedes-benz.ch


If you are not the addressee, please inform us immediately that you have 
received this e-mail by mistake, and delete it. We thank you for your support.


[[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] Where are the PCA outputs?

2016-09-12 Thread Charles Determan
Hi Nick,

"prcomp" returns an object of class "prcomp" so when you simply 'print' the
object it gets passed to the "print.prcomp" function.  If you want to see
all the objects you should assign the results to an object.

Regards,
Charles

On Mon, Sep 12, 2016 at 7:56 AM, WRAY NICHOLAS 
wrote:

> Hi R Folk  I have been kicking some data around and one thing has been to
> try a
> PC analysis  on it, but whereas in the online examples I've looked at the
> prcomp
> function gives a set of five outputs when I use the prcomp function it only
> gives me a set of standard deviations and the rotation matrix
>
> My data (pcl) is this:
>
> resmat.3...2. resmat.3...3. resmat.3...4.
> 1 0.08749276   0.015706470 0.259
> 2 0.08749276   0.039266176 0.198
> 3 0.10630841   0.047119411 0.235
> 4 0.25307047   0.062825881 0.374
> 5 0.14393971   0.117798527 0.534
> 6 0.23049169   0.023559705 0.355
> 7 0.15052518   0.007853235 0.179
> 8 0.09784137   0.031412940 0.219
> 9 0.09878215   0.039266176 0.301
> 100.14111736   0.157064702 0.285
> 110.03951286   0.015706470 0.036
> 120.16181457   0.125651762 0.324
> 130.13359110   0.031412940 0.304
> 140.08278885   0.031412940 0.221
> 150.08561120   0.023559705 0.207
> 160.12042015   0.039266176 0.194
> 170.13359110   0.047119411 0.164
> 180.08937433   0.047119411 0.216
> 190.12700562   0.023559705 0.230
>
> the output is then
> > prcomp(pcl,scale.=T)
> Standard deviations:
> [1] 1.4049397 0.8447366 0.5590747
>
> Rotation:
> PC1 PC2PC3
> resmat.3...2. 0.5599782 -0.64434772 -0.5208075
> resmat.3...3. 0.5229417  0.76245515 -0.3810434
> resmat.3...4. 0.6426168 -0.05897597  0.7639146
>
> Does anyone know why the other things are not appearing?
>
> Thanks, Nick
> [[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] Where are the PCA outputs?

2016-09-12 Thread WRAY NICHOLAS
Hi R Folk  I have been kicking some data around and one thing has been to try a
PC analysis  on it, but whereas in the online examples I've looked at the prcomp
function gives a set of five outputs when I use the prcomp function it only
gives me a set of standard deviations and the rotation matrix

My data (pcl) is this:

resmat.3...2. resmat.3...3. resmat.3...4.
1 0.08749276   0.015706470 0.259
2 0.08749276   0.039266176 0.198
3 0.10630841   0.047119411 0.235
4 0.25307047   0.062825881 0.374
5 0.14393971   0.117798527 0.534
6 0.23049169   0.023559705 0.355
7 0.15052518   0.007853235 0.179
8 0.09784137   0.031412940 0.219
9 0.09878215   0.039266176 0.301
100.14111736   0.157064702 0.285
110.03951286   0.015706470 0.036
120.16181457   0.125651762 0.324
130.13359110   0.031412940 0.304
140.08278885   0.031412940 0.221
150.08561120   0.023559705 0.207
160.12042015   0.039266176 0.194
170.13359110   0.047119411 0.164
180.08937433   0.047119411 0.216
190.12700562   0.023559705 0.230

the output is then
> prcomp(pcl,scale.=T)
Standard deviations:
[1] 1.4049397 0.8447366 0.5590747

Rotation:
PC1 PC2PC3
resmat.3...2. 0.5599782 -0.64434772 -0.5208075
resmat.3...3. 0.5229417  0.76245515 -0.3810434
resmat.3...4. 0.6426168 -0.05897597  0.7639146

Does anyone know why the other things are not appearing?

Thanks, Nick
[[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] commercial license

2016-09-12 Thread Fox, John
Dear Benjamin,

Like R, the Rcmdr package is free software distributed under the GNU General 
Public License. For more information, type ?license at the R > command prompt.

I hope this helps,
 John

--
John Fox, Professor
McMaster University
Hamilton, Ontario, Canada
Web: socserv.mcmaster.ca/jfox



> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of
> benjamin.stoc...@daimler.com
> Sent: Monday, September 12, 2016 3:40 AM
> To: r-help@r-project.org
> Subject: [R] commercial license
> 
> Dear r-project Team
> 
> How does It cost a commercial license for the R Console and the R-
> comander GUI without the Rstudio enviroment.
> Thanks for helping me.
> 
> 
> Freundliche Gr�sse/Kind regards
> 
> Benjamin Stocker
> Reporting/Controlling MBC
> Mercedes-Benz Schweiz AG
> Bernstrasse 55
> 8952 Schlieren/Switzerland
> 
> Phone +41 44 755 84 24
> Fax +41 44 755 82 17
> mailto:benjamin.stoc...@daimler.com
> 
> www.mercedes-benz.ch
> 
> 
> If you are not the addressee, please inform us immediately that you have
> received this e-mail by mistake, and delete it. We thank you for your
> support.
> 
> 
>   [[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] Arules Package: Rules subset with 'empty' left hand side (lhs)

2016-09-12 Thread Tom D. Harray
Hello,

subsets of association rules (with respect to support, confidence, lift, or
items) can be obtained with the arules::subset() function; e.g.

  rm(list = ls(all.names = TRUE))
  library(arules)
  set.seed(42)

  x <- lapply(X = 1:500, FUN = function(i)
sample(x = 1:10, size = sample(1:5, 1), replace = FALSE)
  )
  x <- as(x, 'transactions')

  rules <- apriori(
data = x,
parameter = list(target = 'rules', minlen = 1, maxlen = 2,
  support = 0.10, confidence = 0.32)
  )
  rules <- arules::sort(x = rules, decreasing = TRUE, by ='support')

gives the rules
3  {}  => {1} 0.330   0.330  1.000
2  {}  => {3} 0.326   0.326  1.000
1  {}  => {2} 0.320   0.320  1.000
20 {3} => {1} 0.120   0.3680982  1.1154490
21 {1} => {3} 0.120   0.3636364  1.1154490
16 {4} => {3} 0.114   0.3677419  1.1280427
(...)

However, I cannot figure out (help/web) how to get the subset for the rules
with empty left hand side (lhs) like subset(rules, lhs == ''). I  could run the
apriori() function twice and adjust the min/maxlen parameters as a band
aid fix.


So my question is: How do I subset() association rules with empty lhs?


Thanks and regards,

Dirk

__
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] stripless package version 1.0-2 now on CRAN

2016-09-12 Thread Bert Gunter
A vignette has been added to the package. I hope that even those who don’t use 
the package will find its discussion of trellis graphics useful. Otherwise, 
this is a minor update that fixes some bugs and adds a few small features. See 
the NEWS file for details. As always, comments and suggestions welcome. 

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

Re: [R] Apply a multi-variable function to a vector

2016-09-12 Thread Stephen Kennedy
Hello Jeff,

I kept fooling with this, and also looking around the web and I actually
found something on stackoverflow, which does what I had in mind.  You
mentioned that you would rarely use someting like this, but the link is:

http://stackoverflow.com/questions/6192848/how-to-generalize-outer-to-n-dimensions

This may not be efficient, but what I like is that you can name the vectors
of variable values anything, as well as the names of the variables in the
arbitrary function.  It is not sensitive to the 'names' of anything.

Here is the code.  I used the function you defined for me, but for example
you can just pass in a vector of values (1:3, etc. below) and this produces
the output array.  I would name the vector something that means something
to me (temperature_vals = c(), etc.), and then pass that to multi.outer,
and the function will be applied (independent of what you name the
variables in the function).

Thanks again for your help.  The responses are like a tutorial for me ...

Best,

Steve



list_args <- Vectorize( function(a,b) c( as.list(a), as.list(b) ),
+ SIMPLIFY = FALSE)

 make_args_mtx <- function( alist ) {
+ Reduce(function(x, y) outer(x, y, list_args), alist)
+ }

 multi.outer <- function(f, ... ) {
+ args <- make_args_mtx(list(...))
+ apply(args, 1:length(dim(args)), function(a) do.call(f, a[[1]] ) )
+ }


multi.outer(myfunc, 1:3, 2:6, 3:4)
, , 1

 [,1] [,2] [,3] [,4] [,5]
[1,]56789
[2,]79   11   13   15
[3,]9   12   15   18   21

, , 2

 [,1] [,2] [,3] [,4] [,5]
[1,]6789   10
[2,]8   10   12   14   16
[3,]   10   13   16   19   22

On Sat, Sep 10, 2016 at 1:29 AM, Jeff Newmiller 
wrote:

> Not sure I understand what you really want, if you have found ways to
> accomplish what you want but are not satisfied with them. That is one
> reason why keeping the mailing list involved (by reply-all) is good for
> you. From my end, I don't do one-on-one support online, and may not be able
> to carry on a thread to the end if I get busy.
>
> Your concept of a generalized outer function sounds to me like:
>
> myfunc <- function( A, B, C ) {
>  A * B + C
> }
>
> gouter <- function( FUN, ... ) {
>  args <- list( ... )
>  DF <- do.call( expand.grid, args )
>  array( data = do.call( FUN, DF )
>   , dim = sapply( args, FUN=length )
>   , dimnames = args
>   )
> }
>
> gouter( myfunc, A = 1:3, B=2:6, C=3:4 )
> # , , C = 3
> #
> #B
> # A   2  3  4  5  6
> #   1 5  6  7  8  9
> #   2 7  9 11 13 15
> #   3 9 12 15 18 21
> #
> # , , C = 4
> #
> #B
> # A2  3  4  5  6
> #   1  6  7  8  9 10
> #   2  8 10 12 14 16
> #   3 10 13 16 19 22
>
> I generally just tack on columns to the expand.grid result... I almost
> never have a need for multidimensional arrays.
>
> On Fri, 9 Sep 2016, Steve Kennedy wrote:
>
> Hello,
>>
>> Abstraction is what I want.  I'm actually looking to do something more
>> complicated.  The functions do.call, and as.list get me most of the way
>> there, but there is something I'm missing ...
>>
>> My eventual goal is to produce a multi-dimensional version of 'outer'.
>> Like my.outer(func, a_vec, b_vec, c_vec, ..), where the function of the
>> variables 'a', 'b', 'c', etc. would be applied to the vectors from the
>> outer product of the vectors of values for each variable.
>>
>> I wanted to use expand.grid (does require reshaping the output).  Using
>> temps = c(40,50,60) and times = c(1:5), this doesn't quite seem to work:
>>
>>   apply(expand.grid(temps,times), 1, function(a) do.call(func2,
>> as.list(a)))
>>
>> although this does work:
>>
>>   do.call(func2, as.list(c(10, 121)))
>>
>> And, this also works:
>>
>>  apply(expand.grid(temps,times), 1, function(a) do.call("+", as.list(a)))
>>
>> There is some subtlety here I don't understand.
>>
>> Thanks,
>>
>> Steve
>>
>> -Original Message-
>> From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us]
>> Sent: Friday, September 09, 2016 5:39 PM
>> To: Steve Kennedy; r-help@r-project.org
>> Subject: Re: [R] Apply a multi-variable function to a vector
>>
>> Your architecture has a bad smell to me. For one thing you are mixing
>> different units in the same vector but should be putting multiple instances
>> of the same variable into one vector. Lists of vectors (data frames) are
>> typically used when multiple variables need to be grouped.
>>
>> Another problem is that you are constraining the names of the variables
>> you pass to the function to be named the same as they are inside the
>> function. This really limits your use of those functions.
>>
>> There really is too much abstraction going on here.
>> --
>> Sent from my phone. Please excuse my brevity.
>>
>> On September 9, 2016 12:44:52 PM PDT, Steve Kennedy
>>  wrote:
>>
>>> Hello,
>>>
>>> I would like to define an arbitrary function of an arbitrary number of
>>> variables, for example, for 2 variables:
>>>

Re: [R] using a regular expression

2016-09-12 Thread Jeff Newmiller
If you think you might want to put this function into a package, it would be 
much better to use gsub instead of passing the job off to an external program, 
because non-POSIX operating systems (Windows) will be a headache to support.
-- 
Sent from my phone. Please excuse my brevity.

On September 10, 2016 12:23:37 PM PDT, Glenn Schultz  
wrote:
>I have a file that for basically carries three datasets of differing
>lengths.  To make this a single downloadable file the creator of the
>file as used both NUL hex00 and space hex20 to normalize the lengths.
>
>Below is the function that I am writing.  I am using sed to replace the
>hex characters.  First, to get past NUL I use sed to replace hex 00
>with hex 20.  This has worked.  Once the Nul is removed and can
>successfully parse the file with ReadLine sub_str.  This final step
>before delimiting the file and making it nice and tidy is to remove the
>hex 20 characters.   I am using the same strategy to eliminate the
>spaces and sed command works in a shell but does not work in the R
>function.  What am I doing wrong?  I have dput - some of the nastier
>lines with hex 20 characters below my code.
>
>Any advice is appreciated.
>
>Glenn
>
>arm <- function(filepath){
>callpath <- paste(filepath, "arm.txt", sep ="")
>ARMReturn <- paste(filepath, "arm.csv", sep = "")
>ARMPoolReturnPath <- paste(filepath,"armatpool.csv", sep = "")
>ARMNextChgReturnPath <- paste(filepath,"nexratechangedate.csv", sep =
>"")
>ARMFirstPmtReturnPath <- paste(filepath,"firstpaymentdate.csv", sep =
>"")
>
># This file contains NUL hex characters before parsing the file replace
># the hex NUL x00 with space x20 and save as a csv file. Use system
>command
>sedcommand <- paste("sed -e 's/\\x00/\\x20/g' <", 
>filepath, "arm.txt", 
>">", "arm.csv", sep = " ")
>system(sedcommand)
>
># read the arm quartile data to a file once skipNuls then length of
>each
># record set changes and the data map provided by FNMA is no longer
>valid
># with respect to the length of each embedded data set
>data <- readLines(ARMReturn, encoding = "ascii")
>
>quartile <- NULL
>numchar <- nchar(x = data, type = "chars")
>start <- c(seq(1, numchar, 399))
>end <- c(seq(399, numchar, 399))
>quartile <- str_sub(data, start[1:length(start)], end[1:length(end)])
>write(quartile, ARMReturn)
>
># The file has been parsed accroding to length 400 for each data
>element.
># The next step is to remove all the trailing white space hex character
># x20
>
>sedcommand2 <- paste("sed -e '/\\x20/d' <", 
>filepath, "arm.csv", 
>">", "arm2.csv", sep = "")
>system(sedcommand2)
>} # end of function
>
>
>c(" 56
>WS320021201006125{000378{000348{   
>", 
>"  56
>WS320021201006250{000954{000880{   
>", 
>"   56
>WS320021201005625{001062{000983{   
>", 
>"56
>WS320030101005250{27{25{   
>", 
>" 56
>WS320030101006500{33{30{   
>", 
>"  56
>WS320030101005125{61{56{   
>", 
>"   56
>WS320030101005375{95{88{   
>", 
>"56
>WS320030101005350{000217{000200{   
>", 
>" 56
>WS320030101006125{000400{000369{   
>", 
>"  56
>WS320030101005310{000439{000406{   
>", 
>"   56
>WS320030101006000{000573{000529{   
>  "
>
>
>
>
>__

Re: [R] Hausman Test

2016-09-12 Thread Ding, Jie Ding (NIH/NIA/ERP) [F]
Dear Achim,

Sorry to have disturbed you. I have encountered a problem  when computing 
Hausman test statistics (i.e. p values)  in R to compare OLS and 2SLS models.

The problem is a discrepancy between the two p-value outputs from the "manual 
approach (by hand)" and the " diagnostics argument" in the "AER" library, 
respectively.

With respect to manual approach, I used the following codes:

cf_diff<-coef(ivreg)-coef(olsreg)
vc_diff<-vcov(ivreg)-vcov(olsreg)
x2_diff<-as.vector(t(cf_diff)%*% solve(vc_diff)%*%cf_diff)
pchisq(x2_diff,df=2,lower.tail=FALSE)


For diagnostic approach, I applied the following:

summary(ivreg, vcov = sandwich, df = Inf, diagnostics = TRUE)


However, p-value from the manual approach is always much larger than the 
diagnostic approach, e.g.  0.329 vs. 0.138

I would expect the values should be the same. Your advice would be highly 
appreciated.

With very best wishes,
Jennifer



[[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] How to read a grib2 file

2016-09-12 Thread Debasish Pai Mazumder
Thanks for your suggestion. I have checked and I don't have JPEG2000 in
ggdalDrivers()). I am pretty new in R. I don't understand how to do I
implement JPEG2000 (JP2OpenJPEG driver) in gdalDrivers() so that I can read
grib2 files

with regards
-Deb

On Sat, Sep 10, 2016 at 2:33 AM, Michael Sumner  wrote:

>
>
> On Sat, 10 Sep 2016 at 07:12 Debasish Pai Mazumder 
> wrote:
>
>> Hi
>> I am trying to read a grib2 file in R.
>>
>> Here is my script
>>
>> library(rgdal)
>> library(sp)
>> library(rNOMADS)
>> gribfile<-"tmax.01.2011040100.daily.grb2"
>> grib <- readGDAL(gribfile)
>>
>> I am getting following error :
>>
>> dec_jpeg2000: Unable to open JPEG2000 image within GRIB file.
>> Is the JPEG2000 driver available?tmax.01.2011040100.daily.grb2 has GDAL
>> driver GRIB
>> and has 190 rows and 384 columns
>> dec_jpeg2000: Unable to open JPEG2000 image within GRIB file.
>> Is the JPEG2000 driver available?dec_jpeg2000: Unable to open JPEG2000
>> image within GRIB file.
>>
>>
> Hi there, please check if JPEG2000 is in the gdalDrivers() list, i.e.  in
>
> rgdal::gdalDrivers()$name
>
> You are looking for one starting with "JP2" as per the list next to the
> "JPEG2000" rows here:
>
> http://gdal.org/formats_list.html
>
> I have  JP2OpenJPEG on one system, but not (for example) on the Windows
> CRAN binary for rgdal, which is the only readily available Windows build
> for this package.
>
> I you don't have it, you might try on a system that has the JP2OpenJPEG 
> driver,
> or ask someone to try on your behalf. You'd want to find out if that will
> enable this read for you before investing time in the Linux configuration.
>
> It's not too hard to set up a Linux system for this, but does assume a bit
> of experience on your part. Some of the docker images in the rockerverse
> have this all sorted I believe, but it's been a while since I used them.
>
> https://hub.docker.com/u/rocker/
>
> Cheers, Mike.
>
>
>
>
>> Cheers
>> -Deb
>>
>> [[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.
>>
> --
> Dr. Michael Sumner
> Software and Database Engineer
> Australian Antarctic Division
> 203 Channel Highway
> Kingston Tasmania 7050 Australia
>
>

[[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] Fitting Mixture distributions

2016-09-12 Thread Aanchal Sharma
Thanks for the reply.

I have another related issue with Gamma mixture model. here is the
description:

I am trying to fit a 2 component gamma mixture model to my data (residual
values obtained after running Generalized Linear Model), using following
command (part of the code):

 expr_mix_gamma <- gammamixEM(expr_glm_residuals, lambda = c(0.75,0.25), k
= 2, epsilon = 1e-08, maxit = 1000, maxrestarts=20, verb = TRUE)

The code runs for multiple gene files (in loop). it runs fine for some
files whereas for others it throws following error:

Error in gammamixEM(expr_glm_residuals, lambda = c(0.75, 0.25), k = 2,
 : Try different number of components?

I tried increasing iterations and decreasing the convergence value, but
that doesn't seem to work. Is there anything else that I can try?
Thanks


On Thu, Sep 8, 2016 at 8:38 AM, Martin Maechler 
wrote:

> > Bert Gunter 
> > on Wed, 7 Sep 2016 23:47:40 -0700 writes:
>
> > "please suggest what can I do to resolve this
> > issue."
>
> > Fitting normal mixtures can be difficult, and sometime the
> > optimization algorithm (EM) will get stuck with very slow
> convergence.
> > Presumably there are options in the package to either increase the
> max
> > number of steps before giving up or make the convergence criteria
> less
> > sensitive. The former will increase the run time and the latter will
> > reduce the optimality (possibly leaving you farther from the true
> > optimum). So you should look into changing these as you think
> > appropriate.
>
> I'm jumping in late, without having read everything preceding.
>
> One of the last messages seemed to indicate that you are looking
> at mixtures of *one*-dimensional gaussians.
>
> If this is the case, I strongly recommend looking at (my) CRAN
> package 'nor1mix' (the "1" is for "*one*-dimensional).
>
> For a while now that small package is providing an alternative
> to the EM, namely direct MLE, simply using optim() where the
> likelihood uses a somewhat smart parametrization.
>
> Of course, *as the EM*, this also depends on the starting value,
> but my (limited) experience has been that
>   nor1mix::norMixMLE()
> works considerably faster and more reliable than the EM (which I
> also provide asnor1mix::norMixEM() .
>
> Apropos 'starting value': The help page shows how to use
> kmeans() for "somewhat" reliable starts; alternatively, I'd
> recommend using cluster::pam() to get a start there.
>
> I'm glad to hear about experiences using these / comparing
> these with other approaches.
>
> Martin
>
>
> --
> Martin Maechler,
> ETH Zurich
>
>
> > On Wed, Sep 7, 2016 at 3:51 PM, Aanchal Sharma
> >  wrote:
> >> Hi Simon
> >>
> >> I am facing same problem as described above. i am trying to fit
> gaussian
> >> mixture model to my data using normalmixEM. I am running a Rscript
> which
> >> has this function running as part of it for about 17000 datasets
> (in loop).
> >> The script runs fine for some datasets, but it terminates when it
> >> encounters one dataset with the following error:
> >>
> >> Error in normalmixEM(expr_glm_residuals, lambda = c(0.75, 0.25), k
> = 2,  :
> >> Too many tries!
> >>
> >> (command used: expr_mix_gau <- normalmixEM(expr_glm_residuals,
> lambda =
> >> c(0.75,0.25), k = 2, epsilon = 1e-08, maxit = 1,
> maxrestarts=200, verb
> >> = TRUE))
> >> (expr_glm_residuals is my dataset which has residual values for
> different
> >> samples)
> >>
> >> It is suggested that one should define the mu and sigma in the
> command by
> >> looking at your dataset. But in my case there are many datasets and
> it will
> >> keep on changing every time. please suggest what can I do to
> resolve this
> >> issue.
> >>
> >> Regards
> >> Anchal
> >>
> >> On Tuesday, 16 July 2013 17:53:09 UTC-4, Simon Zehnder wrote:
> >>>
> >>> Hi Tjun Kiat Teo,
> >>>
> >>> you try to fit a Normal mixture to some data. The Normal mixture
> is very
> >>> delicate when it comes to parameter search: If the variance gets
> closer and
> >>> closer to zero, the log Likelihood becomes larger and larger for
> any values
> >>> of the remaining parameters. Furthermore for the EM algorithm it
> is known,
> >>> that it takes sometimes very long until convergence is reached.
> >>>
> >>> Try the following:
> >>>
> >>> Use as starting values for the component parameters:
> >>>
> >>> start.par <- mean(your.data, na.rm = TRUE) + sd(your.data, na.rm =
> TRUE) *
> >>> runif(K)
> >>>
> >>> For the weights just use either 1/K or the R cluster function with
> K
> >>> clusters
> >>>
> >>> Here K is the number of components. Further enlarge the maximum
> number of
> >>> iterations. What you could also try is to randomize start
> 

Re: [R] Fitting Mixture distributions

2016-09-12 Thread Bert Gunter
Do you mean "increase the convergence value." Decreasing it should
make it harder to converge (I believe, depending on exactly how
"convergence vaue" is defined,  so doublecheck.)

-- 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 Mon, Sep 12, 2016 at 4:40 PM, Aanchal Sharma
 wrote:
> Thanks for the reply.
>
> I have another related issue with Gamma mixture model. here is the
> description:
>
> I am trying to fit a 2 component gamma mixture model to my data (residual
> values obtained after running Generalized Linear Model), using following
> command (part of the code):
>
>  expr_mix_gamma <- gammamixEM(expr_glm_residuals, lambda = c(0.75,0.25), k =
> 2, epsilon = 1e-08, maxit = 1000, maxrestarts=20, verb = TRUE)
>
> The code runs for multiple gene files (in loop). it runs fine for some files
> whereas for others it throws following error:
>
> Error in gammamixEM(expr_glm_residuals, lambda = c(0.75, 0.25), k = 2,
> : Try different number of components?
>
> I tried increasing iterations and decreasing the convergence value, but that
> doesn't seem to work. Is there anything else that I can try?
> Thanks
>
>
> On Thu, Sep 8, 2016 at 8:38 AM, Martin Maechler 
> wrote:
>>
>> > Bert Gunter 
>> > on Wed, 7 Sep 2016 23:47:40 -0700 writes:
>>
>> > "please suggest what can I do to resolve this
>> > issue."
>>
>> > Fitting normal mixtures can be difficult, and sometime the
>> > optimization algorithm (EM) will get stuck with very slow
>> convergence.
>> > Presumably there are options in the package to either increase the
>> max
>> > number of steps before giving up or make the convergence criteria
>> less
>> > sensitive. The former will increase the run time and the latter will
>> > reduce the optimality (possibly leaving you farther from the true
>> > optimum). So you should look into changing these as you think
>> > appropriate.
>>
>> I'm jumping in late, without having read everything preceding.
>>
>> One of the last messages seemed to indicate that you are looking
>> at mixtures of *one*-dimensional gaussians.
>>
>> If this is the case, I strongly recommend looking at (my) CRAN
>> package 'nor1mix' (the "1" is for "*one*-dimensional).
>>
>> For a while now that small package is providing an alternative
>> to the EM, namely direct MLE, simply using optim() where the
>> likelihood uses a somewhat smart parametrization.
>>
>> Of course, *as the EM*, this also depends on the starting value,
>> but my (limited) experience has been that
>>   nor1mix::norMixMLE()
>> works considerably faster and more reliable than the EM (which I
>> also provide asnor1mix::norMixEM() .
>>
>> Apropos 'starting value': The help page shows how to use
>> kmeans() for "somewhat" reliable starts; alternatively, I'd
>> recommend using cluster::pam() to get a start there.
>>
>> I'm glad to hear about experiences using these / comparing
>> these with other approaches.
>>
>> Martin
>>
>>
>> --
>> Martin Maechler,
>> ETH Zurich
>>
>>
>> > On Wed, Sep 7, 2016 at 3:51 PM, Aanchal Sharma
>> >  wrote:
>> >> Hi Simon
>> >>
>> >> I am facing same problem as described above. i am trying to fit
>> gaussian
>> >> mixture model to my data using normalmixEM. I am running a Rscript
>> which
>> >> has this function running as part of it for about 17000 datasets
>> (in loop).
>> >> The script runs fine for some datasets, but it terminates when it
>> >> encounters one dataset with the following error:
>> >>
>> >> Error in normalmixEM(expr_glm_residuals, lambda = c(0.75, 0.25), k
>> = 2,  :
>> >> Too many tries!
>> >>
>> >> (command used: expr_mix_gau <- normalmixEM(expr_glm_residuals,
>> lambda =
>> >> c(0.75,0.25), k = 2, epsilon = 1e-08, maxit = 1,
>> maxrestarts=200, verb
>> >> = TRUE))
>> >> (expr_glm_residuals is my dataset which has residual values for
>> different
>> >> samples)
>> >>
>> >> It is suggested that one should define the mu and sigma in the
>> command by
>> >> looking at your dataset. But in my case there are many datasets and
>> it will
>> >> keep on changing every time. please suggest what can I do to
>> resolve this
>> >> issue.
>> >>
>> >> Regards
>> >> Anchal
>> >>
>> >> On Tuesday, 16 July 2013 17:53:09 UTC-4, Simon Zehnder wrote:
>> >>>
>> >>> Hi Tjun Kiat Teo,
>> >>>
>> >>> you try to fit a Normal mixture to some data. The Normal mixture
>> is very
>> >>> delicate when it comes to parameter search: If the variance gets
>> closer and
>> >>> closer to zero, the log Likelihood becomes larger and larger for
>> any values
>> >>> of the remaining parameters. Furthermore for the EM algorithm 

[R] (no subject)

2016-09-12 Thread Stefano Sofia
Thank you to Sarah Goslee and Ivan Calandra for their exhaustive explanations.

About Ivan Calandra's suggestion to put data in the right format adding a 
column "station" with values being
either RM or RT, I would ask Ivan if he means to divide the initial data frame 
into two data frames, one for RM and one for RT.
If this is the case, then I would find a way to link the two data frames, and 
this might not be the most efficient solution. But likely I miss the true 
meaning of the comment.

Thank you
Stefano


>
> Message: 14
> Date: Wed, 7 Sep 2016 16:56:20 +0200
> From: Ivan Calandra 
> To: r-help@r-project.org
> Subject: Re: [R] how to manage missing values correctly when importing
> a data frame
> Message-ID: <388bc333-497c-f806-e367-8aecb0a7d...@univ-reims.fr>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hi Stefano,
>
> I agree that this behavior of R can be somewhat counter-intuitive, but
> this can be seen as a safety procedure, so that no assumptions are made
> and problems can be easily identified.
>
> I would think that in this case, the input data is in the wrong format.
> Half the columns are for RM and the other for RT, but the headers are
> exactly the same. The problem then happens because you actually have
> only 3 lines of data for station RT but 4 for station RM. So it is
> filled with NA.
>
> IMHO, it would be better to add a column "station" with values being
> either RM or RT. In that case, you would not have whole NA lines. And
> you would have less columns to work with. See what I mean?
>
> By the way, I like the matrix method for subsetting a data.frame, I find
> it easier and more flexible (maybe someone will tell if there are any
> drawbacks):
> Storia_RM_RT[Storia_RM_RT$Station_RT==112, "Test_20151231"]
>
> HTH,
> Ivan
>
> --
> Ivan Calandra, PhD
> Scientific Mediator
> University of Reims Champagne-Ardenne
> GEGENAA - EA 3795
> CREA - 2 esplanade Roland Garros
> 51100 Reims, France
> +33(0)3 26 77 36 89
> ivan.calan...@univ-reims.fr
>
> 

> Original Message:
>
> Dear R users,
> I have a data frame with 22 columns, called Storia_RM_RT. Here the first 4 
> rows:
>
> Station_RM Sensor_RM Place_RM Y_init_RM M_init_RM D_init_RM Long_cent_RM 
> Lat_cent_RM Height_RM Continues Station_RT Sensor_RT Place_RT Name1_RT 
> Name2_RT Long_cent_RT Lat_cent_RT Height_RT Actual_net Notes
> Test_20141231 Test_20151231
> 1400 2701 Novafeltria 1959 1 1 12.289552 43.890057 293 NO NA NA NA NA NA NA 
> NA NA CAE NA NO NO
> 1460 2702 Carpegna 1963 1 1 12.332614 43.778107 748 SI 702 2954 Carpegna 
> Carpegna Carpegna 12.340618 43.780575 715 RT NA NO NO
> 1500 2703 Pesaro 1957 1 1 12.909822 43.910889 11 SI 112 1229 Pesaro 
> Villa_Fastiggi Villa_Fastiggi 12.86939 43.890610 22 RT NA YES YES
> 1520 2704 Fano 1957 1 1 13.017591 43.840054 4 SI 152 2671 Fano Foce_Metauro 
> Metaurilia 13.053796 43.826328 7.12 RT NA YES YES
>
> I load it with
> Storia_RM_RT <- read.table(file="Storia_RM_RT.txt", header = TRUE, sep=" ", 
> dec = ".", stringsAsFactors = FALSE)
>
> print(Storia_RM_RT$Test_20151231[Storia_RM_RT$Station_RM == 1500]) gives
> [1] "YES"
>
> while
> print(Storia_RM_RT$Omogenea_20151231[Storia_RM_RT$Station_RT == 112]) gives
> [1] NA   "YES"
>
>
> I am struggling to understand why the query through the field Station_RT does 
> not work.
> Could please somebody help me to manage correctly the missing values? Is the 
> mistake somewhere else?
>
> Thank you
> Stefano Sofia




AVVISO IMPORTANTE: Questo messaggio di posta elettronica può contenere 
informazioni confidenziali, pertanto è destinato solo a persone autorizzate 
alla ricezione. I messaggi di posta elettronica per i client di Regione Marche 
possono contenere informazioni confidenziali e con privilegi legali. Se non si 
è il destinatario specificato, non leggere, copiare, inoltrare o archiviare 
questo messaggio. Se si è ricevuto questo messaggio per errore, inoltrarlo al 
mittente ed eliminarlo completamente dal sistema del proprio computer. Ai sensi 
dell’art. 6 della DGR n. 1394/2008 si segnala che, in caso di necessità ed 
urgenza, la risposta al presente messaggio di posta elettronica può essere 
visionata da persone estranee al destinatario.
IMPORTANT NOTICE: This e-mail message is intended to be received only by 
persons entitled to receive the confidential information it may contain. E-mail 
messages to clients of Regione Marche may contain information that is 
confidential and legally privileged. Please do not read, copy, forward, or 
store this message unless you are an intended recipient of it. If you have 
received this message in error, please forward it to the sender and delete it 
completely from your computer system.

[[alternative HTML version deleted]]


Re: [R] Where are the PCA outputs?

2016-09-12 Thread David L Carlson
At the risk of being redundant, the command prcomp(pcl, scale.=T) is the same 
as the command print(prcomp(pcl, scale.=T)). This passes the results of 
prcomp() to print() which prints some of them (whatever the function 
print.prcomp() is programmed to display) and then throws them away. To save the 
results, you need to assign them to an object, e.g.

> pcl.pca <- prcomp(pcl, scale.=T)

Or any other name you choose. Now pcl.pca is a list of 5 elements:

> str(pcl.pca)
List of 5
 $ sdev: num [1:3] 1.405 0.845 0.559
 $ rotation: num [1:3, 1:3] 0.56 0.523 0.643 -0.644 0.762 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : chr [1:3] "resmat.3...2." "resmat.3...3." "resmat.3...4."
  .. ..$ : chr [1:3] "PC1" "PC2" "PC3"
 $ center  : Named num [1:3] 0.1248 0.0488 0.2545
  ..- attr(*, "names")= chr [1:3] "resmat.3...2." "resmat.3...3." 
"resmat.3...4."
 $ scale   : Named num [1:3] 0.051 0.0405 0.1023
  ..- attr(*, "names")= chr [1:3] "resmat.3...2." "resmat.3...3." 
"resmat.3...4."
 $ x   : num [1:19, 1:3] -0.808 -0.887 -0.346 2.341 2.857 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : chr [1:19] "1" "2" "3" "4" ...
  .. ..$ : chr [1:3] "PC1" "PC2" "PC3"
 - attr(*, "class")= chr "prcomp"

To plot the principal component scores, try

> plot(pcl.pca$x[, 1:2])

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

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Charles Determan
Sent: Monday, September 12, 2016 8:01 AM
To: WRAY NICHOLAS
Cc: r-help
Subject: Re: [R] Where are the PCA outputs?

Hi Nick,

"prcomp" returns an object of class "prcomp" so when you simply 'print' the
object it gets passed to the "print.prcomp" function.  If you want to see
all the objects you should assign the results to an object.

Regards,
Charles

On Mon, Sep 12, 2016 at 7:56 AM, WRAY NICHOLAS 
wrote:

> Hi R Folk  I have been kicking some data around and one thing has been to
> try a
> PC analysis  on it, but whereas in the online examples I've looked at the
> prcomp
> function gives a set of five outputs when I use the prcomp function it only
> gives me a set of standard deviations and the rotation matrix
>
> My data (pcl) is this:
>
> resmat.3...2. resmat.3...3. resmat.3...4.
> 1 0.08749276   0.015706470 0.259
> 2 0.08749276   0.039266176 0.198
> 3 0.10630841   0.047119411 0.235
> 4 0.25307047   0.062825881 0.374
> 5 0.14393971   0.117798527 0.534
> 6 0.23049169   0.023559705 0.355
> 7 0.15052518   0.007853235 0.179
> 8 0.09784137   0.031412940 0.219
> 9 0.09878215   0.039266176 0.301
> 100.14111736   0.157064702 0.285
> 110.03951286   0.015706470 0.036
> 120.16181457   0.125651762 0.324
> 130.13359110   0.031412940 0.304
> 140.08278885   0.031412940 0.221
> 150.08561120   0.023559705 0.207
> 160.12042015   0.039266176 0.194
> 170.13359110   0.047119411 0.164
> 180.08937433   0.047119411 0.216
> 190.12700562   0.023559705 0.230
>
> the output is then
> > prcomp(pcl,scale.=T)
> Standard deviations:
> [1] 1.4049397 0.8447366 0.5590747
>
> Rotation:
> PC1 PC2PC3
> resmat.3...2. 0.5599782 -0.64434772 -0.5208075
> resmat.3...3. 0.5229417  0.76245515 -0.3810434
> resmat.3...4. 0.6426168 -0.05897597  0.7639146
>
> Does anyone know why the other things are not appearing?
>
> Thanks, Nick
> [[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-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] (d,p,r,q) for all distributions, but no m?

2016-09-12 Thread Bert Gunter
No you may not.

I suggest that you *first search before posting* -- e.g. on "R package
moments of distributions" -- where you would find the package
"moments" that apparently already does exactly what you suggest (there
are some other packages as well). You could also first search the CRAN
task views site to find this:

https://cran.r-project.org/web/views/Distributions.html

R is a mature software environment with something like 8000 packages.
It is highly unlikely that you (or I !) would think of some simple
statistical functionality that is not already available.



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 Mon, Sep 12, 2016 at 7:32 AM, ALBERTO VIEIRA FERREIRA MONTEIRO
 wrote:
> Today I need to compute the means for some distributions... and there's no 
> easy way to do it!
>
> I mean (no pun intended), there is (d,p,r,q) for all distributions (like: 
> dgamma, pgamma, rgamma, qgamma; dchisq, pchisq, rchisq, dchisp; etc), but 
> there is no "m"-functions, like a mgamma to get the mean (or any momentum) of 
> gamma, a mchisq, a mnorm, etc.
>
> May I suggest adding these functions?
>
> Alberto Monteiro
>
> __
> 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] commercial license

2016-09-12 Thread Thierry Onkelinx
Dear Benjamin,

Have a look at FAQ 2.11:
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Can-I-use-R-for-commercial-purposes_003f

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2016-09-12 9:39 GMT+02:00 :

> Dear r-project Team
>
> How does It cost a commercial license for the R Console and the R-comander
> GUI without the Rstudio enviroment.
> Thanks for helping me.
>
>
> Freundliche Grüsse/Kind regards
>
> Benjamin Stocker
> Reporting/Controlling MBC
> Mercedes-Benz Schweiz AG
> Bernstrasse 55
> 8952 Schlieren/Switzerland
>
> Phone +41 44 755 84 24
> Fax +41 44 755 82 17
> mailto:benjamin.stoc...@daimler.com
>
> www.mercedes-benz.ch
>
>
> If you are not the addressee, please inform us immediately that you have
> received this e-mail by mistake, and delete it. We thank you for your
> support.
>
>
> [[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] commercial license

2016-09-12 Thread Barry Rowlingson
Why do you want a commercial license? The software is free of charge
and free to use anywhere.

If you want support of some kind, then you need to spell this out -
there are companies and consultants who will support your R work for a
price.


On Mon, Sep 12, 2016 at 8:39 AM, benjamin.stoc...@daimler.com
 wrote:
> Dear r-project Team
>
> How does It cost a commercial license for the R Console and the R-comander 
> GUI without the Rstudio enviroment.
> Thanks for helping me.
>
>
> Freundliche Gr�sse/Kind regards
>
> Benjamin Stocker
> Reporting/Controlling MBC
> Mercedes-Benz Schweiz AG
> Bernstrasse 55
> 8952 Schlieren/Switzerland
>
> Phone +41 44 755 84 24
> Fax +41 44 755 82 17
> mailto:benjamin.stoc...@daimler.com
>
> www.mercedes-benz.ch
>
>
> If you are not the addressee, please inform us immediately that you have 
> received this e-mail by mistake, and delete it. We thank you for your support.
>
>
> [[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] (d,p,r,q) for all distributions, but no m?

2016-09-12 Thread ALBERTO VIEIRA FERREIRA MONTEIRO
Today I need to compute the means for some distributions... and there's no easy 
way to do it!

I mean (no pun intended), there is (d,p,r,q) for all distributions (like: 
dgamma, pgamma, rgamma, qgamma; dchisq, pchisq, rchisq, dchisp; etc), but there 
is no "m"-functions, like a mgamma to get the mean (or any momentum) of gamma, 
a mchisq, a mnorm, etc.

May I suggest adding these functions?

Alberto Monteiro

__
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] de pdf a csv

2016-09-12 Thread Carlos Ortega
Hola,

Otra opción comentada "offline" ha sido la de:

https://cloud.r-project.org/web/packages/pdftables/index.html

Que permite conectar "R" con el servicio online que ofrece
https://pdftables.com.

Saludos,
Carlos Ortega
www.qualityexcellence.es

El 12 de septiembre de 2016, 14:12, Isidro Hidalgo Arellano <
ihida...@jccm.es> escribió:

> A ver… yo he utilizado el paquete "tm", concretamente la función "readPDF".
>
> No es tarea fácil, y no por el paquete que vayas a utilizar, sino por la
> propia codificación interna de un documento "PDF": te bailarán columnas y
> filas en las tablas, así que hay que tener mucha paciencia y contemplar
> todos los casos.
>
> A riesgo de meterme dónde no me llaman, revisa muy bien los datos cargados
> desde un "PDF" antes de hacer nada con ellos…
>
> Paciencia… ¡y suerte!
>
>
>
>
>
> Isidro Hidalgo Arellano
>
> Observatorio del Mercado de Trabajo
>
> Consejería de Economía, Empresas y Empleo
>
>   http://www.castillalamancha.es/
>
>
>
>
>
>
>
> De: R-help-es [mailto:r-help-es-boun...@r-project.org] En nombre de Dr.
> José
> A. Betancourt Bethencourt
> Enviado el: domingo, 11 de septiembre de 2016 0:31
> Para: r-help-es@r-project.org
> Asunto: [R-es] de pdf a csv
>
>
>
> Estimados
>
>
>
> En ocasionas hay informaciones epidemiológicas en reportes pdf semanales
> como el que adjunto que quisiéramos llevar a csv o txt  USANDO R para poder
> analizarlas estadísticamente. Apreciaríamos su ayuda si nos diesen un
> script, el paquete pdftable no me resultó.
>
> Saludos
>
> José
>
>
> [[alternative HTML version deleted]]
>
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>



-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es

[[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-es] de pdf a csv

2016-09-12 Thread Francisco Rodriguez Sanchez

Buenos días,

Otra opción es el paquete tabulizer: 
https://github.com/ropenscilabs/tabulizer


¡Suerte!

Paco


El 11/09/2016 a las 11:05, Carlos Ortega escribió:

Hola,

¿Has probado esto?

https://cloud.r-project.org/web/packages/pdftools/index.html

pdftools: Extract Text and Data from PDF Documents

Utilities based on libpoppler for extracting text, fonts, attachments and
metadata from a pdf file. Also implements rendering of PDF to bitmaps on
supported platforms.

Saludos,
Carlos Ortega
www.qualityexcellence.es

El 11 de septiembre de 2016, 0:30, Dr. José A. Betancourt Bethencourt <
josebetancourt@infomed.sld.cu> escribió:


Estimados



En ocasionas hay informaciones epidemiológicas en reportes pdf semanales
  como el que adjunto que quisiéramos llevar a csv o txt  USANDO R para
poder analizarlas estadísticamente. Apreciaríamos su ayuda si nos diesen un
script, el paquete pdftable no me resultó.

Saludos

José

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






--
Dr Francisco Rodriguez-Sanchez
Integrative Ecology Group
Estacion Biologica de Doñana - CSIC
Avda. Americo Vespucio s/n
41092 Sevilla (Spain)
http://bit.ly/frod_san

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


Re: [R-es] calculo de datos de temperatura, openair u otra alternativa

2016-09-12 Thread Javier Valdes Cantallopts (DGA)
Hola Carlos;
Al instalar el paquete DATA.TABLE me sale el siguiente error …
> install.packages("data.table")
also installing the dependency ‘chron’

Packages which are only available in source form, and may need compilation of 
C/C++/Fortran:
  ‘chron’ ‘data.table’
  These will not be installed

Saludos.

De: javier valdes [mailto:jcantallo...@gmx.com]
Enviado el: jueves, 08 de septiembre de 2016 15:10
Para: miguel.angel.rodriguez.mui...@sergas.es
CC: Javier Valdes Cantallopts (DGA); c...@qualityexcellence.es; 
r-help-es@r-project.org
Asunto: Re: [R-es] calculo de datos de temperatura,openair u otra alternativa

Agradecido por ayudar a encontrar el problema de uqe se quedara pegado R. Hasta 
el momento no he tenido las dificultades, el cambio de memorias fisicas ayudó.
Estimados les dejo plantedo una inquietud.
necesito calcular lo siguiente;
- TEmperatura media diaria, considerando 3 formas:

- Valor de la temperatura a;( 
(02:00-08:00-14:00-20:00)+(min_diaria)+(max_diaria))/6

-(min_diaria)+(max_diaria)/2.(MEDIA)

-TODOS LOS VALORES REGISTRADOS EN EL DIA/ Nº DE VALORES.

La idea es plotear las 3 formas de medias diarias, y comparar las curvas para 
anlizar la que mejor se ajusta.
He intentado con openair, pero me da la impresion que esto es un poco mas 
complejo.
PIdo ayuda para pensar en la mejor alternativa a aplicar.
Agradecido de antemano.
Mis datos estan ordenados de la siguiente forma;

fecha hora   dato
2014-01-01   00:001
2014-01-01   00:102
Son 86000 datos. Los datos estan tomados cada 10 minutos, es decir, 6 datos 
diarios.
SAludos a todos

Sent: Tuesday, September 06, 2016 at 6:11 AM
From: 
miguel.angel.rodriguez.mui...@sergas.es
To: javier.val...@mop.gov.cl, 
c...@qualityexcellence.es
Cc: r-help-es@r-project.org
Subject: Re: [R-es] R SE QUEDA PEGADO e imposibilitado de trabajar.
Hola Javier.

Por lo que comentas (que como bien dice Carlos Ortega, es una
información incompleta) parece que el detonante del error es que la
máquina entre en suspensión/economode.

Varias preguntas

- Es un portátil? un sobremesa?

- Has probado si te pasa eso (en esas condiciones) con otro software que
tenga algún tipo de "trabajo" gráfico?

- Si es un equipo nuevo por qué tiene Windows 7 ¿?¿? Estamos
hablando de trabajo en un entorno corporativo? Tienes algún tipo de
restricción en tu usuario?

Así, sin tener más info, yo te recomendaría revisar qué es lo que hace
tu equipo cuando entra en modo de ahorro de energía (pone sólo la
pantalla en standby? apaga discos? gráfica? ...) .. de hecho, podrías
configurarlo para que estuviera siempre activo y probar un tiempo así
(para intentar determinar las condiciones en las que te pasa).


Un saludo,
Miguel.



El 05/09/2016 a las 22:51, Javier Valdes Cantallopts (DGA) escribió:
> Hola Carlos:
> -Mira, mi máquina es nueva, con 16 giga de memoria Ram, así que no creo que 
> sea problema de recursos
> -En general me pasa esto cuando despliego un Plot. (Después que me paro y 
> vuelvo a mi escritorio, pasado 15 min) el plot se deforma en la pantalla y 
> después al eliminarlo se queda pegado.
> -Me pasa sobre Rstudio.
> -Windows 7 PROF.
>
>
> El 5 de septiembre de 2016, 22:10, Javier Valdes Cantallopts (DGA) 
> >>
>  escribió:
> Estimados:
> Tengo problemas con mi programa R. Cada vez que dejo stand-by mi compu por 
> unos minutos, R se queda pegado, e imposibilitado de trabajar, lo que me 
> obliga a cerrarlo y volver a abrirlo cada vez que sucede.
>







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



CONFIDENCIALIDAD: La información contenida en este mensaje y/o en los archivos 
adjuntos es de carácter confidencial o privilegiada y está destinada al uso 
exclusivo del emisor y/o de la persona o entidad a quien va dirigida. Si usted 
no es el destinatario, cualquier almacenamiento, divulgación, distribución o 
copia de 

Re: [R-es] calculo de datos de temperatura, openair u otra alternativa

2016-09-12 Thread Carlos Ortega
Hola,

Como estás en Windows, tienes que instalarte unas utilidades que se llaman
"Rtools" y que están en CRAN aquí:

https://cran.r-project.org/bin/windows/Rtools/

Después de instalar esto de RTools, prueba a instalar de nuevo "data.table".
De todas formas, incluso antes de instalar esto de "RTools", prueba a
instalar nuevamente data.table y si te pregunta instalarlo desde las
fuentes (source) di que no que te instale los binarios...

Saludos,
Carlos.

El 12 de septiembre de 2016, 19:13, Javier Valdes Cantallopts (DGA) <
javier.val...@mop.gov.cl> escribió:

> Hola Carlos;
>
> Al instalar el paquete DATA.TABLE me sale el siguiente error …
>
> > install.packages("data.table")
>
> also installing the dependency ‘chron’
>
>
>
> Packages which are only available in source form, and may need compilation
> of C/C++/Fortran:
>
>   ‘chron’ ‘data.table’
>
>   These will not be installed
>
>
>
> Saludos.
>
>
>
> *De:* javier valdes [mailto:jcantallo...@gmx.com]
> *Enviado el:* jueves, 08 de septiembre de 2016 15:10
> *Para:* miguel.angel.rodriguez.mui...@sergas.es
> *CC:* Javier Valdes Cantallopts (DGA); c...@qualityexcellence.es;
> r-help-es@r-project.org
> *Asunto:* Re: [R-es] calculo de datos de temperatura,openair u otra
> alternativa
>
>
>
> Agradecido por ayudar a encontrar el problema de uqe se quedara pegado R.
> Hasta el momento no he tenido las dificultades, el cambio de memorias
> fisicas ayudó.
>
> Estimados les dejo plantedo una inquietud.
>
> necesito calcular lo siguiente;
>
> - TEmperatura* media diaria*, considerando *3 formas*:
>
>
>
> *- Valor de la temperatura a;(
> (02:00-08:00-14:00-20:00)+(min_diaria)+(max_diaria))/6*
>
>
>
> *-(min_diaria)+(max_diaria)/2.(MEDIA)*
>
>
>
> *-TODOS LOS VALORES REGISTRADOS EN EL DIA/ Nº DE VALORES.*
>
>
>
> La idea es* plotear* l*as 3 formas de medias diarias*, y comparar las
> curvas para anlizar la que mejor se ajusta.
>
> He intentado con openair, pero me da la impresion que esto es un poco mas
> complejo.
>
> PIdo ayuda para pensar en la mejor alternativa a aplicar.
>
> Agradecido de antemano.
>
> Mis datos estan ordenados de la siguiente forma;
>
>
>
> fecha hora   dato
>
> 2014-01-01   00:001
>
> 2014-01-01   00:102
>
> Son 86000 datos. Los datos estan tomados cada 10 minutos, es decir, 6
> datos diarios.
>
> SAludos a todos
>
>
>
> *Sent:* Tuesday, September 06, 2016 at 6:11 AM
> *From:* miguel.angel.rodriguez.mui...@sergas.es
> *To:* javier.val...@mop.gov.cl, c...@qualityexcellence.es
> *Cc:* r-help-es@r-project.org
> *Subject:* Re: [R-es] R SE QUEDA PEGADO e imposibilitado de trabajar.
>
> Hola Javier.
>
> Por lo que comentas (que como bien dice Carlos Ortega, es una
> información incompleta) parece que el detonante del error es que la
> máquina entre en suspensión/economode.
>
> Varias preguntas
>
> - Es un portátil? un sobremesa?
>
> - Has probado si te pasa eso (en esas condiciones) con otro software que
> tenga algún tipo de "trabajo" gráfico?
>
> - Si es un equipo nuevo por qué tiene Windows 7 ¿?¿? Estamos
> hablando de trabajo en un entorno corporativo? Tienes algún tipo de
> restricción en tu usuario?
>
> Así, sin tener más info, yo te recomendaría revisar qué es lo que hace
> tu equipo cuando entra en modo de ahorro de energía (pone sólo la
> pantalla en standby? apaga discos? gráfica? ...) .. de hecho, podrías
> configurarlo para que estuviera siempre activo y probar un tiempo así
> (para intentar determinar las condiciones en las que te pasa).
>
>
> Un saludo,
> Miguel.
>
>
>
> El 05/09/2016 a las 22:51, Javier Valdes Cantallopts (DGA) escribió:
> > Hola Carlos:
> > -Mira, mi máquina es nueva, con 16 giga de memoria Ram, así que no creo
> que sea problema de recursos
> > -En general me pasa esto cuando despliego un Plot. (Después que me paro
> y vuelvo a mi escritorio, pasado 15 min) el plot se deforma en la pantalla
> y después al eliminarlo se queda pegado.
> > -Me pasa sobre Rstudio.
> > -Windows 7 PROF.
> >
> >
> > El 5 de septiembre de 2016, 22:10, Javier Valdes Cantallopts (DGA) <
> javier.val...@mop.gov.cl> escribió:
> > Estimados:
> > Tengo problemas con mi programa R. Cada vez que dejo stand-by mi compu
> por unos minutos, R se queda pegado, e imposibilitado de trabajar, lo que
> me obliga a cerrarlo y volver a abrirlo cada vez que sucede.
> >
>
>
>
>
>
> 
>
> 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