[R] How to get bathymetry data using R

2016-06-10 Thread javad bayat
Dear R users;
I am searching for a package to extract bathymetry data from topography map
to produce the control file for CE-Qual-w2 model.
Is there anyone to know how to do it?
many thanks.

-- 
Best Regards
Javad Bayat
M.Sc. Environment Engineering
Alternative Mail: bayat...@yahoo.com

[[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] Visualize Sparse Matrix.

2016-06-10 Thread Jim Lemon
Hi Francisco,
Your example plot shows me what you want to do (I think). I'm guessing that
you want to display the values in your matrix that are NOT zero or NA,
either colored in some way, or just in one color as the example. The
following example shows how to do both of these:

# wtmat<-matrix(rnorm(4602*1817),nrow=4602)
# use a smaller matrix to illustrate the principle
wtmat<-matrix(rnorm(46*18),nrow=46)
# make it "sparse" by taking out all small values
# in your case this may be changing all zero values to NS
wtmat[abs(wtmat)<1]<-NA
library(plotrix)
x11(width=5,height=13)
# display all values in the matrix
# colored as red->white (negative values), white (NA)
# and white->black (positive values)
color2D.matplot(wtmat,c(1,1,0),c(0,1,0),c(0,1,0),border=FALSE)
# now do a plot just showing values that are not NA
color2D.matplot(abs(wtmat),extremes=c(4,4),border=FALSE)

My original example also looked "dirty", albeit colorful, because there
were so many rectangles on it. With a PDF plot about 500mm high you can see
the individual rectangles in a matrix plot of your original dimensions.

Jim


On Sat, Jun 11, 2016 at 3:29 AM, FRANCISCO XAVIER SUMBA TORAL <
xavier.sumb...@ucuenca.ec> wrote:

> Hi Jim,
>
> Thanks for your answer.
>
> I try your code example, but it is basically the same that I had it. I
> want to visualise my matrix something like this image:
>
> snipped
>

[[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] Error nmf - Input matrix x contains at least one null or NA-filled row

2016-06-10 Thread Ragia .
  Dear group,
  kindly I am trying to factorize document term matrix via NMF and got the 
following Error 
show up

Error: NMF::nmf - 2/2 fit(s) threw an error.
# Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains at least one null or NA-filled 
row.

when I partition the matrix it works till I reached the last 10 rows ..they 
have a problem that I do not know

the fitting line is   fit<-nmf((dtmm[90:100,]), 4, "lee", nrun=2) 
And
the matrix is 100 row ..so the last 10 rows that make the problem are as 
follows:
dtm.sample <- dput(dtmm[90:100,])
structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 

Re: [R] summing up a column.

2016-06-10 Thread oslo via R-help
Jeff;
 thanks for this. My question was job related. No from my course. I need finish 
a job for the place I work. I am so sorry for causing misunderstanding.
thanks,
Oslo 

On Friday, June 10, 2016 5:08 PM, oslo via R-help  
wrote:
 

 Jeff thanks for this. My question was job related. No from my course. I need 
finish a job for the place I work. I am so sorry for causing misunderstanding.
thanks,
Oslo 

    On Friday, June 10, 2016 5:02 PM, Jeff Newmiller  
wrote:
 

 Multiple posting happens when you are learning a new system, but reading the 
posting guide can keep the bleeding down. 

1) There is a no-homework policy on this list... different educational 
organizations have different standards for what is acceptable outside help, so 
you should be using the support offered by your instructor or educational 
institution. 

2) Once you have completed your course, you CAN learn to post data with your 
code so that it is self-contained... that is, reproducible on our vanilla R 
session. Using the dput function is one excellent strategy. 

3) This is not a problem that needs a loop... as Bert (not Bret) said, you can 
do this in one or two statements if you simply use basic logical indexing. If 
your instructor wants you to do it with a loop for sine reason then you really 
really should not be here... you should be talking to him/her.
-- 
Sent from my phone. Please excuse my brevity.

On June 10, 2016 1:34:03 PM PDT, oslo via R-help  wrote:
Dear All;
I had difficulty to post a mail along with appropriate of data structure. I do 
sincerely apologize for multiple posting


I would like to sum up the B$a column and cut off at 0.7 for the each row of 
intervals giving in file=A.For example the interval  at the first row in A$posA 
and A$posB is 1 and 9. So, I need adding up the B$a and cut off B$a>.7 from the 
1 to 9 in B$pos. And then I need to the same using the intervals in the second, 
third. rows in A. Obviously my loop is wrong and  does not work properly. 
Please help for my this first experience.  Regards
Here are my codes
#sorting B$possort=B[order(B$pos),]
#Running loop
for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }
Reply, R
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.

  
[[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] summing up a column.

2016-06-10 Thread oslo via R-help
Jeff thanks for this. My question was job related. No from my course. I need 
finish a job for the place I work. I am so sorry for causing misunderstanding.
thanks,
Oslo 

On Friday, June 10, 2016 5:02 PM, Jeff Newmiller  
wrote:
 

 Multiple posting happens when you are learning a new system, but reading the 
posting guide can keep the bleeding down. 

1) There is a no-homework policy on this list... different educational 
organizations have different standards for what is acceptable outside help, so 
you should be using the support offered by your instructor or educational 
institution. 

2) Once you have completed your course, you CAN learn to post data with your 
code so that it is self-contained... that is, reproducible on our vanilla R 
session. Using the dput function is one excellent strategy. 

3) This is not a problem that needs a loop... as Bert (not Bret) said, you can 
do this in one or two statements if you simply use basic logical indexing. If 
your instructor wants you to do it with a loop for sine reason then you really 
really should not be here... you should be talking to him/her.
-- 
Sent from my phone. Please excuse my brevity.

On June 10, 2016 1:34:03 PM PDT, oslo via R-help  wrote:
Dear All;
I had difficulty to post a mail along with appropriate of data structure. I do 
sincerely apologize for multiple posting


I would like to sum up the B$a column and cut off at 0.7 for the each row of 
intervals giving in file=A.For example the interval  at the first row in A$posA 
and A$posB is 1 and 9. So, I need adding up the B$a and cut off B$a>.7 from the 
1 to 9 in B$pos. And then I need to the same using the intervals in the second, 
third. rows in A. Obviously my loop is wrong and  does not work properly. 
Please help for my this first experience.  Regards
Here are my codes
#sorting B$possort=B[order(B$pos),]
#Running loop
for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }
Reply, R
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] summing up a column.

2016-06-10 Thread Jeff Newmiller
Multiple posting happens when you are learning a new system, but reading the 
posting guide can keep the bleeding down. 

1) There is a no-homework policy on this list... different educational 
organizations have different standards for what is acceptable outside help, so 
you should be using the support offered by your instructor or educational 
institution. 

