That example is a bit old, written before the Playcanvas Layers system was introduced. Now the way to do that would be to create a new Layer in the editor, assign it to your active camera and objects you would like to render on and in code make the following change:
// // Set the render target on an entity's camera component
// this.entity.camera.renderTarget = renderTarget;
// added a new Layer named Render
var layer = this.app.scene.layers.getLayerByName('Render');
layer.renderTarget = renderTarget;
If you would like to render to texture the whole Layers composition including the skybox etc, take a look at the following project by @yaustar :
Edit: About the Skybox though, since that is rendered on its own layer I think still it will not be included on the rendered texture. There is a quick and dirty solution to grab a texture from the Application texture, but that will kill performance.
Will research further on what is the optimal way Most likely using a pc.PostEffect to copy the colorBuffer to a render texture.