Re: [R] Error message in SIS package

2016-10-17 Thread Jeff Newmiller
I doubt I will know how to help you in any case, but I can see that you are 
shackling yourself to a very small (possibly empty) set of helpers by not 
making your example reproducible. 

You will also slow any helpers down once you change that if you post again in 
HTML format... set your email program to send plain text so the code you supply 
doesn't get corrupted. 

http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

http://adv-r.had.co.nz/Reproducibility.html

PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
-- 
Sent from my phone. Please excuse my brevity.

On October 17, 2016 1:54:52 PM PDT, "Maity, Arnab K"  
wrote:
>I try to run the following code:
>
>sis.fit <- SIS(y = Surv(time = y[, 1], event = y[, 2]), x = x, family =
>"cox", penalty = "lasso", tune = "cv",
>nfolds = 10, type.measure = "deviance", nsis = min(dim(x)), iter =
>FALSE, seed = 334)
>
>I get the following error:
>
>Error in names(coef.beta) = paste("X", ix1, sep = "") :
>  'names' attribute [1] must be the same length as the vector [0].
>
>here is some information about the data.
>
>> head(y)
>  time status
>1   24  1
>2   31  0
>3   39  0
>4   64  1
>5   72  1
>66  0
>> str(y)
> num [1:46, 1:2] 24 31 39 64 72 6 87 17 53 54 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:2] "time" "status"
>> str(x)
> num [1:46, 1:66] 0.59234 0.30042 0.28278 -0.00966 0.08189 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:66] "EIF4EBP1" "TP53BP1" "AKT1.AKT2.AKT3" "AR" ...
>> sessionInfo()
>R version 3.3.1 (2016-06-21)
>Platform: x86_64-w64-mingw32/x64 (64-bit)
>Running under: Windows >= 8 x64 (build 9200)
>
>locale:
>[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
>States.1252LC_MONETARY=English_United States.1252
>[4] LC_NUMERIC=C   LC_TIME=English_United
>States.1252
>
>attached base packages:
>[1] stats graphics  grDevices utils datasets  methods   base
>
>other attached packages:
>[1] survival_2.39-4 SIS_0.8-3   glmnet_2.0-5foreach_1.4.3  
>Matrix_1.2-6
>
>loaded via a namespace (and not attached):
>[1] tools_3.3.1  splines_3.3.1codetools_0.2-14 grid_3.3.1  
>iterators_1.0.8  ncvreg_3.6-0 lattice_0.20-33
>>
>
>Please help!?
>
>
>
>
>Arnab Kumar Maity
>Department of Statistics
>Texas A University
>3143 TAMU, Room 401A
>College Station, TX 77843
>aku...@stat.tamu.edu
>+1 779 777 3428
>
>   [[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] Re: Share R.net dll without having to share R script code?

2016-10-17 Thread Rolf Turner

On 18/10/16 14:04, David Winsemius wrote:



On Oct 17, 2016, at 3:22 PM, Narendra Modi  wrote:

Hi Bob,
Could you explain a bit more on this? How do I use/configure base64?
Any document/example do you have?



To Narendra;

I get the idea that this line of inquiry is designed to obfuscate R

code and derivative works, which in turn I see as an effort to defeat
the open source nature of the R movement. It at least violates the
spirit of the various licenses under which R and the CRAN packaging
policies are distributed.


I'm suggesting that those people who support an open source basis of
R

not continue to use Rhelp as a venue for an effort to undermine the
openness of coding supported by R. If Bob disagrees with me, he is at
liberty to correspond with you privately. I have no authority to enforce
such advice, and anyone is free to opine on the ethics and legality of
this proposed effort.

I concur with David completely.

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.


Re: [R] Share R.net dll without having to share R script code?

2016-10-17 Thread David Winsemius

> On Oct 17, 2016, at 3:22 PM, Narendra Modi  wrote:
> 
> Hi Bob,
> Could you explain a bit more on this? How do I use/configure base64?
> Any document/example do you have?
> 

To Narendra;

I get the idea that this line of inquiry is designed to obfuscate R code and 
derivative works, which in turn I see as an effort to defeat the open source 
nature of the R movement. It at least violates the spirit of the various 
licenses under which R and the CRAN packaging policies are distributed.

I'm suggesting that those people who support an open source basis of R not 
continue to use Rhelp as a venue for an effort to undermine the openness of 
coding supported by R. If Bob disagrees with me, he is at liberty to correspond 
with you privately. I have no authority to enforce such advice, and anyone is 
free to opine on the ethics and legality of this proposed effort.

-- 

David.
> 
> 
> On Fri, Oct 14, 2016 at 9:55 AM, Bob Rudis  wrote:
>> Ugly idea/option, but you could base64 encode the R script (solely to
>> avoid the need to do string quoting) and have that string in the
>> source of the R.net code, then pass it in to the eval portion or write
>> it out to a temp dir and pass that to the eval portion of the code.
>> That way the script is embedded with the DLL and not an extra asset
>> that needs to be managed.
>> 
>> On Fri, Oct 14, 2016 at 10:43 AM, Narendra Modi  
>> wrote:
>>> Thanks Duncan. That's useful to know.
>>> 
>>> On Fri, Oct 14, 2016 at 9:18 AM, Duncan Murdoch
>>>  wrote:
 On 14/10/2016 10:00 AM, Narendra Modi wrote:
> 
> Hello Gurus,
> 
> I have built a code snippet using R.net wherein I call couple of R
> scripts to run optimization packages and use the output in C# code.
> The way I call the R scripts is just by providing its location in the
> C# code.
> 
> So, if I have to share the .dll of the complete program, I will also
> have to share the R scripts; actual code. Is there anyway to avoid it;
> not having to share the r script code with users/testers.
> I am considerably new to R. Any suggestion in this direction is
> appreciated!
> 
 
 I don't know what the R.net .dll is, but if it includes R, you need to 
 share
 the complete source code of anything you distribute that includes it.  The 
 R
 scripts will be only a small part of that.
 
 Sharing less than that is a copyright violation, since you are only 
 licensed
 to distribute R under the GPL license, and it requires that you share code
 of the original and your modifications.
 
 Duncan Murdoch
 
>>> 
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error message in SIS package

2016-10-17 Thread Maity, Arnab K
I try to run the following code:

sis.fit <- SIS(y = Surv(time = y[, 1], event = y[, 2]), x = x, family = "cox", 
penalty = "lasso", tune = "cv",
 nfolds = 10, type.measure = "deviance", nsis = min(dim(x)), 
iter = FALSE, seed = 334)

I get the following error:

Error in names(coef.beta) = paste("X", ix1, sep = "") :
  'names' attribute [1] must be the same length as the vector [0].

here is some information about the data.

> head(y)
  time status
1   24  1
2   31  0
3   39  0
4   64  1
5   72  1
66  0
> str(y)
 num [1:46, 1:2] 24 31 39 64 72 6 87 17 53 54 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:46] "1" "2" "3" "4" ...
  ..$ : chr [1:2] "time" "status"
> str(x)
 num [1:46, 1:66] 0.59234 0.30042 0.28278 -0.00966 0.08189 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:46] "1" "2" "3" "4" ...
  ..$ : chr [1:66] "EIF4EBP1" "TP53BP1" "AKT1.AKT2.AKT3" "AR" ...
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252  
  LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C   LC_TIME=English_United States.1252

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

