Re: [R-sig-eco] Vegan_package: Plot PCA

2019-02-26 Thread Abdoul Dia
If I do understand this is what you are looking for :

plot(x, choices = c(1, 2), display = c("sp", "wa", "cn"),
 scaling = 2, type, xlim, ylim, const, ...)


The option choices helps you to select the axis. In your case it would
be choices = c(1,3) [axis 1 vs 3] or choices = c(2,3) [axis 2 vs 3]

Hope this would help you.


Abdoul


Le mar. 26 févr. 2019 à 19:20, Lara Silva  a
écrit :

> Hello,
>
> I am using the VEGAN package to do PCA of my variables.
>
>
> bio.pca <- rda(variables, scale=TRUE) # Argument scale=TRUE
>
> bio.pca
>
> summary(bio.pca) # Default scaling 2
>
> summary(bio.pca, scaling=2)
>
>
>
> sum_bio <-summary(bio.pca)
>
> names(sum_bio)
>
> sum_bio$species
>
>
>
> #make basic plot
>
> biplot(env.pca,
>
>display = c("sites",
>
>"species"),
>
>type = c("text",
>
> "points"))
>
>
>
> In my plot I have PCA 1 e PCA 2. Is there a way to plot the PCA 3?
>
>
> Thanks,
>
>
> Lara
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>


-- 
Abdoul Ousmane DIA

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Vegan_package: Plot PCA

2019-02-26 Thread Lara Silva
Hello,

I am using the VEGAN package to do PCA of my variables.


bio.pca <- rda(variables, scale=TRUE) # Argument scale=TRUE

bio.pca

summary(bio.pca) # Default scaling 2

summary(bio.pca, scaling=2)



sum_bio <-summary(bio.pca)

names(sum_bio)

sum_bio$species



#make basic plot

biplot(env.pca,

   display = c("sites",

   "species"),

   type = c("text",

"points"))



In my plot I have PCA 1 e PCA 2. Is there a way to plot the PCA 3?


Thanks,


Lara

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Select a percentage of combinations

2019-02-26 Thread Lara Silva
Thank you very much!

Regards,

Lara


Shane Baylis  escreveu no dia terça, 26/02/2019
à(s) 01:53:

> Hi Lara,
>
> You want to subset out 20% of the columns from a matrix, at random. Try:
>
> combinations <- combn(20,3)  ## makes the 'all combinations' matrix
> sample <- combinations[,sample(1:ncol(combinations),
> floor(ncol(combinations)*0.2))] ## subsets out 20% of the columns from that
> object.
> ## Note that sample() samples without replacement, by default.
> sample
>
> Hope that helps!
> Shane
>
> On Tue, 26 Feb 2019 at 12:38, Lara Silva  wrote:
>
>> Hello,
>>
>> I want to select  sets of combinations, but I do not want use all 1140
>>
>> combn (20,3)
>>
>> choose (20,3) - total of  1140.
>>
>> [,1091] [,1092] [,1093] [,1094] [,1095] [,1096] [,1097] [,1098]
>> [,1099]
>> [,1100]
>> [1,]  13  13  13  13  13  13  13  13
>> 13  13
>> [2,]  15  15  15  15  15  16  16  16
>> 16  17
>> [3,]  16  17  18  19  20  17  18  19
>> 20  18
>>  [,1101] [,1102] [,1103] [,1104] [,1105] [,1106] [,1107] [,1108]
>> [,1109] [,1110]
>> [1,]  13  13  13  13  13  14  14  14
>> 14  14
>> [2,]  17  17  18  18  19  15  15  15
>> 15  15
>> [3,]  19  20  19  20  20  16  17  18
>> 19  20
>>  [,] [,1112] [,1113] [,1114] [,1115] [,1116] [,1117] [,1118]
>> [,1119] [,1120]
>> [1,]  14  14  14  14  14  14  14  14
>> 14  14
>> [2,]  16  16  16  16  17  17  17  18
>> 18  19
>> [3,]  17  18  19  20  18  19  20  19
>> 20  20
>>  [,1121] [,1122] [,1123] [,1124] [,1125] [,1126] [,1127] [,1128]
>> [,1129] [,1130]
>> [1,]  15  15  15  15  15  15  15  15
>> 15  15
>> [2,]  16  16  16  16  17  17  17  18
>> 18  19
>> [3,]  17  18  19  20  18  19  20  19
>> 20  20
>>  [,1131] [,1132] [,1133] [,1134] [,1135] [,1136] [,1137] [,1138]
>> [,1139] [,1140]
>> [1,]  16  16  16  16  16  16  17  17
>> 17  18
>> [2,]  17  17  17  18  18  19  18  18
>> 19  19
>> [3,]  18  19  20  19  20  20  19  20
>> 20  20
>>
>>
>> If it possible to select 20% of this combinations (sets)?
>> It is important to generate a random sample ...
>>
>> Example
>>
>> 15  1  8 ...
>> 16  7  20
>> 17 20  13...
>>
>> Any advice?
>>
>> Thanks,
>>
>> Lara
>>
>> [[alternative HTML version deleted]]
>>
>> ___
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology