Re: [R] Question regarding reservoir volume and water level

2024-04-07 Thread javad bayat
Dear all; Many thanks for your replies. This was not homework. I apologize. Let me explain more. There is a dam constructed in a valley with the highest elevation of 1255 m. The area of its reservoir can be calculated by drawing a polygon around the water and it is known. I have the Digital Elevati

Re: [R] Question regarding reservoir volume and water level

2024-04-07 Thread avi.e.gross
John, Your reaction was what my original reaction was until I realized I had to find out what a DEM file was and that contains enough of the kind of depth-dimension data you describe albeit what may be a very irregular cross section to calculate for areas and thence volumes. If I read it correctl

Re: [R] duplicated() on zero-column data frames returns empty

2024-04-07 Thread Mark Webster via R-help
With respect to duplicated.data.frame taking account of row names to return all the rows as unique: thinking about this some more, I can see that making sense in isolation, but it's at odds with the usual behaviour of duplicated for other classes, e.g. primitive vectors, where it doesn't take a

Re: [R] Question regarding reservoir volume and water level

2024-04-07 Thread avi.e.gross
Chris, since it does indeed look like homework, albeit a deeper looks suggests it may not beI think we can safely answer the question: >Is there any way to write codes to do this in R? The answer is YES. And before you ask, it can be done in Python, Java, C++, Javascript, BASIC, FORTRAN and prob

Re: [R] Question regarding reservoir volume and water level

2024-04-07 Thread Sorkin, John
Aside from the fact that the original question might well be a class exercise (or homework), the question is unanswerable given the data given by the original poster. One needs to know the dimensions of the reservoir, above and below the current waterline. Are the sides, above and below the wate

Re: [R] Question regarding reservoir volume and water level

2024-04-07 Thread Rui Barradas
Às 13:27 de 07/04/2024, javad bayat escreveu: Dear all; I have a question about the water level of a reservoir, when the volume changed or doubled. There is a DEM file with the highest elevation 1267 m. The lowest elevation is 1230 m. The current volume of the reservoir is 7,000,000 m3 at 1240 m.

Re: [R] Question regarding reservoir volume and water level

2024-04-07 Thread Chris Ryan via R-help
Homework? -- Sent from my Android device with K-9 Mail. Please excuse my brevity. On April 7, 2024 8:27:18 AM EDT, javad bayat wrote: >Dear all; >I have a question about the water level of a reservoir, when the volume >changed or doubled. >There is a DEM file with the highest elevation 1267 m. T

[R] Question regarding reservoir volume and water level

2024-04-07 Thread javad bayat
Dear all; I have a question about the water level of a reservoir, when the volume changed or doubled. There is a DEM file with the highest elevation 1267 m. The lowest elevation is 1230 m. The current volume of the reservoir is 7,000,000 m3 at 1240 m. Now I want to know what would be the water leve

Re: [R] duplicated() on zero-column data frames returns empty

2024-04-07 Thread Ivan Krylov via R-help
В Fri, 5 Apr 2024 16:08:13 + Jorgen Harmse пишет: > if duplicated really treated a row name as part of the row then > any(duplicated(data.frame(…))) would always be FALSE. My expectation > is that if key1 is a subset of key2 then all(duplicated(df[key1]) >= > duplicated(df[key2])) should alwa