other attached packages:
[1] survival_2.39-4 SIS_0.8-3   glmnet_2.0-5foreach_1.4.3   Matrix_1.2-6

loaded via a namespace (and not attached):
[1] tools_3.3.1  splines_3.3.1codetools_0.2-14 grid_3.3.1   
iterators_1.0.8  ncvreg_3.6-0 lattice_0.20-33
>

Please help!?




Arnab Kumar Maity
Department of Statistics
Texas A University
3143 TAMU, Room 401A
College Station, TX 77843
aku...@stat.tamu.edu
+1 779 777 3428

[[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] Share R.net dll without having to share R script code?

2016-10-17 Thread Narendra Modi
Hi Bob,
Could you explain a bit more on this? How do I use/configure base64?
Any document/example do you have?



On Fri, Oct 14, 2016 at 9:55 AM, Bob Rudis  wrote:
> Ugly idea/option, but you could base64 encode the R script (solely to
> avoid the need to do string quoting) and have that string in the
> source of the R.net code, then pass it in to the eval portion or write
> it out to a temp dir and pass that to the eval portion of the code.
> That way the script is embedded with the DLL and not an extra asset
> that needs to be managed.
>
> On Fri, Oct 14, 2016 at 10:43 AM, Narendra Modi  wrote:
>> Thanks Duncan. That's useful to know.
>>
>> On Fri, Oct 14, 2016 at 9:18 AM, Duncan Murdoch
>>  wrote:
>>> On 14/10/2016 10:00 AM, Narendra Modi wrote:

 Hello Gurus,

 I have built a code snippet using R.net wherein I call couple of R
 scripts to run optimization packages and use the output in C# code.
 The way I call the R scripts is just by providing its location in the
 C# code.

 So, if I have to share the .dll of the complete program, I will also
 have to share the R scripts; actual code. Is there anyway to avoid it;
 not having to share the r script code with users/testers.
 I am considerably new to R. Any suggestion in this direction is
 appreciated!

>>>
>>> I don't know what the R.net .dll is, but if it includes R, you need to share
>>> the complete source code of anything you distribute that includes it.  The R
>>> scripts will be only a small part of that.
>>>
>>> Sharing less than that is a copyright violation, since you are only licensed
>>> to distribute R under the GPL license, and it requires that you share code
>>> of the original and your modifications.
>>>
>>> Duncan Murdoch
>>>
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

__
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] findInterval() surprising behavior

2016-10-17 Thread Rui Barradas

Hello,

Same on Windows 7.

