How to reorder the columns of a data frame in R to start with specific continuous variables
<p>I have a dataframe in R, which has in the rows some observations and in the columns various features--both quantitative and qualitative--. I want to reorder somehow the columns of my data frame, it order to start with 5 specific numeric variables in the start, which belong in a specific group. My notion for this, is that afterwards i would like to use a PCA variant methodology, which needs the groups of my continuous variables to be ordered together in a group sequentially. In my case, the columns of my data frame are ordered like this:</p>

<pre><code>colnames(dat)
 [1] "SUV"           "CCT5"          "FD"            "k3"           
 [5] "MTHFD1"        "HPGDS"         "PAPSS2"        "INF"          
 [9] "SLC26A2"       "k4"            "NPM1"          "TIMP1"        
[13] "NR3C2"         "CA2"           "UGDH"          "MEF2C"        
[17] "POP1"          "ENO1"          "DKC1"          "EDNRB"        
[21] "VRK1"          "CD44"          "GSTP1"         "AARS"         
[25] "PDE2A"         "MAOA"          "CCT8"          "CA4"          
[29] "PPA1"          "RAE1"          "PGM1"          "PPP1CB"       
[33] "ACADM"         "NME1"          "PPARG"         "PRDX4"        
[37] "PPARGC1A"      "CTPS1"         "CD36"          "IARS"         
[41] "CCT4"          "CA1"           "SULT1A2"       "ACADS"        
[45] "Meta_factor"   "Disease"       "Location_Type" "Tumor_Stage"  
[49] "Lymph_Node"   
</code></pre>

<p>Thus, i would like the columns of my data frame to start with the following variables: <strong>FD, SUV, K3, INF,k4</strong> and then the following variables. Is this possible from a function or package in R ?</p>