similar to: PCA in r

Displaying 20 results from an estimated 40000 matches similar to: "PCA in r"

2006 Nov 16
1
Problems with principal components analysis PCA with prcomp
Dear friends, I am beginning to use R software in my academic research and I'm having some problems regarding the use of PCA. I have a table with 24445 rows and 9 columns, and I used the function prcomp() to do the analysis. Working with an example?: x<-read.table("test.txt", header=T) row.names(x)<-x[,1] x<-x[,-1] require(stats) pca<-prcomp(x, scale=T) names(pca) ##
2013 Sep 26
1
R not ploting lines in the correct order
Hi, I have a set of x, y points where x represents dates and y actual values. I am trying to plot a line graph of the data with points on top, but R is connecting the wrong points with lines. Does anyone know how I can rectify this. Please see sample below: x= 24/09/2009 09:13 16/10/2009 11:17 24/10/2009 21:43 11/09/2009 18:34 22/08/2009 15:45 10/08/2009 00:30 14/08/2009 14:52 24/09/2009
2018 Mar 17
3
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
Hi Sarah, Thank you for your help. I tried using CR1<-as.matrix(CR1) but gives error Error in corrplot(CR1, method = "circle") : The matrix is not in [-1, 1]!. I am using a corrplot library. Please find the reproducible example: dput(head(CR1,10)) structure(c(26L, 46L, 39L, 38L, 47L, 59L, 56L, 61L, 43L, 60L, 78L, 63L, 2L, 58L, 8L, 1L, 1L, 9L, 11L, 2L, 1037500L, 46747L, 346300L,
2011 Jun 30
2
sdev value returned by princomp function (used for PCA)
Dear all, I have a question about the 'sdev' value returned by the princomp function (which does principal components analysis). On the help page for princomp it says 'sdev' is 'the standard deviations of the principal components'. However, when I calculate the principal components for the USArrests data set, I don't find this to be the case: Here is how I
2011 Dec 28
1
Help with PCA
Dear all, I've a correlation matrix with rows and columns headings. I've two questions: 1) How can i import it in R, setting first row as row heading and first column as column heading? 2) Which is the best principal component anlysis package in R? Thanks in advance -- View this message in context: http://r.789695.n4.nabble.com/Help-with-PCA-tp4239756p4239756.html Sent from the R help
2018 Mar 17
0
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
That does clarify for me that you're missing a step: I didn't clearly follow your description at first. corrplot expects a correlation matrix, not your original data. You need to use cor() first. That's pretty clear in the documentation. See for instance the examples: data(mtcars) M <- cor(mtcars) corrplot(M) Sarah On Sat, Mar 17, 2018 at 12:00 PM Shivi Bhatia <shivipmp82 at
2013 May 16
1
connect to local mySQL database
Hi, I would like to access a local mysql database. In python using the sqlite3 library it is quite straightforward. I just have to pass the path to the sqlite-file; sqlite3.connect('.../xy.sqlite') Is there something similar in R (or specifically in the RMySQL package)? It seems like I have to use the MySQL function in the RMySQL package in order to ... "initializes a MySQL
2013 Mar 28
4
bayesian HLM random effects
Hello, all. I've been working on this for sometime and was almost at the end/ last chunk of code i would need.... When I received an error. Rather than go to bed and think about it in the morning, I messed with my data and now I am not getting anything. I was up until 4am trying to fix this. Zip files of my data are attached (the data which ends in 'a' matches with wvsA and the
2012 Oct 19
1
factor score from PCA
Hi everyone, I am trying to get the factor score for each individual case from a principal component analysis, as I understand, both princomp() and prcomp() can not produce this factor score, the principal() in psych package has this option: scores=T, but after running the code, I could not figure out how to show the factor score results. Here is my code, could anyone give me some advice please?
2012 Mar 14
2
Using the mantel test in Ape Package
Hi, I am trying to use a mantel test on two distance matrices. The code I have entered for each is: Gen_dists <- read.csv(file.choose(), stringsAsFactors = FALSE, na.strings = c(" "), fill = T,
2007 Jun 15
1
text display using expression or not
Hello, I imagine that I'm missing something straightforward, but a run thru the help files didn't turn up an answer. I noticed while formatting some figures for publication that text enclosed in expression() and used for a title displays differently than a string, regardless of the par options. On both postscript() and x11() devices, the regular text is heavier than the expression text.
2012 Aug 03
5
replacement has length zero. In addition: Warning message: In max(i) : no non-missing arguments to max; returning -Inf
Hi, Here is my data, the first 10 rows > u=regCond_all[1:10,] > dput(u) structure(c(999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 1.9, 2, 1.97, 1.99, 1.83, 1.78, 1.6, 1.52, 1.52, 1.36, 10.53, 9.88, 9.88, 10.53, 10.53, 10.53, 5.26, 9.88, 10.53, 10.53, 5.4, 5.57, 5.46, 5.34, 5.5, 5.59, 5.62, 5.76, 6.23, 6.19,
2013 Jul 23
1
Heat Map for species - code from Numerical Ecology with R
Hello, I am relatively new to R and I am working through the code that is provided in the book Numerical Ecology with R and I have run across an error message that I can't seem to figure out. I am using the vegan, ade4, gclus and cluster packages. The code is as follows: # Ordered community table # Species are ordered by their weighted averages on site scores or <- vegemite(spe,
2011 Dec 03
4
Data alignment
Hello! I have a data.frame which looks like: Name - Value A - 400 A - 300 B - 200 B - 350 C - 500 C - 350 D - 450 D - 600 E - 700 E - 750 F - 630 F - 650 I want to add another column where all A,B should get an index 1, all C,D an index of 2 and all E,F an index of 3 so that the data.frame looks like: ID - Name - Value 1 - A - 400 1 - A - 300 1 - B - 200 1 - B - 350 2 - C - 500 2 - C - 350 2
2007 May 13
2
Biplot
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: https://stat.ethz.ch/pipermail/r-help/attachments/20070513/6557c355/attachment.pl
2011 Dec 09
5
Making outregs in R
Dear r-Gods! I am interesting in making an equivalent command like outreg in stata where I get all my 8 regressions in one table. Does R have an easy command to that? MVH Dave [[alternative HTML version deleted]]
2016 Apr 15
1
Decision Tree and Random Forrest
I need the output to have groups and the probability any given record in that group then has of being in the response class. Just like my email in the beginning i need the output that looks like if A and if B and if C then %77 it will be D. The examples you provided are just simply not similar. They are different and would take interpretation to get what i need. On Apr 14, 2016 1:26 AM,
2018 Apr 22
3
Gantt Chart Using Plotrix
Hi Sarah Thank you very much for your pointers. Is there a way to specify the date string as POSIXct when reading in? I have tried the following (very inelegant way) and still have no luck. --- Begin Code --- # 1st read in the spreadsheet with stringsAsFactors set to FALSE > abc <- read.csv("gntr1.csv", header=TRUE, stringsAsFactors=FALSE) > abc code tasks.labels
2012 Jun 22
4
Search list of elements for a specific pattern
Hi, I have a list of mutations, called "mutList", of the form: > head(mutList) Alu 1 AluJ 2 AluJ/F(R)AM 3 AluJ/FLAM 4 AluJ/FRAM 5 AluJ/monomer 6 AluJb It contains about 500 elements and not all of them contain the sequence "Alu". I tried using this code: Alu<-mutList[which(grep("Alu",mutList)==1)] But that simply returned
2018 Mar 17
2
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
Created a new data set with 3 numeric variable to find correlation CR1<- mar%>% as_data_frame%>% select(AGE, OLD_CAR_PURCHASE_YRS, Total.Spend.With.AA) had to convert it to a data frame, code: as.matrix(as.data.frame(CR1)) Now i need to run a correlation plot for these 3 variables: corrplot(CR1, method = "circle") But i am getting this error: Error in