> findInterval(x=c(6, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE)
[1] 4 2 1 1
> findInterval(x=c(4, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE)
[1] 3 1 1 1
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=Portuguese_Portugal.1252 
LC_CTYPE=Portuguese_Portugal.1252
[3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C 


[5] LC_TIME=Portuguese_Portugal.1252

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

other attached packages:
[1] lattice_0.20-33

loaded via a namespace (and not attached):
[1] tools_3.3.1 grid_3.3.1

Rui Barradas

Em 17-10-2016 20:03, Dmitriy Chernykh via R-help escreveu:

Hello,

I call function findInterval in the following way:

findInterval(x=c(6, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE),

and expect that it will return 4 1 1 1. But the function returns 4 2 1 1 
instead. Moreover, if I change the first element in x to, say, 4 -

findInterval(x=c(4, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE)

then the function returns 3 1 1 1.

Why are results for identical elements in x not the same? And why is element in 
x influenced by previous one? I suspect this is a bug but I am not 100% sure.

Technical details:

sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

locale:
  [1] LC_CTYPE=ru_RU.UTF-8   LC_NUMERIC=C   LC_TIME=ru_RU.UTF-8 
   LC_COLLATE=ru_RU.UTF-8 LC_MONETARY=ru_RU.UTF-8
  [6] LC_MESSAGES=ru_RU.UTF-8LC_PAPER=ru_RU.UTF-8   LC_NAME=C   
   LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C

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

loaded via a namespace (and not attached):
[1] tools_3.3.1


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] findInterval() surprising behavior

2016-10-17 Thread Dmitriy Chernykh via R-help
Hello,

I call function findInterval in the following way:

findInterval(x=c(6, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE),

and expect that it will return 4 1 1 1. But the function returns 4 2 1 1 
instead. Moreover, if I change the first element in x to, say, 4 -

findInterval(x=c(4, 1, 1, 1), vec=c(0, 1, 3, 5, 10), left.open=TRUE)

then the function returns 3 1 1 1.

Why are results for identical elements in x not the same? And why is element in 
x influenced by previous one? I suspect this is a bug but I am not 100% sure.

Technical details:

sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

locale:
 [1] LC_CTYPE=ru_RU.UTF-8   LC_NUMERIC=C   LC_TIME=ru_RU.UTF-8  
  LC_COLLATE=ru_RU.UTF-8 LC_MONETARY=ru_RU.UTF-8   
 [6] LC_MESSAGES=ru_RU.UTF-8    LC_PAPER=ru_RU.UTF-8   LC_NAME=C
  LC_ADDRESS=C   LC_TELEPHONE=C    
[11] LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C   

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

loaded via a namespace (and not attached):
[1] tools_3.3.1


Thanks.

-- 
Dmitrii Chernykh
[[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] Reshaping geographic data

2016-10-17 Thread MacQueen, Don
I suggest you simplify your computing task by making this into three
distinct tasks:

1. get copies of the shapefiles on your computer. Do this outside of R.
Since this has two parts, i.e., downloading and unzipping, it will be
easier at first to do it outside of r. Then later you can figure out how
to do it using R if necessary.

2. figure out how to load shapefiles into R (the key package is rgdal)

3. figure out how to reshape a shapefile in R (I don't know what you mean
by reshape a shape file).

For steps 2 and 3, ask further questions on r-sig-geo

Are you aware that a "shapefile" is actually several files, all with the
same prefix but different suffixes? I'd suggest putting them in a
subdirectory of your working directory.

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 10/17/16, 8:42 AM, "R-help on behalf of g.maub...@weinwolf.de"
 wrote:

>Hi All,
>
>I need to reshape an ESRI shape file: http://arnulf.us/PLZ and resp
>http://www.metaspatial.net/download/plz.tar.gz
>
>I found an instruction for T-SQL Server:
>
>https://blog.oraylis.de/2010/05/german-map-spatial-data-for-plz-postal-cod
>e-regions/
>
>How can I do this using R?
>
>Kind regards
>
>Georg
>
>-- cut --
>Here's my code so far:
>
>download.file(
>url = "http://www.metaspatial.net/download/plz.tar.gz;,
>destfile = "C:/temp/plz.tar.gz")
>
>untar(tarfile = "C:/temp/plz.tar.gz",
>  exdir = "C:/temp",
>  compressed = "gzip")
>
>__
>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] lb and ub for variables - nloptr

2016-10-17 Thread Narendra Modi
Hello All,
I use nloptr to perform optimization.
In one example,the lb for each variable is 0 and ub is Inf during the first run.

x <- c(10,10,10,10) # initial values
lb <- c(0,0,0,0)
ub <- c(Inf,Inf,Inf,Inf)

optimised.answer  = 4.2,0.001,20,21

To run the second time for a better match, I set a condition in the ub
matrix saying if the value of any of optimized variable in the first
run is less than 0.01, set the ub for that variable as 0; both lb and
ub for that variable is 0. So I expect that during the second run,
this variable is not varied by the optimizer at all.

i.e. new.x <- c(4.2,0,20,21)
But when I run the optimizer the second time with the "new.x",all the
above variable is still varied by the optimizer!

Is there anyway to not have the second variable varied?

NM

__
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] Adjusting axis labels on lattice xyplot [RESOLVED]

2016-10-17 Thread Rich Shepard

On Mon, 17 Oct 2016, Rui Barradas wrote:


I'm not a lattice user but the 'by' argument is not an argument of xyplot,
it's an argument of ?seq.Date.


Rui,

  Yes, this does help.

Thanks very much,

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Reshaping geographic data

2016-10-17 Thread G . Maubach
Hi All,

I need to reshape an ESRI shape file: http://arnulf.us/PLZ and resp 
http://www.metaspatial.net/download/plz.tar.gz

I found an instruction for T-SQL Server:

https://blog.oraylis.de/2010/05/german-map-spatial-data-for-plz-postal-code-regions/

How can I do this using R?

Kind regards

Georg

-- cut --
Here's my code so far:

download.file(
url = "http://www.metaspatial.net/download/plz.tar.gz;,
destfile = "C:/temp/plz.tar.gz")

untar(tarfile = "C:/temp/plz.tar.gz",
  exdir = "C:/temp",
  compressed = "gzip")

__
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] Is it possible to extract coefficient '(Intercept)' with an identifier (Group ID)

2016-10-17 Thread Chad Danyluck
Hello,

I have a data set with 80 observations (21 groups) on which I have run an
MLM (using lme).
I want to extract the coefficients for the intercept from my MLM using:

coefficients(summary(mig1.mlm))$'(Intercept)'

This produces a list of 21 intercepts, one for each group. For another test
I want to run, I need to know which coefficient corresponds to which group,
however, it is not clear to me how the list of intercepts are ordered.
Thus, I do not know which group size to assign to each intercept. Does
anyone know if there is a set order in which coefficients get listed when
using the 'coefficients()' function on an lme object? Is there a way to
extract group ID along with these coefficients?

I have provided the dput code for reproducing the results of my lme object
on a small sample of my data set, which only includes observations for 16
groups. I apologize that the dput code is a bit long, but if I use fewer
observations the lme() will not run.

structure(list(modelStruct = structure(list(reStruct = structure(list(
mig1.data.group.id = structure(c(0.542553815682571, -3.00715767259167,
-0.0442257816422898), formula = ~1 + mig1.data.minutes, Dimnames = list(
c("(Intercept)", "mig1.data.minutes"), c("(Intercept)",
"mig1.data.minutes")), class = c("pdLogChol", "pdSymm",
"pdMat"))), .Names = "mig1.data.group.id", settings = c(1,
1, 0, 4), class = "reStruct", plen = structure(3L, .Names = "
mig1.data.group.id"))), .Names = "reStruct", settings = c(1,
0, 1, 4), class = c("lmeStructInt", "lmeStruct", "modelStruct"
), pmap = structure(c(TRUE, TRUE, TRUE), .Dim = c(3L, 1L), .Dimnames = list(
NULL, "reStruct"))), dims = structure(list(N = 19L, Q = 1L,
qvec = c(2, 0, 0), ngrps = structure(c(14L, 1L, 1L), .Names = c("
mig1.data.group.id",
"X", "y")), ncol = c(2, 6, 1)), .Names = c("N", "Q", "qvec",
"ngrps", "ncol")), contrasts = structure(list(), .Names = character(0)),
coefficients = structure(list(fixed = structure(c(0.592247813206646,
-0.014327735870407, 0.511918311092002, 0.115144106181435,
-0.528777081078343, -0.672133737297911), .Names = c("(Intercept)",
"c.group.size", "poly(c.minutes, 2)1", "poly(c.minutes, 2)2",
"c.group.size:poly(c.minutes, 2)1", "c.group.size:poly(c.minutes, 2)2"
)), random = structure(list(mig1.data.group.id =
structure(c(0.0570720466445653,
-0.0201731190981803, 0.0799015267182444, -0.031341565397712,
-0.0381722036361848, 0.0114736430861277, -0.066744648680322,
-0.00465893340911505, 0.020902212048436, 0.103713939575392,
0.0341701969323794, -0.127867324157186, 0.0139879650936152,
-0.0322637357200584, 0.000462148038646844, 0.00106241177658854,
-0.000443527404792683, 0.000657233443565595, 0.00098128378165296,
-0.00165073855689212, -0.000552460717034177, -3.8563057004643e-05,
-0.000438319931643705, -0.00268379571707918, -0.000716549920599101,
0.00328705496268145, -0.000204144495804703, 0.000277967797714908
), .Dim = c(14L, 2L), .Dimnames = list(c("2", "3", "4", "5",
"7", "8", "10", "11", "12", "13", "16", "17", "20", "21"),
c("(Intercept)", "mig1.data.minutes", .Names = "
mig1.data.group.id")), .Names = c("fixed",
"random")), varFix = structure(c(0.000801580029879769,
-4.89031257398402e-06,
0.000560846217563802, 0.00158064241688306, -0.00222841423081078,
-0.0013850278556988, -4.89031257398402e-06, 0.000998585707455886,
-0.0034436196730218, -0.0015456585682428, 0.00116336495693562,
0.00434765229782492, 0.000560846217563802, -0.0034436196730218,
0.0244392316273714, 0.00996105608959828, -0.00854131836998962,
-0.0224942435104164, 0.00158064241688306, -0.0015456585682428,
0.00996105608959828, 0.0158945692774124, -0.0133452835173244,
-0.0153057275817998, -0.00222841423081078, 0.00116336495693562,
-0.00854131836998962, -0.0133452835173244, 0.0227078394482903,
0.0170647625679209, -0.0013850278556988, 0.00434765229782492,
-0.0224942435104164, -0.0153057275817998, 0.0170647625679209,
0.0349630532188317), .Dim = c(6L, 6L), .Dimnames =
list(c("(Intercept)",
"c.group.size", "poly(c.minutes, 2)1", "poly(c.minutes, 2)2",
"c.group.size:poly(c.minutes, 2)1", "c.group.size:poly(c.minutes, 2)2"
), c("(Intercept)", "c.group.size", "poly(c.minutes, 2)1",
"poly(c.minutes, 2)2", "c.group.size:poly(c.minutes, 2)1",
"c.group.size:poly(c.minutes, 2)2"))), sigma = 0.0524019104240361,
apVar = structure(c(0.195521445237494, 0.385341061075355,
-0.286676275652333, -0.150058129917539, 0.385341061075355,
3.44522079913615, 0.17521882332131, -0.88335110165811,
-0.286676275652333,
0.17521882332131, 2.73770494209246, -0.319576762409392,
-0.150058129917539,
-0.88335110165811, -0.319576762409392, 0.493177764041453), .Dim = c(4L,
4L), .Dimnames = list(c("reStruct.mig1.data.group.id1",
"reStruct.mig1.data.group.id2",
"reStruct.mig1.data.group.id3", "lSigma"),
c("reStruct.mig1.data.group.id1",

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-17 Thread Rui Barradas

Hello,

I'm not a lattice user but the 'by' argument is not an argument of 
xyplot, it's an argument of ?seq.Date.


Hope this helps,

Rui Barradas

Em 17-10-2016 15:45, Rich Shepard escreveu:

On Fri, 14 Oct 2016, David Winsemius wrote:


xyplot(amount ~ date | station, data=rain, main="Weather Stations",
  xlab="Date", ylab="Amount (inches)", pch=16, col=132,
  scales=list(y=list(at=0:4),
  x=list(at=seq(min(rain$date), max(rain$date),
by='week'), rot=90) )
)


David,

   I searched ?xyplot for the 'by' option in scales and did not find it. I
understand the other parameters of scales and would like to learn how to
use
'by' when appropriate.

TIA,

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
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] Adjusting axis labels on lattice xyplot

2016-10-17 Thread Rich Shepard

On Fri, 14 Oct 2016, David Winsemius wrote:


xyplot(amount ~ date | station, data=rain, main="Weather Stations",
  xlab="Date", ylab="Amount (inches)", pch=16, col=132,
  scales=list(y=list(at=0:4),
  x=list(at=seq(min(rain$date), max(rain$date), by='week'), rot=90) 
)
)


David,

  I searched ?xyplot for the 'by' option in scales and did not find it. I
understand the other parameters of scales and would like to learn how to use
'by' when appropriate.

TIA,

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Specific question on LDheatmap

2016-10-17 Thread David González
Have you been codify your SNP to numbers (ej. 0, 1, 2) and perform analysis 
again?

El martes, 8 de julio de 2008, 7:36:00 (UTC-6), Boks, M.P.M. escribió:
>
>
> Dear R-friends,
>
> I am stuck making an LD plot of a small genotype set:
>
> An exert of my data (genotypes)
>
> >tempped.exert
> V27/V28 V33/V34 V39/V40 V41/V42
> 1  B/B B/B A/A B/B
> 2  B/A B/B A/B B/B
> 3  B/B B/B A/A B/B
> 4  B/A B/A A/B B/A
> 5  B/B B/B A/A B/B
>
> The command:
> >LDheatmap(tempped.exert)
>
> Gives me the desired LD map of the first two columns only.
>
> How do I make it to take all 4 SNP's/colomns?
>
> Your help is highly appreciated,
>
> Thanks,
>
> Marco
>
> __
> r-h...@r-project.org  mailing list
> 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] [R-pkgs] New package: eulerr 0.1.0

2016-10-17 Thread Johan Larsson
Dear R users,



I would like to announce the first version of eulerr 
(https://cran.r-project.org/package=eulerr). eulerr generates area-proportional 
euler diagrams that display set relationships (intersections, unions, and 
disjoints) with circles. Euler diagrams 
(https://en.wikipedia.org/wiki/Euler_diagram) are Venn diagrams without the 
requirement that all set interactions be present (whether they are empty or 
not). That is, depending on input, eulerr will sometimes produce Venn diagrams 
and sometimes not.



Please see the vignette 
(https://cran.r-project.org/web/packages/eulerr/vignettes/introduction.html) 
for a brief introduction or visit the repository on GitHub 
(https://github.com/jolars/eulerr) to contribute.



All the best,

Johan

[[alternative HTML version deleted]]

___
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] LDheatmap

2016-10-17 Thread David González
Yes, I used LDheatmap just a moment... First you need to convert your 
matrix (ej. your geno file) to snp.matrix usin the package "chopsticks", 
web> https://bioconductor.org/packages/release/bioc/html/chopsticks.html.

This package is no in R library. You need use a sourse. Use this code>

## try http:// if https:// URLs are not supported
source("https://bioconductor.org/biocLite.R;)
biocLite("chopsticks")

Then, a example to convert your matrix (geno file) to snp.matrix and use 
LDheatmap function

# Pass LDheatmap a snp.matrix object
set.seed(1)
#make an example matrix of genotypes, coded as 0, 1 2 copies of an index allele
gdat<-matrix(rbinom(n=500,size=2,prob=.5),ncol=5) 
require(chopsticks)
gdat<-as(gdat,"snp.matrix")
library(LDheatmap)
LDheatmap(gdat,genetic.distances=c(0,1000,3000,4000,1))

I hope help you..




El miércoles, 3 de febrero de 2016, 18:08:46 (UTC-6), Val escribió:
>
> Thank you Bert, 
>
> Yes I looked a this one and I was looking for if any one has used it or 
> not 
> before?  My data set is different what they are showing in the paper 
>
>
>
>
>
> On Wed, Feb 3, 2016 at 4:00 PM, Bert Gunter  > wrote: 
>
> > Have you looked here (found immediately by an internet search!)? 
> > 
> > 
> https://cran.r-project.org/web/packages/LDheatmap/vignettes/LDheatmap.pdf 
> > 
> > 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 Wed, Feb 3, 2016 at 1:49 PM, Ashta  
> wrote: 
> > > Hi all, 
> > > 
> > > I am  looking for an R package that calculates  a pair wise LD 
> > > (linkage disequilibrium) I came up with  library(LDheatmap).  has any 
> > > one used this library? I would appreciate if I get a help how to use 
> > > this library for my set of data.. 
> > > 
> > > 
> > > My data set look like 
> > > 
> > > Geno file 
> > > Name1 1 1 2 2 2 2 
> > > Name2 2 2 2 2 2 2 
> > > Name3 2 2 2 2 2 2 
> > > Name4  2 2 2 2 2 2 
> > > Name5 1 1 2 2 2 2 
> > > 
> > > 
> > > NameN  1   1 1 2 2 2 2 
> > > 
> > > 
> > > The other file is map file 
> > > Chromosome, SNP, Location (physical) 
> > > 
> > > 
> > > Thank you in advance 
> > > 
> > > __ 
> > > r-h...@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-h...@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-h...@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] Caret Train does not output the Accuracy SD

2016-10-17 Thread Heba Attia via R-help
Hello Rescuers,

I have a problem with retrieving the Accuracy Standard Deviation for a
"nnet" model trained by "train" in the "caret" package.

Below is my code. I checked several examples online whose published output
shows Accuracy SD but I could not get to finding a difference between these
codes and mine. I hope someone can help with identifying where my problem
is.

*set.seed(42)*
*control <- trainControl(method="repeatedcv", number=10, repeats=5)*

*rfFit <- train(Label ~., data = Train_2.4.16,*
* method = "rf",*
* preProc = c("center", "scale"),*
* tuneLength = 10,*
* metric = "Accuracy",*
* trControl=control,*
* allowParallel=TRUE)*
*print(rfFit) *

​Below is the output I get:
​
​*Random Forest *

*3141 samples*
* 110 predictor*
*   5 classes: '(2.81,3.19]', '(3.19,3.48]', '(3.48,3.74]', '(3.74,4]',
'[0.43,2.81]' *

*No pre-processing*
*Resampling: Cross-Validated (10 fold, repeated 5 times) *
*Summary of sample sizes: 2827, 2827, 2828, 2827, 2828, 2827, ... *
*Resampling results:*

*  Accuracy   Kappa*
*  0.7520328  0.6900293*

*Tuning parameter 'mtry' was held constant at a value of 10.48809​*

​If relevant, I am using Windows ​10, RStudio and the Caret package updated
as of today version 6.0-71

​Thank you,
Heba. ​

-- 


*Heba AtteyaResearch Analyst Data Analytics and Institutional Researchtel.
20.2.2615. 2230"Information is the oil of the 21st century, and analytics
is the combustion engine" ~Senior VP, Gartner Research*

[[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] Reg : R : How to capture cpu usage, memory usage and disks info using R language

2016-10-17 Thread Bob Rudis
You can do something like:
https://www.simple-talk.com/sql/performance/collecting-performance-data-into-a-sql-server-table/
and avoid the R step. Let the log perf data directly.

On Mon, Oct 17, 2016 at 6:03 AM, jim holtman  wrote:
> within the VBS script you can easily access remote computers.
>
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>
>
> On Mon, Oct 17, 2016 at 5:58 AM, Manohar Reddy  wrote:
>> Thanks Jim.
>>
>>
>>
>>Actually my requirement is I have ~ 20 servers which are running on
>> windows server family OS,if I want to check any server cpu usge,memory usage
>> or disk info I need to log into every server instead of doing like this if I
>> get that kind of information using R then I can save it in some RDBMS
>> database then I will populate this live data on some dashboard like which
>> are made by R using shiny,so that I can view/get the all the information on
>> single page.
>>
>>
>>
>>Here for me challenging work is how to capture cpu,memory,disk info using
>> R .
>>
>>
>> On Sun, Oct 16, 2016 at 8:37 PM, jim holtman  wrote:
>>>
>>> Here is a start on the solution.  This will create a VBS script that
>>> will gather the CPU data and return it in a character vector that you
>>> can extract the data from.  You can add to it to get the other data
>>> you are looking for.
>>>
>>> 
>>> > temp <- tempfile(fileext = '.vbs')  # get a temp file
>>> >
>>> > # create the VBS file to collect processor data
>>> > writeLines('Set objWMIService =
>>> > GetObject("winmgmts:localhost\\root\\CIMV2")
>>> + Set CPUInfo = objWMIService.ExecQuery("SELECT * FROM
>>> Win32_PerfFormattedData_PerfOS_Processor",,48)
>>> + For Each Item in CPUInfo
>>> + Wscript.Echo "PercentProcessorTime: " & Item.PercentProcessorTime &
>>> _
>>> +  "  processor:" & Item.Name
>>> + Next',
>>> +  temp)
>>> >
>>> > results <- shell(paste("cscript", temp), intern = TRUE)  # execute using
>>> > 'cscript'
>>> > results # all the data
>>> [1] "Microsoft (R) Windows Script Host Version 5.8"
>>> [2] "Copyright (C) Microsoft Corporation. All rights reserved."
>>> [3] ""
>>> [4] "PercentProcessorTime: 18  processor:0"
>>> [5] "PercentProcessorTime: 6  processor:1"
>>> [6] "PercentProcessorTime: 6  processor:2"
>>> [7] "PercentProcessorTime: 0  processor:3"
>>> [8] "PercentProcessorTime: 7  processor:_Total"
>>> > grep("processor:", results, value = TRUE)  # get just processor data
>>> [1] "PercentProcessorTime: 18  processor:0" "PercentProcessorTime:
>>> 6  processor:1"
>>> [3] "PercentProcessorTime: 6  processor:2"  "PercentProcessorTime:
>>> 0  processor:3"
>>> [5] "PercentProcessorTime: 7  processor:_Total"
>>> >
>>> >
>>> #
>>>
>>>
>>> Jim Holtman
>>> Data Munger Guru
>>>
>>> What is the problem that you are trying to solve?
>>> Tell me what you want to do, not how you want to do it.
>>>
>>>
>>> On Fri, Oct 14, 2016 at 5:37 AM, Manohar Reddy 
>>> wrote:
>>> > Hi,
>>> >
>>> > Is there any possibility that we can capture cpu usage ,memory usage and
>>> > disks info using R language on *windows family OS* ?
>>> >
>>> >
>>> >
>>> >   I would like to see data that’s looks like
>>> > a
>>> >  below
>>> >
>>> >
>>> >
>>> >Cpu usage : 70 %
>>> >
>>> >Memory usage  : 80 %
>>> >
>>> >Disks: C drive – 40 % full,D dive – 60 %,full E drive – 30 %
>>> > full
>>> >
>>> >
>>> >for more info please find the attachement.
>>> >
>>> >
>>> >  Thanks in Advance ,Manu.
>>> >
>>> > __
>>> > 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.
>>
>>
>>
>>
>> --
>>
>>
>> Manu.
>
> __
> 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] Reg : R : How to capture cpu usage, memory usage and disks info using R language

2016-10-17 Thread jim holtman
within the VBS script you can easily access remote computers.

Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.


On Mon, Oct 17, 2016 at 5:58 AM, Manohar Reddy  wrote:
> Thanks Jim.
>
>
>
>Actually my requirement is I have ~ 20 servers which are running on
> windows server family OS,if I want to check any server cpu usge,memory usage
> or disk info I need to log into every server instead of doing like this if I
> get that kind of information using R then I can save it in some RDBMS
> database then I will populate this live data on some dashboard like which
> are made by R using shiny,so that I can view/get the all the information on
> single page.
>
>
>
>Here for me challenging work is how to capture cpu,memory,disk info using
> R .
>
>
> On Sun, Oct 16, 2016 at 8:37 PM, jim holtman  wrote:
>>
>> Here is a start on the solution.  This will create a VBS script that
>> will gather the CPU data and return it in a character vector that you
>> can extract the data from.  You can add to it to get the other data
>> you are looking for.
>>
>> 
>> > temp <- tempfile(fileext = '.vbs')  # get a temp file
>> >
>> > # create the VBS file to collect processor data
>> > writeLines('Set objWMIService =
>> > GetObject("winmgmts:localhost\\root\\CIMV2")
>> + Set CPUInfo = objWMIService.ExecQuery("SELECT * FROM
>> Win32_PerfFormattedData_PerfOS_Processor",,48)
>> + For Each Item in CPUInfo
>> + Wscript.Echo "PercentProcessorTime: " & Item.PercentProcessorTime &
>> _
>> +  "  processor:" & Item.Name
>> + Next',
>> +  temp)
>> >
>> > results <- shell(paste("cscript", temp), intern = TRUE)  # execute using
>> > 'cscript'
>> > results # all the data
>> [1] "Microsoft (R) Windows Script Host Version 5.8"
>> [2] "Copyright (C) Microsoft Corporation. All rights reserved."
>> [3] ""
>> [4] "PercentProcessorTime: 18  processor:0"
>> [5] "PercentProcessorTime: 6  processor:1"
>> [6] "PercentProcessorTime: 6  processor:2"
>> [7] "PercentProcessorTime: 0  processor:3"
>> [8] "PercentProcessorTime: 7  processor:_Total"
>> > grep("processor:", results, value = TRUE)  # get just processor data
>> [1] "PercentProcessorTime: 18  processor:0" "PercentProcessorTime:
>> 6  processor:1"
>> [3] "PercentProcessorTime: 6  processor:2"  "PercentProcessorTime:
>> 0  processor:3"
>> [5] "PercentProcessorTime: 7  processor:_Total"
>> >
>> >
>> #
>>
>>
>> Jim Holtman
>> Data Munger Guru
>>
>> What is the problem that you are trying to solve?
>> Tell me what you want to do, not how you want to do it.
>>
>>
>> On Fri, Oct 14, 2016 at 5:37 AM, Manohar Reddy 
>> wrote:
>> > Hi,
>> >
>> > Is there any possibility that we can capture cpu usage ,memory usage and
>> > disks info using R language on *windows family OS* ?
>> >
>> >
>> >
>> >   I would like to see data that’s looks like
>> > a
>> >  below
>> >
>> >
>> >
>> >Cpu usage : 70 %
>> >
>> >Memory usage  : 80 %
>> >
>> >Disks: C drive – 40 % full,D dive – 60 %,full E drive – 30 %
>> > full
>> >
>> >
>> >for more info please find the attachement.
>> >
>> >
>> >  Thanks in Advance ,Manu.
>> >
>> > __
>> > 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.
>
>
>
>
> --
>
>
> Manu.

__
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] Reg : R : How to capture cpu usage, memory usage and disks info using R language

2016-10-17 Thread Manohar Reddy
Thanks Jim.



   Actually my requirement is I have ~ 20 servers which are running on
windows server family OS,if I want to check any server cpu usge,memory
usage or disk info I need to log into every server instead of doing like
this if I  get that kind of information using R then I can save it in some
RDBMS database then I will populate this live data on some dashboard like
which are made by R using shiny,so that I can view/get the all the
information on single page.



   Here for me challenging work is how to capture cpu,memory,disk info
using R .

On Sun, Oct 16, 2016 at 8:37 PM, jim holtman  wrote:

> Here is a start on the solution.  This will create a VBS script that
> will gather the CPU data and return it in a character vector that you
> can extract the data from.  You can add to it to get the other data
> you are looking for.
>
> 
> > temp <- tempfile(fileext = '.vbs')  # get a temp file
> >
> > # create the VBS file to collect processor data
> > writeLines('Set objWMIService = GetObject("winmgmts:
> localhost\\root\\CIMV2")
> + Set CPUInfo = objWMIService.ExecQuery("SELECT * FROM
> Win32_PerfFormattedData_PerfOS_Processor",,48)
> + For Each Item in CPUInfo
> + Wscript.Echo "PercentProcessorTime: " & Item.PercentProcessorTime & _
> +  "  processor:" & Item.Name
> + Next',
> +  temp)
> >
> > results <- shell(paste("cscript", temp), intern = TRUE)  # execute using
> 'cscript'
> > results # all the data
> [1] "Microsoft (R) Windows Script Host Version 5.8"
> [2] "Copyright (C) Microsoft Corporation. All rights reserved."
> [3] ""
> [4] "PercentProcessorTime: 18  processor:0"
> [5] "PercentProcessorTime: 6  processor:1"
> [6] "PercentProcessorTime: 6  processor:2"
> [7] "PercentProcessorTime: 0  processor:3"
> [8] "PercentProcessorTime: 7  processor:_Total"
> > grep("processor:", results, value = TRUE)  # get just processor data
> [1] "PercentProcessorTime: 18  processor:0" "PercentProcessorTime:
> 6  processor:1"
> [3] "PercentProcessorTime: 6  processor:2"  "PercentProcessorTime:
> 0  processor:3"
> [5] "PercentProcessorTime: 7  processor:_Total"
> >
> >
> #
>
>
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>
>
> On Fri, Oct 14, 2016 at 5:37 AM, Manohar Reddy 
> wrote:
> > Hi,
> >
> > Is there any possibility that we can capture cpu usage ,memory usage and
> > disks info using R language on *windows family OS* ?
> >
> >
> >
> >   I would like to see data that’s looks like
> > a
> >  below
> >
> >
> >
> >Cpu usage : 70 %
> >
> >Memory usage  : 80 %
> >
> >Disks: C drive – 40 % full,D dive – 60 %,full E drive – 30 %
> full
> >
> >
> >for more info please find the attachement.
> >
> >
> >  Thanks in Advance ,Manu.
> >
> > __
> > 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.
>



-- 


*Manu.*

[[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] Problem installing rgdal on a laptop running Ubuntu 16.04.1

2016-10-17 Thread Rolf Turner



On 10/04/2016 05:54 PM, Rolf Turner wrote:


I previously sent a cri de coeur about this problem to the r-help list
but so far have not managed to extract a solution.  So I am trying here.
(Uh, Ubuntu *is* a "special instance" of Debian, isn't it?)

The problem is that I cannot install rgdal, and I need it.  Rather
desperately.

I do:

install.packages("rgdal",lib="/home/rolf/Rlib")

and get the error message:


** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/home/rolf/Rlib/rgdal/libs/rgdal.so':
  /home/rolf/Rlib/rgdal/libs/rgdal.so: undefined symbol:
CPLQuietErrorHandler
Error: loading failed
Execution halted


Since I (in my desperation) cross-posted to r-sig-debian and r-help, I 
am sending this "SOLVED" message to both lists.


The solution took a long while to find, but in the end it was very simple.

Quite a while back I was having problems with installing some package
(I *think* it was one of my own packages, hmm.discnp), and someone (the 
details are lost in the mists of time) advised me to create a directory 
".R" in my home directory and in it place a file "Makevars" containing 
the lines:



FCFLAGS = -g -O2 -mtune=native -fbounds-check
FFLAGS = -g -O2 -mtune=native -fbounds-check
PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)


This solved the problem that I was having at that time.  I had long 
forgotten the directory ".R" and *that* was  what was causing the problem.


A *very* clever and knowledgeable young Linux whiz, who kindly agreed to 
help me with this problem, eventually tracked down the fact that it 
originated from ".R".  When I removed ".R", the problem with rgdal (and

problems with several other packages, that subsequently surfaced) went away.

My system is now humming away smoothly.

Thanks to everyone who (futilely!) attempted to help me out.

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.


Re: [R-es] instalar R3.3 en ubuntu

2016-10-17 Thread miguel.angel.rodriguez.muinos
Hola José.

Puedes seguir las instrucciones que dan en el CRAN:
http://ftp.cixug.es/CRAN/bin/linux/ubuntu/

Básicamente consiste en agregar un repositorio distinto al de tu versión
de ubuntu y actualizar el sistema.

Un saludo,
Miguel.




El 17/10/2016 a las 1:18, Jose Ramirez Costa escribió:
> Buen dia, quiero instalar una version mas actualizada de R diferente a la
> que viene por defecto en el repositorio de UBUNTU q es la version 3.02
>
> Alguien me podria dar algunas indicaciones paso a paso.
>
> Muchas gracias
>
> Saludos
>
> José
>
>



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