2) Once you have completed your course,  you CAN learn to post data with your 
code so that it is self-contained... that is,  reproducible on our vanilla R 
session. Using the dput function is one excellent strategy. 

3) This is not a problem that needs a loop... as Bert (not Bret) said, you can 
do this in one or two statements if you simply use basic logical indexing. If 
your instructor wants you to do it with a loop for sine reason then you really 
really should not be here... you should be talking to him/her.
-- 
Sent from my phone. Please excuse my brevity.

On June 10, 2016 1:34:03 PM PDT, oslo via R-help  wrote:
>Dear All;
>I had difficulty to post a mail along with appropriate of data
>structure. I do sincerely apologize for multiple posting
>
>
>I would like to sum up the B$a column and cut off at 0.7 for the each
>row of intervals giving in file=A.For example the interval  at the
>first row in A$posA and A$posB is 1 and 9. So, I need adding up the B$a
>and cut off B$a>.7 from the 1 to 9 in B$pos. And then I need to the
>same using the intervals in the second, third. rows in A. Obviously
>my loop is wrong and  does not work properly. Please help for my this
>first experience.  Regards
>Here are my codes
>#sorting B$possort=B[order(B$pos),]
>#Running loop
>for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }
>Reply, R
>
>
>
>__
>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] summing up a column.

2016-06-10 Thread oslo via R-help
Dear All;
I had difficulty to post a mail along with appropriate of data structure. I do 
sincerely apologize for multiple posting


I would like to sum up the B$a column and cut off at 0.7 for the each row of 
intervals giving in file=A.For example the interval  at the first row in A$posA 
and A$posB is 1 and 9. So, I need adding up the B$a and cut off B$a>.7 from the 
1 to 9 in B$pos. And then I need to the same using the intervals in the second, 
third. rows in A. Obviously my loop is wrong and  does not work properly. 
Please help for my this first experience.  Regards
Here are my codes
#sorting B$possort=B[order(B$pos),]
#Running loop
for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }
Reply, R__
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] summing up and cut off with looping

2016-06-10 Thread oslo via R-help
Hi Brent;
I do appreciate for your helps and advice. I already registered online to learn 
R. Today my second day. I think I could not explain my problem precisely. I 
have two file called A and B. A has to columns say posA and posB the values of 
the first row in A are 1 and 9, and the values of the second row in A 2 and 7. 
In file B however I have pos, a, b,c columns, for example.                      
          pos a   b     c The first row of                  B    4     0.4    
0.80the second column of the B     2     0.1   0.40
The third column of          B    13    0.5    0.32 
So I would like to sum up the B$a column and cut off at 0.7 for the each row of 
intervals giving in file=A.  Once again thanks so much.
regards,
Oslo
Here are my codes
#sorting B$possort=B[order(B$pos),]
#Running loop
for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }

On Friday, June 10, 2016 3:44 PM, Bert Gunter  
wrote:
 

 1. Please read the posting guide (link below) to learn how to post
understandable questions -- at least I was not able to understand. In
particular, post in plain text, not html, which tends to get mangled
as seemed to occur here.

2. Your first stop in learning R should be one of the many fine
tutorials available on the web or even the "Intro to R" tutorial that
ships with R.  In particular, indexing in R using logical expressions
appears relevant to your query. Here is an example of what can be done
along the lines that I think you asked about -- hope it helps.
Apologies if I have misunderstood. See also ?subset and ?cumsum .


> set.seed(1021)

> y <- runif(10)

> y
 [1] 0.36751828 0.08721951 0.08899027 0.38838635 0.1978 0.72948251
 [7] 0.36669151 0.28457792 0.90614056 0.31832515

