Re: [R] [External] openxlsx::read.xlsx can't read data without a header

2020-10-22 Thread Richard M. Heiberger
?openxlsx::read.xlsx The fourth argument by default is TRUE colNames: If ‘TRUE’, the first row of data will be used as column names. You will need to specify it explicitly as colNames=FALSE The other arguments will probably also be useful to you. On Thu, Oct 22, 2020 at 11:56 PM Joh

[R] openxlsx::read.xlsx can't read data without a header

2020-10-22 Thread John
Hi, I try to read 6 rows (from 5th to 10th) from Excel, but I can always get 5. The first row of the 6 becomes the header. How can I add something like "header = FALSE" in the formula, so that the resulting data would be all the 6 rows? A similar problem occurs in readxl::read_xlsx. Thank you!

Re: [R] vanilla session in R Gui or RStudio

2020-10-22 Thread Henrik Bengtsson
This can happens if save an object with an environment part of a package, e.g. $ R --quiet --vanilla > fcn <- Matrix::Matrix > environment(fcn) > quit("yes") # saves the workspace in an .RData file # Loading the .RData file at startup triggers 'Matrix' to be loaded $ R --quiet --no-init-file -e

Re: [R] vanilla session in R Gui or RStudio

2020-10-22 Thread Jeff Newmiller
Can you be more specific about what conditions cause R to automatically load a package when a .RData file is loaded? My experience has actually been the opposite. On October 22, 2020 6:13:11 PM PDT, Henrik Bengtsson wrote: >As Jeff says, it might be that you have a ~/.Rprofile file with >instr

Re: [R] vanilla session in R Gui or RStudio

2020-10-22 Thread Rolf Turner
On Thu, 22 Oct 2020 18:13:11 -0700 Henrik Bengtsson wrote: > As Jeff says, it might be that you have a ~/.Rprofile file with > instructions to load packages when R starts. It could also be that > you have a .RData file, which is saved if you answer yes to: > > > Save workspace image? [y/n/c]:

Re: [R] vanilla session in R Gui or RStudio

2020-10-22 Thread Henrik Bengtsson
As Jeff says, it might be that you have a ~/.Rprofile file with instructions to load packages when R starts. It could also be that you have a .RData file, which is saved if you answer yes to: > Save workspace image? [y/n/c]: y when you quit R. If this file exists, then R loads it and all the o

Re: [R] 3d plot of earth with cut

2020-10-22 Thread aBBy Spurdle , ⍺XY
> It should be a 2D slice/plane embedded into a 3D space. I was able to come up with the plot, attached. My intention was to plot national boundaries on the surface of a sphere. And put the slice inside. However, I haven't (as yet) worked out how to get the coordinates for the boundaries. Let me

Re: [R] vanilla session in R Gui or RStudio

2020-10-22 Thread Jeff Newmiller
Have you looked into your .Rprofile file? Loading packages is not something R normally does without your telling it to do so, but many people forget that they have done so. On October 22, 2020 3:47:04 PM PDT, Michael L Friendly wrote: >[env: Windows, R 3.6.6] > >When I start R from the R Gui i

[R] vanilla session in R Gui or RStudio

2020-10-22 Thread Michael L Friendly
[env: Windows, R 3.6.6] When I start R from the R Gui icon or from RStudio, I get a large number of packages loaded via a namespace. Not entirely clear where these come from. As a result, I often run into problems updating packages because something is already loaded. How can start a new gui s

Re: [R] 3d plot of earth with cut

2020-10-22 Thread Balint Radics
Thanks for your idea. It should be a 2D slice/plane embedded into a 3D space. Could be static, I just need to make a single figure from it for illustration of the Earth together with its interior in 3D. So, the interior would be a slice in 2D along a fixed longitude. And along this 2D slice would b

Re: [R] 3d plot of earth with cut

