title: r- how to draw a 3d sphere with a "3d surface plot" as the sphere's surface?
body: <p>I have these two structures</p>
  
  <pre><code>n#equals some number that can be bigger or smaller than 360,or equalto360
  
  z=list(vertical_degree=sample(0:360, n),value=sample(1:10, n))
  
  x=list(horizontal_degree=sample(-90:90,n),value=sample(1:10, n))
  </code></pre>
  
  <p>I want to have a 3d sphere that corresponds to each dimension's degree value, and have a surface plot qw the sphere's area corresponding to the sample value on each degree.</p>
  
  <p>Please pardon my English, if you see any mistakes.</p>
  
  <p>Basically, roughly like this picture, only in three dimensions instead of two. The barplot is exchanged with a surface plot, and the "value circle" with a "value sphere".</p>
  
  <p><a href="https://i.stack.imgur.com/Ida4z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ida4z.png" alt="enter image description here"></a></p>