> y[cumsum(y) < 1.2]
[1] 0.36751828 0.08721951 0.08899027 0.38838635


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 Fri, Jun 10, 2016 at 12:27 PM, oslo via R-help  wrote:
> Hi all;
> I am quite new in R. I have tried write a loop to sum up a column and cut off 
> when summation reach certain point. Here are a small example and my R codes.
> Your helps are truly appreciated,
> Oslo
> file=AposA posB1    92    75    124    79    13.    . .    .
> File=Bpos  a  b  c    4  .4  7  .82  .1  5  .47  .5  8  .321  .4  1  .113  .1 
>  6  .1312  .2  11 .019  .3  12 .23.    .  .  ..    .  .  .
> I would like to sum up the B$a column and cut off at 0.7 for the each row of 
> intervals giving in file=A.For example the interval  at the first row in 
> A$posA and A$posB is 1 and 9. So, I need adding up the B$a and cut off B$a>.7 
> from the 1 to 9 in B$pos. And then I need to the same using the intervals in 
> the second, third. rows in A. Obviously my loop is wrong and  does not 
> work properly. Please help for my this first experience.  Thanks.
> Here are my codes
> #sorting B$possort=B[order(B$pos),]
> #Running loop
> for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }
>
>        [[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] summing up and cut off with looping

2016-06-10 Thread Bert Gunter
1. Please read the posting guide (link below) to learn how to post
understandable questions -- at least I was not able to understand. In
particular, post in plain text, not html, which tends to get mangled
as seemed to occur here.

2. Your first stop in learning R should be one of the many fine
tutorials available on the web or even the "Intro to R" tutorial that
ships with R.  In particular, indexing in R using logical expressions
appears relevant to your query. Here is an example of what can be done
along the lines that I think you asked about -- hope it helps.
Apologies if I have misunderstood. See also ?subset and ?cumsum .


> set.seed(1021)

> y <- runif(10)

> y
 [1] 0.36751828 0.08721951 0.08899027 0.38838635 0.1978 0.72948251
 [7] 0.36669151 0.28457792 0.90614056 0.31832515

> y[cumsum(y) < 1.2]
[1] 0.36751828 0.08721951 0.08899027 0.38838635


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 Fri, Jun 10, 2016 at 12:27 PM, oslo via R-help  wrote:
> Hi all;
> I am quite new in R. I have tried write a loop to sum up a column and cut off 
> when summation reach certain point. Here are a small example and my R codes.
> Your helps are truly appreciated,
> Oslo
> file=AposA posB1 92 75 124 79 13.. ..
> File=Bpos  a  b   c4   .4  7  .82   .1  5  .47  .5  8  .321   .4  1  .113 
>  .1  6  .1312  .2  11 .019   .3  12 .23..   .  ...   .  .
> I would like to sum up the B$a column and cut off at 0.7 for the each row of 
> intervals giving in file=A.For example the interval  at the first row in 
> A$posA and A$posB is 1 and 9. So, I need adding up the B$a and cut off B$a>.7 
> from the 1 to 9 in B$pos. And then I need to the same using the intervals in 
> the second, third. rows in A. Obviously my loop is wrong and  does not 
> work properly. Please help for my this first experience.  Thanks.
> Here are my codes
> #sorting B$possort=B[order(B$pos),]
> #Running loop
> for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

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


[R] Fw: summing up and cut off with looping

2016-06-10 Thread oslo via R-help
I am so sorry that the data in my previous file was very mass;Here are my data 
sets
> A  posA posB1    1    92    2    73    5   124    4    75    9   13> 
  pos   a  b    c1   4 0.4  7 0.802   2 0.1  5 0.403   7 0.5  8 0.324   1 0.4  
1 0.105  13 0.1  6 0.136  12 0.2 11 0.017   9 0.3 12 0.23> 
 Hi all;
I am quite new in R. I have tried write a loop to sum up a column and cut off 
when summation reach certain point. Here are a small example and my R codes.
Your helps are truly appreciated,
Oslo

I would like to sum up the B$a column and cut off at 0.7 for the each row of 
intervals giving in file=A.For example the interval  at the first row in A$posA 
and A$posB is 1 and 9. So, I need adding up the B$a and cut off B$a>.7 from the 
1 to 9 in B$pos. And then I need to the same using the intervals in the second, 
third. rows in A. Obviously my loop is wrong and  does not work properly. 
Please help for my this first experience.  Thanks.

Here are my codes
#sorting B$possort=B[order(B$pos),]
#Running loop
for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }

    [[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] summing up and cut off with looping

2016-06-10 Thread oslo via R-help
Hi all;
I am quite new in R. I have tried write a loop to sum up a column and cut off 
when summation reach certain point. Here are a small example and my R codes.
Your helps are truly appreciated,
Oslo
file=AposA posB1     92     75     124     79     13.    . .    .   
File=Bpos  a  b   c    4   .4  7  .82   .1  5  .47  .5  8  .321   .4  1  .113  
.1  6  .1312  .2  11 .019   .3  12 .23.    .   .  ..    .   .  .
I would like to sum up the B$a column and cut off at 0.7 for the each row of 
intervals giving in file=A.For example the interval  at the first row in A$posA 
and A$posB is 1 and 9. So, I need adding up the B$a and cut off B$a>.7 from the 
1 to 9 in B$pos. And then I need to the same using the intervals in the second, 
third. rows in A. Obviously my loop is wrong and  does not work properly. 
Please help for my this first experience.  Thanks.
Here are my codes
#sorting B$possort=B[order(B$pos),]
#Running loop
for(i in 1:nrow(A)) {if(sum(B[a$B, i:A[1:2])>0.7) {print(A[1:i,]) } }

[[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] Visualize Sparse Matrix.

2016-06-10 Thread FRANCISCO XAVIER SUMBA TORAL
Hi Jim,

Thanks for your answer. 

I try your code example, but it is basically the same that I had it. I want to 
visualise my matrix something like this image: 




With the graphics that I already have is difficult to visualise my data. I am 
getting this results:

1) With my first code, I got this:



2) With Jim’s code. I got this: 



Ho can I make my graphs more observable as in the first figure? My graphs shows 
points as if my screen was dirty. 

Cheers.



> On Jun 10, 2016, at 04:39, Jim Lemon  wrote:
> 
> Hi Francisco,
> I tried this just to see if it would work. It did, after a while.
> 
> wtmat<-matrix(rnorm(4602*1817),nrow=4602)
> library(plotrix)
> x11(width=5,height=13)
> color2D.matplot(wtmat,c(1,1,0),c(0,1,0),0,border=FALSE)
> 
> Jim
> 
> On Fri, Jun 10, 2016 at 8:27 AM, FRANCISCO XAVIER SUMBA TORAL
>  wrote:
>> Hi,
>> 
>> First of all, sorry for my question it could be so basic for a common user 
>> in R, but I am starting with this new environment.
>> 
>> I have done a clustering job and I would like to visualize my vectors. I 
>> have a matrix of TF-IDF weights of 4602 x 1817. I store the values in a CSV 
>> file. How can I visualize my vectors in a 2D-space?
>> 
>> After that, I execute a clustering algorithm and I got a label for each 
>> cluster. How can I visualize my vectors resulting base on a color or figure 
>> for each cluster?
>> 
>> This is the code that I am having trying to accomplish my graphs:
>> 
>> data <- read.csv(pathFile,header = FALSE, sep = ",”)
>> dMatrix <- matrix(unlist(data), ncol = 4602, byrow = TRUE) # Use a matrix to 
>> use melt.
>> # Graph my data
>> ggplot(melt(dMatrix), aes(Var1,Var2, fill=value)) + geom_raster() + 
>> scale_fill_gradient2(low='red', high=‘black', mid=‘white') + theme_bw() + 
>> xlab("x1") + ylab("x2")
>> 
>> 
>> Cheers.
>>[[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] New installation

2016-06-10 Thread John Dougherty
On Thu, 9 Jun 2016 13:44:52 -0700
jax200  wrote:

> Hi
> 
> I'm starting off with both R and Linux Mint.  During a recent R
> course, I had multiple difficulties with installing updates needed
> for the course.
> 
> As such, I'd like to hit the restart button with fresh installs of
> Linux and R.  I would appreciate your help with which Linux platform
> works best with R, and how to go about getting all the updates
> installed for both programs.
> 
> Many thanks,  Jack
> 
Any Linux distribution is likely to work well with R.  The chief hick-up
is keeping you R release up to date.  Typical linux releases including
Ubuntu, Opensuse and Fedora R versions available through their system
updates all tend to lag behind the R release version available on CRAN.
Asking for help will inevitably result in responders asking about the R
version you used, and, if it is significantly older than the current
version, you will be asked to update R and retry your problem
procedure.  That means that you will probably want to handle updating R
manually to remain current rather than rely on the Linux release
updating system.

JDougherty

__
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] Merging two data frame with different lengths

2016-06-10 Thread Abraham Mathew
So I have two data frames.

The first one is a reccomendation data frame and the second is a melted
list with a pairing of OpportunityId's and ProductId's. There are multiple
product id's per an opportunty id. What I want to do is merge based on
ProductId so that I can add the OpportunityId to the reccomendation data
frame.

> head(product_neighbours_orig[,1:3],2)   ProductId   Reccomendation_1  
>  Reccomendation_2
1 01t3001ik30AAA 01ta005SivAAAS 01ta005RQimAAG
2 01t3001ik3vAAA 01t3001ik5bAAA 01t3001ikKPAAY>
head(pd_melt[,1:3],2)  OpportunityId  ProductId value
4826 006300bqUKlAAM 01t3001ik3vAAA 0
9651 006300bqUKlAAM 01t3001ik41AAA 0





Any suggestions?

-- 


*Abraham MathewData Ninja and Statistical Modeler*



*Minneapolis, MN720-648-0108@abmathewksAnalytics_Blog
*

[[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] New installation

2016-06-10 Thread Leonardo Fontenelle
Em Sex 10 jun. 2016, às 03:58, Rainer M Krug escreveu:
> Clint Bowman  writes:
> 
> I am really wondering, why nobody mentioned Ubuntu so far?
> 
> Ubuntu is a really nice distro, I never had problems with it, many
> programs are available for Ubuntu, and it is build on Debian
> (stable). Don't worry about Unity Window manager - there are many other
> options available (Xubuntu being one of the better known ones - Ubuntu
> just packed with a different Windows Manager).
> 
> If you are new to Linux, I would really suggest Ubuntu.

I believe any major Linux distribution will provide decent support for
R, and I agree there are plenty of reasons for preferring Ubuntu or
other Linux distributions over Arch Linux. The reason why I suggested
Arch Linux was how up to date the package is, because that was the
motivation of the original post.

R 3.3.0 was released by the R Core Team on 2016-05-03, and on 2016-05-04
it was available in Arch Linux's "testing" repository. On 2016-05-17,
after at least one week with no (packaging) bug reports, the package was
moved to the "extra". This is the usual rhythm. Don't be fooled by the
repository name, it is the repository for popular software like Firefox,
GNOME and LibreOffice, and it is maintained by official Arch Linux
developers / package maintainers. 

Hope that helps,

Leonardo Ferreira Fontenelle

__
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] create an empty data frame and then fill in it (and then evaluate the mean of semi-hourly data for each day)

2016-06-10 Thread William Dunlap via R-help
Finally I applied lapply in this way:
df_snow_day$snow <- lapply(df_snow_day$day, function(x)
round(mean(df_snow$snow[df_snow$day == x], na.rm=T))

This does not work. I do not understand why the class of df_snow_day$snow
is of type list either:


lapply()'s output is always a list.

I first created a new column of type "Date"
df_snow$day <- as.Date(df_snow$data_POSIX,"%Y-%m-%d")

If 'date_POSIX' is of class "POSIXct" that line gives a warning because
the second argument to as.Data.POSIXct is the time zone ('tz').
Perhaps your data_POSIX column is really character.  I made my df_snow
as follows:

txt <- c("data_POSIX\tsnow",
  "2004-11-01 00:00:00\t50",
  "2004-11-01 00:30:00\t55",
 "2004-11-01 01:00:00\t60")
df_snow <- read.table(sep="\t", text=txt,header=TRUE,
colClasses=c("POSIXct","numeric"))
str(df_snow)
'data.frame':   3 obs. of  2 variables:
 $ data_POSIX: POSIXct, format: "2004-11-01 00:00:00" ...
 $ snow  : num  50 55 60

and as.Date gave:
   > as.Date(df_snow$data_POSIX,"%Y-%m-%d")
   [1] "2004-11-01" "2004-11-01" "2004-11-01"
   Warning message:
   In as.POSIXlt.POSIXct(x, tz = tz) : unknown timezone '%Y-%m-%d'

Also, converting POSIXct objects to Date objects is usually the wrong
thing to do, as the time zone in the POSIXct object is ignored (I think UTC
is assumed):
  > ct <- as.POSIXct(sprintf("2016-%02d-%02d %02d:%02d", 2:5, 22:25, 15:18,
45:48), tz="US/Pacific")
  > data.frame(ct,as.Date(ct)) # note day-of-month mismatches
 ct as.Date.ct.
  1 2016-02-22 15:45:00  2016-02-22
  2 2016-03-23 16:46:00  2016-03-23
  3 2016-04-24 17:47:00  2016-04-25
  4 2016-05-25 18:48:00  2016-05-26
You can convert to a POSIXlt object and pull out the day-of-month
or day-of-year
  > as.POSIXlt(ct)$mday
  [1] 22 23 24 25
  > as.POSIXlt(ct)$yday
  [1]  52  82 114 145
I can never remember which helper functions are available
for this sort of thing.  Many people like the ones in the lubridate
package.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Fri, Jun 10, 2016 at 3:45 AM, Stefano Sofia <
stefano.so...@regione.marche.it> wrote:

> Thank you for your answer. Very clear.
> (I don't like the second solution either.)
> Let me then ask a final question.
> From an initial data frame with semi-hourly data (df_snow, with two
> columns, data_POSIX of type "POSIXct" "POSIXt" and snow of type "numeric"),
> I need to evaluate the mean of for each day.
>
> data_POSIX snow
> 2004-11-01 00:00:00 50
> 2004-11-01 00:30:00 55
> 2004-11-01 01:00:00 60
> ...
>
> I first created a new column of type "Date"
> df_snow$day <- as.Date(df_snow$data_POSIX,"%Y-%m-%d")
>
> then I created a new data frame called df_snow_day to store the mean of
> data grouped by day:
> list_days <- unique(df_snow$day)
> df_snow_day <- data.frame(day=list_days)
>
> Finally I applied lapply in this way:
> df_snow_day$snow <- lapply(df_snow_day$day, function(x)
> round(mean(df_snow$snow[df_snow$day == x], na.rm=T)))
>
> This does not work. I do not understand why the class of df_snow_day$snow
> is of type list either:
>
>day snow
> NA   NULL
> NA.1 NULL
> NA.2 NULL
>
> Where is my mistake?
>
> Thank you for all your help
> Stefano
>
>
> _
>
> Da: Duncan Murdoch [murdoch.dun...@gmail.com]
> Inviato: giovedì 9 giugno 2016 12.36
> A: Stefano Sofia; r-help@r-project.org
> Oggetto: Re: [R] create an empty data frame and then fill in it
>
> On 09/06/2016 6:22 AM, Stefano Sofia wrote:
> > Dear R list users,
> > sorry for this simple question, but I already spent many efforts to
> solve it.
> >
> > I create an empty data frame called df_year like
> >
> > df_year <- data.frame(day=as.Date(character()), hs_MteBove=integer(),
> hs_MtePrata=integer(), hs_Pintura=integer(), hs_Pizzo=integer(),
> hs_Sassotetto=integer(), hs_Sibilla=integer(), stringsAsFactors=FALSE)
> >
> > and then I start to fill in it with
> >
> > df_year$day <- seq(as.Date("2004-11-01-00-00","%Y-%m-%d"),
> as.Date("2005-05-01-00-00","%Y-%m-%d"), by="day")
> >
> > but I get the following error:
> > "replacement has 182 rows, data has 0"
> >
> > Where is my silly mistake?
>
> Your dataframe has 0 rows, so you can't put a 182 row vector into the
> first column.
>
> Unlike vectors, dataframes won't grow if you make assignments beyond the
> end of the rows.
>
> There are at least a couple of solutions:
>
> 1.  Don't create columns until you have data ready for them.
>
> You can wait to create the dataframe until your "day" column is ready:
>
> df_year <- data.frame(day = seq(...))
>
> As you compute other columns of the same length, you can add them, e.g.
>
> df_year$hs_MteBove <- ...
>
> 2.  Create your columns with the right length from the beginning:
>
> df_year <- data.frame(day = rep(as.Date(NA), 182), ...)
>
> I don't like this solution as much.
>
> Duncan Murdoch
>
>
> 
>
> AVVISO IMPORTANTE: Questo messaggio di posta elettronica può contenere

Re: [R] save rgl.sphere plot

2016-06-10 Thread David Winsemius
http://stackoverflow.com/questions/7663982/r-using-rgl-to-generate-3d-rotatable-plots-that-can-be-viewed-in-a-web-browser

Sent from my iPhone

> On Jun 10, 2016, at 9:14 AM, ch.elahe via R-help  wrote:
> 
> Hi all 
> I have generated a 3D interactive rgl.sphere but I don't know how to save it 
> to be viewed also interactive(being able to rotate it and do zoom-in and 
> out). Does anyone know how should I save it?
> Thanks for any help!
> Elahe
> 
> __
> 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] save rgl.sphere plot

2016-06-10 Thread Duncan Murdoch

On 10/06/2016 9:14 AM, ch.elahe via R-help wrote:

Hi all
I have generated a 3D interactive rgl.sphere but I don't know how to save it to 
be viewed also interactive(being able to rotate it and do zoom-in and out). 
Does anyone know how should I save it?
Thanks for any help!


I'd recommend using knitr and rglwidget.  For example, put this in 
example.Rmd:




---
title: "Example"
author: "Duncan Murdoch"
date: "June 10, 2016"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r}
options(rgl.useNULL = TRUE)
library(rgl)
library(rglwidget)
xyz <- matrix(rnorm(30), ncol = 3)
spheres3d(xyz, col = 1:10)
rglwidget()
```


and then in RStudio, click on "knit HTML".  If you don't use RStudio, 
you can run


rmarkdown::render("example.Rmd")

and then view the "example.html" file in your browser.

Duncan Murdoch

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


Re: [R] About identification of CRAN CHECK machines in logs

2016-06-10 Thread Marcelo Perlin
I don't know Hadley. But you can see evidence of "something" systematically
installing the packages in the log data. From my two CRAN packages I
noticed a high correlation in the number of downloads.

Try the following script, which will pick 5 random packages from CRAN and
calculate the correlation matrix between their differenced number of
downloads. To avoid spurious correlations,  I removed the weekends since we
can expect some seasonality and also the zero entries. Its crude, I know,
but it does shows some positive associations between the number of
installations of the packages.

If not CRAN, who/what is downloading this packages and how can I set it
apart from the actual user installations?

Many thanks!


# get packages
df <- as.data.frame(available.packages())

# choose 5 random
idx <- sample(seq(nrow(df)))[1:5]
df<- df[idx,]

my.pkgs <- as.character(df$Package)

#my.pkgs <- c('RndTexExams','GetTDData')

dl.df <- cranlogs::cran_downloads(my.pkgs, from = '2015-01-01', to =
Sys.Date())

# remove zeros entries
dl.df$count[dl.df$count==0] <- NA

# remove weekends
dl.df$sat.sun <- as.POSIXlt(dl.df$date)$wday
dl.df <- dplyr::filter(dl.df, sat.sun != 0, sat.sun != 6)

# to wide (for corr)
dl.df <- tidyr::spread(dl.df, key = package,value = count)

# remove na
dl.df <- dl.df[complete.cases(dl.df), ]

diff.mat <- diff(as.matrix(dl.df[,3:ncol(dl.df)]))
cor(diff.mat)

___

On Thu, Jun 9, 2016 at 6:18 PM, Hadley Wickham  wrote:

> On Thu, Jun 9, 2016 at 9:24 AM, Marcelo Perlin 
> wrote:
> > Hi,
> >
> > I recently released two packages (RndTexExams and GetTDData) in CRAN and
> > I'm trying to track the number of downloads and location of users.
> >
> > I wrote a simple script to download and analyze the log files in
> http://cran
> > -logs.rstudio.com.
> > I realized, however, that during the release of a new version of the
> > packages there is a spike in the number of downloads. I believe that the
> > CRAN checks are included in the number of installations of the package in
> > the log files.
>
> I don't think that's true. Why would CRAN be installing the package
> from a mirror?
>
> Hadley
>
> --
> http://hadley.nz
>



-- 
Marcelo Perlin
Professor Adjunto | Escola de Administração
Universidade Federal do Rio Grande do Sul
Rua Washington Luiz, 855 | 90010-460| Porto Alegre RS| Brasil
Tel.: (51) 3308-3303 | www.ea.ufrgs.br
http://lattes.cnpq.br/3262699324398819
https://sites.google.com/site/marceloperlin/

[[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] New installation

2016-06-10 Thread Jeff Newmiller
Re this thread: Please stop with the "my favorite Linux" messages. If you have 
concrete direction as to why R is well supported (preferably links to detailed 
instructions), that could be construed as "R-help", but "I like it" is unlikely 
to be useful to an inexperienced user.
-- 
Sent from my phone. Please excuse my brevity.

On June 10, 2016 6:33:37 AM PDT, ce  wrote:
>I use opensuse linux with R , no problems, easy to install, added R
>repositories . 
>
>-Original Message-
>From: "jax200" [jax...@gmail.com]
>Date: 06/09/2016 06:00 PM
>To: r-help@r-project.org
>Subject: [R] New installation
>
>Hi
>
>I'm starting off with both R and Linux Mint.  During a recent R course,
>I
>had multiple difficulties with installing updates needed for the
>course.
>
>As such, I'd like to hit the restart button with fresh installs of
>Linux
>and R.  I would appreciate your help with which Linux platform works
>best
>with R, and how to go about getting all the updates installed for both
>programs.
>
>Many thanks,  Jack
>
>   [[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.

[[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] New installation

2016-06-10 Thread ce
I use opensuse linux with R , no problems, easy to install, added R 
repositories . 

-Original Message-
From: "jax200" [jax...@gmail.com]
Date: 06/09/2016 06:00 PM
To: r-help@r-project.org
Subject: [R] New installation

Hi

I'm starting off with both R and Linux Mint.  During a recent R course, I
had multiple difficulties with installing updates needed for the course.

As such, I'd like to hit the restart button with fresh installs of Linux
and R.  I would appreciate your help with which Linux platform works best
with R, and how to go about getting all the updates installed for both
programs.

Many thanks,  Jack

[[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] About identification of CRAN CHECK machines in logs

2016-06-10 Thread Hadley Wickham
On Fri, Jun 10, 2016 at 8:27 AM, Marcelo Perlin  wrote:
> I don't know Hadley. But you can see evidence of "something" systematically
> installing the packages in the log data. From my two CRAN packages I noticed
> a high correlation in the number of downloads.
>
> Try the following script, which will pick 5 random packages from CRAN and
> calculate the correlation matrix between their differenced number of
> downloads. To avoid spurious correlations,  I removed the weekends since we
> can expect some seasonality and also the zero entries. Its crude, I know,
> but it does shows some positive associations between the number of
> installations of the packages.

Which is not at all surprising:

* there are very strong seasonal patterns
* there are big jumps after releases of new versions of R
* some people like to have all packages installed locally

This is an intrinsic problem with download data. There's no way to
tell if a downloader is really using your package or not.

Hadley

-- 
http://hadley.nz

__
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] save rgl.sphere plot

2016-06-10 Thread ch.elahe via R-help
Hi all 
I have generated a 3D interactive rgl.sphere but I don't know how to save it to 
be viewed also interactive(being able to rotate it and do zoom-in and out). 
Does anyone know how should I save it?
Thanks for any help!
Elahe

__
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] create an empty data frame and then fill in it (and then evaluate the mean of semi-hourly data for each day)

2016-06-10 Thread Duncan Murdoch

On 10/06/2016 6:45 AM, Stefano Sofia wrote:

Thank you for your answer. Very clear.
(I don't like the second solution either.)
Let me then ask a final question.
From an initial data frame with semi-hourly data (df_snow, with two columns, data_POSIX of type 
"POSIXct" "POSIXt" and snow of type "numeric"), I need to evaluate the mean of 
for each day.

data_POSIX snow
2004-11-01 00:00:00 50
2004-11-01 00:30:00 55
2004-11-01 01:00:00 60
...

I first created a new column of type "Date"
df_snow$day <- as.Date(df_snow$data_POSIX,"%Y-%m-%d")

then I created a new data frame called df_snow_day to store the mean of data 
grouped by day:
list_days <- unique(df_snow$day)
df_snow_day <- data.frame(day=list_days)

Finally I applied lapply in this way:
df_snow_day$snow <- lapply(df_snow_day$day, function(x) 
round(mean(df_snow$snow[df_snow$day == x], na.rm=T)))

This does not work. I do not understand why the class of df_snow_day$snow is of 
type list either:


lapply() returns a list.  Petr's solution is probably better, but you 
could likely get what you want using vapply() instead:


df_snow_day$snow <- vapply(df_snow_day$day, function(x) 
round(mean(df_snow$snow[df_snow$day == x], na.rm=T)), 0)


The 0 at the end is an example of the numeric function result you want, 
so that vapply() knows to create a numeric vector.


Duncan Murdoch



   day snow
NA   NULL
NA.1 NULL
NA.2 NULL

Where is my mistake?

Thank you for all your help
Stefano


_

Da: Duncan Murdoch [murdoch.dun...@gmail.com]
Inviato: giovedì 9 giugno 2016 12.36
A: Stefano Sofia; r-help@r-project.org
Oggetto: Re: [R] create an empty data frame and then fill in it

On 09/06/2016 6:22 AM, Stefano Sofia wrote:

Dear R list users,
sorry for this simple question, but I already spent many efforts to solve it.

I create an empty data frame called df_year like

df_year <- data.frame(day=as.Date(character()), hs_MteBove=integer(), 
hs_MtePrata=integer(), hs_Pintura=integer(), hs_Pizzo=integer(), 
hs_Sassotetto=integer(), hs_Sibilla=integer(), stringsAsFactors=FALSE)

and then I start to fill in it with

df_year$day <- seq(as.Date("2004-11-01-00-00","%Y-%m-%d"), 
as.Date("2005-05-01-00-00","%Y-%m-%d"), by="day")

but I get the following error:
"replacement has 182 rows, data has 0"

Where is my silly mistake?


Your dataframe has 0 rows, so you can't put a 182 row vector into the
first column.

Unlike vectors, dataframes won't grow if you make assignments beyond the
end of the rows.

There are at least a couple of solutions:

1.  Don't create columns until you have data ready for them.

You can wait to create the dataframe until your "day" column is ready:

df_year <- data.frame(day = seq(...))

As you compute other columns of the same length, you can add them, e.g.

df_year$hs_MteBove <- ...

2.  Create your columns with the right length from the beginning:

df_year <- data.frame(day = rep(as.Date(NA), 182), ...)

I don't like this solution as much.

Duncan Murdoch




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.



__
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] create an empty data frame and then fill in it (and then evaluate the mean of semi-hourly data for each day)

2016-06-10 Thread PIKAL Petr
Hi Sofia

df_snow_day  <- aggregate(df_snow$snow, list(df_snow$day), mean, na.rm=TRUE)

should give you automagically required data frame.

Regards
Petr

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Stefano
> Sofia
> Sent: Friday, June 10, 2016 12:46 PM
> To: Duncan Murdoch ; r-help@r-project.org
> Subject: Re: [R] create an empty data frame and then fill in it (and then
> evaluate the mean of semi-hourly data for each day)
>
> Thank you for your answer. Very clear.
> (I don't like the second solution either.) Let me then ask a final question.
> From an initial data frame with semi-hourly data (df_snow, with two
> columns, data_POSIX of type "POSIXct" "POSIXt" and snow of type
> "numeric"), I need to evaluate the mean of for each day.
>
> data_POSIX snow
> 2004-11-01 00:00:00 50
> 2004-11-01 00:30:00 55
> 2004-11-01 01:00:00 60
> ...
>
> I first created a new column of type "Date"
> df_snow$day <- as.Date(df_snow$data_POSIX,"%Y-%m-%d")
>
> then I created a new data frame called df_snow_day to store the mean of
> data grouped by day:
> list_days <- unique(df_snow$day)
> df_snow_day <- data.frame(day=list_days)
>
> Finally I applied lapply in this way:
> df_snow_day$snow <- lapply(df_snow_day$day, function(x)
> round(mean(df_snow$snow[df_snow$day == x], na.rm=T)))
>
> This does not work. I do not understand why the class of df_snow_day$snow
> is of type list either:
>
>day snow
> NA   NULL
> NA.1 NULL
> NA.2 NULL
>
> Where is my mistake?
>
> Thank you for all your help
> Stefano
>
>
> _
>
> Da: Duncan Murdoch [murdoch.dun...@gmail.com]
> Inviato: giovedì 9 giugno 2016 12.36
> A: Stefano Sofia; r-help@r-project.org
> Oggetto: Re: [R] create an empty data frame and then fill in it
>
> On 09/06/2016 6:22 AM, Stefano Sofia wrote:
> > Dear R list users,
> > sorry for this simple question, but I already spent many efforts to solve 
> > it.
> >
> > I create an empty data frame called df_year like
> >
> > df_year <- data.frame(day=as.Date(character()), hs_MteBove=integer(),
> > hs_MtePrata=integer(), hs_Pintura=integer(), hs_Pizzo=integer(),
> > hs_Sassotetto=integer(), hs_Sibilla=integer(), stringsAsFactors=FALSE)
> >
> > and then I start to fill in it with
> >
> > df_year$day <- seq(as.Date("2004-11-01-00-00","%Y-%m-%d"),
> > as.Date("2005-05-01-00-00","%Y-%m-%d"), by="day")
> >
> > but I get the following error:
> > "replacement has 182 rows, data has 0"
> >
> > Where is my silly mistake?
>
> Your dataframe has 0 rows, so you can't put a 182 row vector into the first
> column.
>
> Unlike vectors, dataframes won't grow if you make assignments beyond the
> end of the rows.
>
> There are at least a couple of solutions:
>
> 1.  Don't create columns until you have data ready for them.
>
> You can wait to create the dataframe until your "day" column is ready:
>
> df_year <- data.frame(day = seq(...))
>
> As you compute other columns of the same length, you can add them, e.g.
>
> df_year$hs_MteBove <- ...
>
> 2.  Create your columns with the right length from the beginning:
>
> df_year <- data.frame(day = rep(as.Date(NA), 182), ...)
>
> I don't like this solution as much.
>
> Duncan Murdoch
>
>
> 
>
> 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.
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.


Tento e-mail a jakékoliv k němu připojené 

Re: [R] create an empty data frame and then fill in it (and then evaluate the mean of semi-hourly data for each day)

2016-06-10 Thread Stefano Sofia
Thank you for your answer. Very clear.
(I don't like the second solution either.)
Let me then ask a final question.
From an initial data frame with semi-hourly data (df_snow, with two columns, 
data_POSIX of type "POSIXct" "POSIXt" and snow of type "numeric"), I need to 
evaluate the mean of for each day.

data_POSIX snow
2004-11-01 00:00:00 50
2004-11-01 00:30:00 55
2004-11-01 01:00:00 60
...

I first created a new column of type "Date"
df_snow$day <- as.Date(df_snow$data_POSIX,"%Y-%m-%d")

then I created a new data frame called df_snow_day to store the mean of data 
grouped by day:
list_days <- unique(df_snow$day)
df_snow_day <- data.frame(day=list_days)

Finally I applied lapply in this way:
df_snow_day$snow <- lapply(df_snow_day$day, function(x) 
round(mean(df_snow$snow[df_snow$day == x], na.rm=T)))

This does not work. I do not understand why the class of df_snow_day$snow is of 
type list either:

   day snow
NA   NULL
NA.1 NULL
NA.2 NULL

Where is my mistake?

Thank you for all your help
Stefano


_

Da: Duncan Murdoch [murdoch.dun...@gmail.com]
Inviato: giovedì 9 giugno 2016 12.36
A: Stefano Sofia; r-help@r-project.org
Oggetto: Re: [R] create an empty data frame and then fill in it

On 09/06/2016 6:22 AM, Stefano Sofia wrote:
> Dear R list users,
> sorry for this simple question, but I already spent many efforts to solve it.
>
> I create an empty data frame called df_year like
>
> df_year <- data.frame(day=as.Date(character()), hs_MteBove=integer(), 
> hs_MtePrata=integer(), hs_Pintura=integer(), hs_Pizzo=integer(), 
> hs_Sassotetto=integer(), hs_Sibilla=integer(), stringsAsFactors=FALSE)
>
> and then I start to fill in it with
>
> df_year$day <- seq(as.Date("2004-11-01-00-00","%Y-%m-%d"), 
> as.Date("2005-05-01-00-00","%Y-%m-%d"), by="day")
>
> but I get the following error:
> "replacement has 182 rows, data has 0"
>
> Where is my silly mistake?

Your dataframe has 0 rows, so you can't put a 182 row vector into the
first column.

Unlike vectors, dataframes won't grow if you make assignments beyond the
end of the rows.

There are at least a couple of solutions:

1.  Don't create columns until you have data ready for them.

You can wait to create the dataframe until your "day" column is ready:

df_year <- data.frame(day = seq(...))

As you compute other columns of the same length, you can add them, e.g.

df_year$hs_MteBove <- ...

2.  Create your columns with the right length from the beginning:

df_year <- data.frame(day = rep(as.Date(NA), 182), ...)

I don't like this solution as much.

Duncan Murdoch




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.
__
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] Visualize Sparse Matrix.

2016-06-10 Thread Jim Lemon
Hi Francisco,
I tried this just to see if it would work. It did, after a while.

wtmat<-matrix(rnorm(4602*1817),nrow=4602)
library(plotrix)
x11(width=5,height=13)
color2D.matplot(wtmat,c(1,1,0),c(0,1,0),0,border=FALSE)

Jim

On Fri, Jun 10, 2016 at 8:27 AM, FRANCISCO XAVIER SUMBA TORAL
 wrote:
> Hi,
>
> First of all, sorry for my question it could be so basic for a common user in 
> R, but I am starting with this new environment.
>
> I have done a clustering job and I would like to visualize my vectors. I have 
> a matrix of TF-IDF weights of 4602 x 1817. I store the values in a CSV file. 
> How can I visualize my vectors in a 2D-space?
>
> After that, I execute a clustering algorithm and I got a label for each 
> cluster. How can I visualize my vectors resulting base on a color or figure 
> for each cluster?
>
> This is the code that I am having trying to accomplish my graphs:
>
> data <- read.csv(pathFile,header = FALSE, sep = ",”)
> dMatrix <- matrix(unlist(data), ncol = 4602, byrow = TRUE) # Use a matrix to 
> use melt.
> # Graph my data
> ggplot(melt(dMatrix), aes(Var1,Var2, fill=value)) + geom_raster() + 
> scale_fill_gradient2(low='red', high=‘black', mid=‘white') + theme_bw() + 
> xlab("x1") + ylab("x2")
>
>
> Cheers.
> [[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] FEAR package

2016-06-10 Thread PIKAL Petr
Hi

you should not post in HTML (although it did not matter in this case)
you should describe the way how you did install FEAR - I found that the 
installation process is a bit more complicated than installation of standard 
CRAN packages.

But first
you should contact the author about availability of package for newer R 
versions, as on the web page is mentioned that the package is compatible with R 
3.0.1  or R 3.1.0 and you are using R 3.2.4.

Regards
Petr

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of farzana
> akbari
> Sent: Friday, June 10, 2016 9:44 AM
> To: R-help@r-project.org
> Subject: [R] FEAR package
>
> in the name of God
>
>
> hi
>
>  I'm installing  FEAR package   in  R x64 3.2.4but  for loading it
>
>
> Error : .on Attach failed in attach Namespace() for 'FEAR', details:
>   call: detach("package:FEAR")
>   error: invalid 'name' argument
> Error: package or namespace load failed for ‘FEAR’
>
>
>
> what should I do?
>
> Best regards
>
>   [[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.


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

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

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

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into 
any contracts on behalf of the company except for cases in which he/she is 
expressly authorized to do so in writing, and such authorization or power of 
attorney is submitted to the recipient or the person represented by the 
recipient, or the existence of such authorization is known to the recipient of 
the person represented by the recipient.
__
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] FEAR package

2016-06-10 Thread farzana akbari
in the name of God


hi

 I'm installing  FEAR package   in  R x64 3.2.4but  for loading it


Error : .on Attach failed in attach Namespace() for 'FEAR', details:
  call: detach("package:FEAR")
  error: invalid 'name' argument
Error: package or namespace load failed for ‘FEAR’



what should I do?

Best regards

[[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] New installation

2016-06-10 Thread Rainer M Krug
Clint Bowman  writes:

I am really wondering, why nobody mentioned Ubuntu so far?

Ubuntu is a really nice distro, I never had problems with it, many
programs are available for Ubuntu, and it is build on Debian
(stable). Don't worry about Unity Window manager - there are many other
options available (Xubuntu being one of the better known ones - Ubuntu
just packed with a different Windows Manager).

If you are new to Linux, I would really suggest Ubuntu.

Cheers,

Rainer

> I "experiment" with the Fedora distribution at home but am very
> satisfied with the Scientific Linux distribution here at work--I'm
> currently using SL7.2.
>
> Clint Bowman  INTERNET:   cl...@ecy.wa.gov
> Air Quality Modeler   INTERNET:   cl...@math.utah.edu
> Department of Ecology VOICE:  (360) 407-6815
> PO Box 47600  FAX:(360) 407-7534
> Olympia, WA 98504-7600
>
> USPS:   PO Box 47600, Olympia, WA 98504-7600
> Parcels:300 Desmond Drive, Lacey, WA 98503-1274
>
> On Thu, 9 Jun 2016, Leonardo Ferreira Fontenelle wrote:
>
>> I have tried many Linux distributions before, and never looked back
>> after switching for Arch Linux. It is one of the best distributions with
>> regard to having an up to date but still reasonably stable system. Other
>> options are Fedora  Rawhide (there's a Fedora SIG mailing list) or
>> Debian Sid (as others mentioned, there's a Debian SIG mailing list), but
>> I don't know how dependable those versions are.
>>
>> Leonardo Ferreira Fontenelle
>> Former GNOME translator
>>
>> Em Qui 9 jun. 2016, às 20:08, Ista Zahn escreveu:
>>> Perhaps r-sig-debian is more appropriate, though it is not clear to me
>>> that
>>> a debian based linux is in fact the best for running R. Of course "best"
>>> is
>>> not clearly defined here, but I highly recommend Archlinux.
>>>
>>> Best,
>>> Ista
>>> On Jun 9, 2016 6:47 PM, "Bert Gunter"  wrote:
>>>
>>> > I suggest that you post to the r-sig-debian list instead of here. I
>>> > think you are more likely to get good answers to your query there.
>>> >
>>> > Cheers,
>>> > Bert
>>> > Bert Gunter
>>> >
>>> > "The trouble with having an open mind is that people keep coming along
>>> > and sticking things into it."
>>> > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>> >
>>> >
>>> > On Thu, Jun 9, 2016 at 1:44 PM, jax200  wrote:
>>> > > Hi
>>> > >
>>> > > I'm starting off with both R and Linux Mint.  During a recent R course, 
>>> > > I
>>> > > had multiple difficulties with installing updates needed for the course.
>>> > >
>>> > > As such, I'd like to hit the restart button with fresh installs of Linux
>>> > > and R.  I would appreciate your help with which Linux platform works 
>>> > > best
>>> > > with R, and how to go about getting all the updates installed for both
>>> > > programs.
>>> > >
>>> > > Many thanks,  Jack
>>> > >
>>> > > [[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.
>>> >
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


signature.asc
Description: PGP signature
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] Application of "merge" and "within"

2016-06-10 Thread Santosh
Hi Peter and others..
In the code from Peter..(reproduced below for convenience..)

> first <- function(x)x[1]
> s  <- within(q, {bl <- ave(b, paste(G,a), FUN=first); db <- b - bl})


is there a reason behind that 'ave' used in the above code?
is there way to perform a multi-column sort in within?

Thanks so much..
Santosh

On Wed, Jun 1, 2016 at 1:45 AM, peter dalgaard  wrote:

> Notice that within-group processing is intended. I'd try
>
> > first <- function(x)x[1]
> > s  <- within(q, {bl <- ave(b, paste(G,a), FUN=first); db <- b - bl})
>
> Or perhaps
>
> q <- within(q, Ga <- paste(G,a))
> tbl <- with(q, tapply(b, Ga, first))
> s <- within(q, {bl <- tbl[Ga]; db <- b - bl})
>
> -pd
>
>
> On 28 May 2016, at 22:53 , Duncan Murdoch 
> wrote:
>
> > On 27/05/2016 7:00 PM, Santosh wrote:
> >> Dear Rxperts!
> >>
> >> Is there a way to compute relative values.. using within().. function?
> >>
> >> Any assistance/suggestions are highly welcome!!
> >> Thanks again,
> >> Santosh...
> >> ___
> >> A sample dataset and the computation "outside" within()  function is
> shown..
> >>
> >> q <- data.frame(GL = rep(paste("G",1:3,sep = ""),each = 50),
> >>G  = rep(1:3,each = 50),
> >>D = rep(paste("D",1:5,sep = ""),each = 30),
> >>a = rep(1:15,each = 10),
> >>t = rep(seq(10),15),
> >>b = round(runif(150,10,20)))
> >> r <- subset(q,!duplicated(paste(G,a)),sel=c(G,a,b))
> >> names(r)[3] <- "bl"
> >> s <- merge(q,r)
> >> s$db <- s$b-s$bl
> >>
> >>> head(s,5)
> >>G  a GL  D  t  b bl db
> >> 1   1  1 G1 D1  1 13 13  0
> >> 2   1  1 G1 D1  2 16 13  3
> >> 3   1  1 G1 D1  3 19 13  6
> >> 4   1  1 G1 D1  4 12 13 -1
> >> 5   1  1 G1 D1  5 19 13  6
> >
> > Just use
> >
> > s <- within(s, db <- b - bl)
> >
> > 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.
>
> --
> 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
>
>

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