2020-10-22 Thread Balint Radics
Hello, this is very close to exactly what I need! I have tried it and it works nicely, I just have to map some values onto to the polygon or 2D plane that cuts into the 3D object. Thanks! Balint On Thu 22. Oct 2020 at 21:28, Duncan Murdoch wrote: > On 21/10/2020 8:45 a.m., Balint Radics wrote

Re: [R] 3d plot of earth with cut

2020-10-22 Thread Balint Radics
Hi Thanks a lot for this pointer, I will need to look at it. I did indeed google but did not find an example. In the meantime some additional solutions were suggested, that I also need to try. Cheers, Balint On Thu 22. Oct 2020 at 20:56, Bert Gunter wrote: > 1. Have you looked here: > https://

Re: [R] 3d plot of earth with cut

2020-10-22 Thread aBBy Spurdle , ⍺XY
If you have "value" as a function of latitude and radius, isn't that a 2D (not 3D) scalar field? Which can be plotted using a regular heatmap. If you want a curved edge where depth=0 (radius=?), that's not too difficult to achieve. Not quite sure what continent boundaries mean in this context, but

Re: [R] 3d plot of earth with cut

2020-10-22 Thread Duncan Murdoch
On 21/10/2020 8:45 a.m., Balint Radics wrote: Hello, Could someone suggest a package/way to make a 3D raster plot of the Earth (with continent boundaries), and then make a "cut" or "slice" of it such that one can also visualize some scalar quantity as a function of the Radius/Depth across that g

Re: [R] Function of "matrix"

2020-10-22 Thread Bill Dunlap
> 10.1/0.1 was successfully calculated Note that 'computed as' is not the same as 'printed as'. Computations are done with 52 binary digits of precision and printing is, by default, done with 7 decimal digits of precision. See FAQ 7.31. > 101 - 10.1/0.1 [1] 1.421085e-14 > options(digits=17)

Re: [R] [External] Function of "matrix"

2020-10-22 Thread Richard M. Heiberger
FAQ 7.31 > 10.1/.1 [1] 101 > print(10.1/.1, digits=17) [1] 100.99 > floor(10.1/.1) [1] 100 > floor(10.1*10) [1] 101 > matrix(0, 2.9, 3.9) [,1] [,2] [,3] [1,]000 [2,]000 > note that the dimension arguments are passed through floor() before they are used.

Re: [R] Function of "matrix"

2020-10-22 Thread Patrick (Malone Quantitative)
(Neglected to cc the list--please reply-all to this version) What was the warning? I hazard a guess you've run into precision issues for binary representation, and the result of your division is not *exactly* 101. Pat On Thu, Oct 22, 2020 at 2:42 PM 奈良県奈良市 wrote: > > Dear R project team > > I

Re: [R] Function of "matrix"

2020-10-22 Thread Bert Gunter
1. Answers on this list are from volunteers who are not part of any R project team. We have no official status and what we say comes with no guarantees. 2. There is no such thing as a "matrix 'environment' ". 3. The answer to your question is "computer arithmetic." See FAQ 7.31. Someone may follo

Re: [R] 3d plot of earth with cut

2020-10-22 Thread Bert Gunter
1. Have you looked here: https://cran.r-project.org/web/views/Spatial.html (I assume you have done some web searches on possible terms like "3D Earth Data R" or whatever) 2. You might try posting on the r-sig-geo list rather than here, where relative expertise may more likely be available. Cheers

[R] Function of "matrix"

2020-10-22 Thread 奈良県奈良市
Dear R project team I used the function of "matrix" as follows: matrix(c(1:3030), 10.1/0.1) However, in the function, matrix, 10.1/0.1 was regarded as 100 not as 101. Therefore, a warning message appeared. On the other hand, matrix(c(1:3030), 101) or matrix(c(1:3030), 10.1*10) was OK. Of course, s

[R] 3d plot of earth with cut

2020-10-22 Thread Balint Radics
Hello, Could someone suggest a package/way to make a 3D raster plot of the Earth (with continent boundaries), and then make a "cut" or "slice" of it such that one can also visualize some scalar quantity as a function of the Radius/Depth across that given slice ? Formally, I would have a given, fi