Re: [R] dataRetrieval query error

2020-09-05 Thread Bill Dunlap
Name all your arguments (the vignette gets this wrong), including siteNumber=siteNumbers. Also, the vignette uses 'statCd', not 'statCD'. dataAvailable <- whatNWISdata(siteNumber=siteNumbers, service="all", statCd="all") gives some results. -Bill On Sat, Sep 5, 2020 at 4:44 PM Rich Shepard wr

Re: [R] dataRetrieval query error

2020-09-05 Thread David Winsemius
This worked: > dataAvailable <- whatNWISdata(siteNumber=siteNumbers) > str(dataAvailable) 'data.frame':    2565 obs. of  24 variables:  $ agency_cd : chr  "USGS" "USGS" "USGS" "USGS" ...  $ site_no   : chr  "14207920" "14208000" "14208000" "14208000" ...  $ station_nm    : ch

Re: [R] dataRetrieval query error

2020-09-05 Thread Bert Gunter
You failed to name the first parameter, siteNumbers? 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 Sat, Sep 5, 2020 at 4:44 PM Rich Shepard wrote: > I'm le

[R] dataRetrieval query error

2020-09-05 Thread Rich Shepard
I'm learning the dataRetrieval package. Following the example in Section 1.1.2 of the vignette (whatNWISdata) I prepared this script: -- library("dataRetrieval") siteNumbers <- c("14207920","14208000","14208200","14208300","14208500","14208600","14208700","14208850","14209000","14209100","14

Re: [R] fusion of two matrices (numerical and logical)

2020-09-05 Thread Bert Gunter
A is not a matrix. I presume you meant B. If so: > B[!C] <- 0 > B [,1] [,2] [,3] [,4] [1,]1600 [2,]2000 [3,]3000 [4,]400 19 [5,]5000 Cheers, Bert On Sat, Sep 5, 2020 at 11:18 AM Vivek Sutradhara wrote: > Hi

Re: [R] fusion of two matrices (numerical and logical)

2020-09-05 Thread Vivek Sutradhara
The result that I want to get is this: for (i in 1:5) { for (j in 1:4) { B[i,j] <- ifelse(C[i,j]==FALSE,0,B[i,j]) } } I would like to know if I can do this without loops. Den lör 5 sep. 2020 kl 20:18 skrev Vivek Sutradhara : > Hi > I would like to get help in combining two matrices. Here

[R] fusion of two matrices (numerical and logical)

2020-09-05 Thread Vivek Sutradhara
Hi I would like to get help in combining two matrices. Here is my example: A <- 1:20 B <- matrix(A,nrow=5,ncol=4) # B is a numerical matrix C <- B<7 C[4,4] <- TRUE # C is a logical matrix # if I combine A and C, I get a vector D1 <- A[C==TRUE] D1 D2 <- A[C==FALSE] D2 I want to get a matrix with th