Dear,
Yes, Its worked with function "prcomp":
> PCA_3d<-prcomp(t(Normalized_Expresso), cor=TRUE)

Here is the Question:
while ploting the object PCA_3d with scatterplot3d from
package:scatterplot3d, the x,y,z coordinates were given as PCA_3d$x[,1:3],
but the PCA_3d$x has 7 PC components (columns) and 7 samples as rows. If I
give the first three PC components [PC1, PC2, PC3] as coordinates, I
insists to know about other PCs like [PC4,PC5, PC6, PC7]. Out of all which
gives the best reliable pattern of samples on the plot.

> scatterplot3d(PCA_3d$x[,1:3],xlab="Component 1 (26.9%)",main="My 3D
PCA",ylab="Component 2(17.9%)", zlab="Component 3
(12.4%)",type="h",box=FALSE,pch=21)


Thanking You in advance,

Satya


On Mon, Jul 1, 2013 at 11:18 PM, Veera Venkata Satyanarayana <
veeru.vsn@gmail.com> wrote:

>  I am thankful to You Mr. James W. MacDonald. But It didn't worked with
> function "princomp" when I use as
>
> > PCA_3d<-princomp(t(Expresso), cor=TRUE)
> Error in princomp.default(t(Normalized_Expresso), cor = TRUE) :
>   'princomp' can only be used with more units than variables
>
>
>
>
>
> On Mon, Jul 1, 2013 at 7:35 PM, James W. MacDonald <jmacdon@uw.edu> wrote:
>
>>
>>
>> On 7/1/2013 8:28 AM, Chevala V V S Narayana [guest] wrote:
>>
>>> Dear All,
>>>
>>> I request help in generating "Sample-based 3D-PCA plot" (Principal
>>> component analysis). I used function "princomp" from package:stats to
>>> create a PCA object on the data-set. the data dimensions are 600 * 7.
>>>
>>> While genetaring, the plot were created on Genes with both "plot3d" and
>>> "scatterplot3d" functions, and I want the PCA-3d plot according to the
>>> samples.
>>>
>>> The code I used is,
>>>
>>>> dim(Expresso)
>>>>
>>> [1] 618   7
>>>
>>>> PCA_3d<-princomp(Expresso, cor=TRUE)
>>>>
>>>
>> Both princomp() and prcomp() expect the data to be in a conventional
>> format (with samples in rows and observations in columns). Microarray data
>> are in general transposed from this format (with observations in rows and
>> samples in columns), so you need to do
>>
>> princomp(t(Expresso), cor = TRUE)
>>
>> Best,
>>
>> Jim
>>
>>
>>  plot3d(PCA_3d$scores[,1:7],**xlab="Component 1",main="My 3D
>>>>
>>> + PCA",ylab="Component 2", zlab="Component 3", type="h", box=F, axes=F)
>>>
>>>> spheres3d(PCA_3d$scores[,1:7], radius=0.1, col="pink")
>>>> grid3d(side="z", at=list(z=0))
>>>> text3d(PCA_3d$scores[,1:7], text=rownames(PCA_3d$scores), adj=1.3)
>>>>
>>> I also tried to plot with function "scatterplot3d"
>>>
>>>> scatterplot3d(PCA_3d$scores[,**1:3],xlab="Component 1
>>>> (26.9%)",main="My 3D PCA",ylab="Component 2(17.9%)", zlab="Component 3
>>>> (12.4%)",type="h",box=FALSE,**pch=21)
>>>> scatterplot3d(PCA_3d$scores [,1:3],xlab="Component 1 (26.9%)",main="My
>>>> 3D PCA",ylab="Component 2(17.9%)", zlab="Component 3
>>>> (12.4%)",type="h",box=FALSE,**pch=21,bg=color)
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>   -- output of sessionInfo():
>>>
>>>  sessionInfo()
>>>>
>>> R version 2.15.1 (2012-06-22)
>>> Platform: x86_64-redhat-linux-gnu (64-bit)
>>>
>>> locale:
>>>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>>>   [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>>>   [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
>>>   [7] LC_PAPER=C                 LC_NAME=C
>>>   [9] LC_ADDRESS=C               LC_TELEPHONE=C
>>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>>
>>> attached base packages:
>>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>>
>>> other attached packages:
>>> [1] ggplot2_0.9.3        reshape2_1.2.2       scatterplot3d_0.3-33
>>> [4] rgl_0.93.935         DESeq_1.10.1         lattice_0.20-13
>>> [7] locfit_1.5-8         Biobase_2.18.0       BiocGenerics_0.4.0
>>>
>>> loaded via a namespace (and not attached):
>>>   [1] annotate_1.36.0      AnnotationDbi_1.20.3 colorspace_1.2-1
>>>   [4] DBI_0.2-5            dichromat_2.0-0      digest_0.6.2
>>>   [7] genefilter_1.40.0    geneplotter_1.36.0   grid_2.15.1
>>> [10] gtable_0.1.2         IRanges_1.16.5       labeling_0.1
>>> [13] MASS_7.3-23          munsell_0.4          parallel_2.15.1
>>> [16] plyr_1.8             proto_0.3-10         RColorBrewer_1.0-5
>>> [19] RSQLite_0.11.2       scales_0.2.3         splines_2.15.1
>>> [22] stats4_2.15.1        stringr_0.6.2        survival_2.37-2
>>> [25] tcltk_2.15.1         tools_2.15.1         XML_3.95-0.1
>>> [28] xtable_1.7-0
>>>
>>>
>>> --
>>> Sent via the guest posting facility at bioconductor.org.
>>>
>>> ______________________________**_________________
>>> Bioconductor mailing list
>>> Bioconductor@r-project.org
>>> https://stat.ethz.ch/mailman/**listinfo/bioconductor<https://stat.ethz.ch/mailman/listinfo/bioconductor>
>>> Search the archives: http://news.gmane.org/gmane.**
>>> science.biology.informatics.**conductor<http://news.gmane.org/gmane.science.biology.informatics.conductor>
>>>
>>
>> --
>> James W. MacDonald, M.S.
>> Biostatistician
>> University of Washington
>> Environmental and Occupational Health Sciences
>> 4225 Roosevelt Way NE, # 100
>> Seattle WA 98105-6099
>>
>>
>
>
> --
> Chevala. V V S Narayana
> Junior Research Fellow,
> NIPGR.
>
>


-- 
Chevala. V V S Narayana
Junior Research Fellow,
NIPGR.

	[[alternative HTML version deleted]]

