[R] joining files after canonical correlation
Dear R, I recently did a canonical correlation analysis on two subsets of data (location and weather). So I now have canonical scores for location and weather. but I'd now like to do a scatterplot matrix using the pairs statement. Is there a way to somehow join location.U and weather.V to become a new data set from which I could undertake a scatterplot matrix of the canonical variates? brett Brett Stansfield Environmental Scientist - Water Quality Hawke's Bay Regional Council 102 Vautier Street Private Bag 6006 Napier Phone (06) 835-9200 extn 9334 Fax (06) 835-3601 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Chi Square Test on two groups of variables
Dear R help I have been trying to conduct a chi square test on two groups of variables to test whether there is any relationship between the two sets of variables chisq.test(oxygen, train) Pearson's Chi-squared test data: oxygen X-squared = 26.6576, df = 128, p-value = 1 > chisq.test(oxygen) Pearson's Chi-squared test data: oxygen X-squared = 26.6576, df = 128, p-value = 1 It looks as if R is only reading the first set of variables pertaining to oxygen. Is there a way for it to test for two groups of variables? brett stansfield Brett Stansfield Environmental Scientist - Water Quality Hawke's Bay Regional Council 102 Vautier Street Private Bag 6006 Napier Phone (06) 835-9200 extn 9334 Fax (06) 835-3601 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Linear Discriminant Analysis Biplots
Dear R I'm trying to plot the lda means onto a 2 D plot of discriminant scores. Preferably I'd like these to be in a larger font compared to the discriminant scores. I tried skull.mean.pred <- predict(skulls.lda, as.data.frame(skulls.lda$means), dimen=2) from which I got skull.mean.pred $class [1] 1 2 3 4 5 Levels: 1 2 3 4 5 $posterior 1 2 3 4 5 1 0.30359530 0.2980478 0.1985440 0.1194298 0.08038303 2 0.28170499 0.2869483 0.1998210 0.1344000 0.09712566 3 0.17098847 0.1820718 0.2614599 0.2195304 0.16594947 4 0.10825125 0.1288876 0.2310494 0.2751790 0.25663280 5 0.08350914 0.1067567 0.2001869 0.2941451 0.31540220 $x LD1 LD2 1 -0.79515585 -0.03311963 2 -0.64549355 -0.15347046 3 0.04762133 0.33983601 4 0.56774779 0.05868023 5 0.82528029 -0.21192615 So I then went back to my original LDA plot of plot(skull.pred$x, type="n") * text(skull.pred$x, labels=Epoch) and tried to change the text such that mean scores were also displayed in a larger font so I tried text(skull.pred$x, labels=skull.mean.pred) however I ended up with a really messy biplot of numbers does anyone know how to do this properly Brett Stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Factor Analysis Biplot
Dear R When I go to do the biplot biplot(eurofood.fa$scores, eurofood$loadings) Error in 1:p : NA/NaN argument I think this is because the component loadings don't show values for some variables Loadings: Factor1 Factor2 RedMeat0.561 -0.112 WhiteMeat 0.593 -0.432 Eggs 0.839 -0.195 Milk 0.679 Fish 0.300 0.951 Cereals -0.902 -0.267 Starch 0.542 0.253 Nuts -0.760 Fr.Veg-0.145 0.325 So how can I get it to do a biplot? Is there a way for R to recognise component loadings less than the cut off value?? Brett Stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Factor Analysis Biplot
Dear R help I am having difficulty doing a biplot of the first two factors of a factor analysis. I presume it is because the values in factor 2 for Milk and NUTS are not displayed in the component loadings. Loadings: Factor1 Factor2 RedMeat0.561 -0.112 WhiteMeat 0.593 -0.432 Eggs 0.839 -0.195 Milk 0.679 Fish 0.300 0.951 Cereals -0.902 -0.267 Starch 0.542 0.253 Nuts -0.760 Fr.Veg-0.145 0.325 It has no problem doing a normal plot using plot(eurofood.fa$scores[,1], eurofood.fa$scores[,2]) But when I ask for a biplot I get biplot(eurofood.fa$scores[,1], eurofood.fa$scores[,2]) Error in 1:n : NA/NaN argument What can I do to overcome this?? Brett Stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] plotting Principle components vs individual variables.
g$X100m, running.pca$scores[,1]) It does this no problems but when I ask it to highlight the running2 points I get the following points(running2$X100m, running.pca$scores[,1], col="red") Error in xy.coords(x, y) : x and y lengths differ How can I get the programme to highlight the 5 countries in red with the remainder being black?? I have checked the pca$scores data Comp.1 Comp.2Comp.3 Comp.4 Argentina -0.04924775 -0.465091996 -0.1569462564 -0.005810845 Australia 1.90192176 0.101049166 -0.0120464104 0.651816682 Austria 0.04010907 -0.163884583 -0.3055014673 0.016136753 Belgium 1.37253647 0.587803868 0.1488158699 -0.019595422 Bermuda 0.69426608 -0.493030587 0.1593950774 0.120074355 Brazil 1.68418949 0.214898184 -0.0733240991 -0.003162787 Burma -1.40707421 0.188937600 -0.6623424285 -0.527215158 Canada 1.52735698 -0.404836611 -0.2142964494 0.176168719 Chile 0.40862535 -0.212618765 0.0408667861 -0.078681885 China -0.56552586 -0.223429359 -0.2928094868 -0.086596928 Columbia -0.11564898 -0.226977793 0.4589401052 -0.048022658 Cook Islands -8.27371262 0.384947623 -0.7357421902 0.801461946 Costa Rica -2.80544713 0.066593276 -0.1383029607 -0.147987785 Czechoslovakia 0.94084659 0.146421855 0.0317629603 0.063414890 Denmark 0.50127535 0.141213477 -0.0481367885 0.642995929 Dominican Republic 0.37381694 -1.061799496 -0.1213552291 -0.266094008 Finland 1.00082548 0.544083222 -0.0258548880 0.117235365 France 1.85734404 -0.004344636 -0.1282195202 -0.168095452 East Germany2.02630668 0.059699745 0.0679807810 -0.039807436 West Germany2.06659223 0.217657596 0.2898976618 0.043722768 United Kingdom 2.34631901 0.287007920 -0.2631249772 -0.052175961 Greece 0.60350129 -0.417937938 -0.2722470809 -0.297147859 Guatemala -2.86229181 -0.084782032 0.1092307154 0.124678037 Hungary 0.88380469 -0.196275223 -0.1074953145 -0.089263972 India -0.06219546 0.987010331 0.3912982329 -0.297843161 Indonesia -1.44463975 -0.248819611 -0.0905110184 -0.370562155 Ireland-0.14120447 0.296136604 0.0471511543 0.249279625 Israel -0.68753510 0.413206648 -0.9205920726 0.116497574 Italy 2.53306911 -0.552500188 -0.4802520770 0.350811975 Japan 0.51968949 -0.142260162 0.2336252451 -0.043102377 Kenya 1.25823679 0.791008473 0.1904824736 0.246021878 South Korea 0.09196164 -0.291847998 -0.2933387263 -0.270244999 North Korea-2.16401990 0.517221912 0.4818608282 -0.138369205 Luxembourg -0.23310298 -0.767690670 -0.4063507475 -0.077338384 Malaysia -0.03915668 -0.390104541 0.2784969875 0.006861838 Mauritius -3.34291107 0.866944770 0.7514511384 -0.093101352 Mexico -0.14612335 0.122630574 0.4475266976 -0.410199703 Netherlands 0.80128457 0.916525709 0.3262696094 0.063077066 New Zealand 0.52127592 0.669474301 -0.2625746371 -0.017136425 Norway -0.12659992 0.566884546 -0.2898334704 -0.248028150 Papua New Guinea -2.70378288 -0.154472681 0.4409443971 0.235409736 Philippines-1.05941793 0.766237007 0.6010607266 -0.071473736 Poland 1.63781408 -0.348361281 -0.0257919744 0.179337045 Portugal -0.33352564 0.216740757 -0.0452993297 -0.181755129 Rumania 0.51161806 0.394841278 0.0856325451 -0.206992718 Singapore -1.14434377 -1.068790135 0.3417011592 -0.338799596 Spain 0.62586977 0.265405133 -0.0949525813 0.021691027 Sweden 1.04263923 -0.144339064 0.1025328504 -0.044472795 Switzerland 0.86021420 -0.178080230 -0.0009573433 0.361336836 Taiwan -0.55013518 0.365172050 -0.0388626904 -0.209802871 Thailand -0.80074552 -0.718955765 -0.4329859758 -0.375276203 Turkey -1.11381623 0.489001441 -0.4128057565 -0.240581646 USA 3.11410100 -0.397644307 0.3158182132 0.357347990 USSR2.30107089 -0.382390458 0.1891648810 0.330762873 Western Samoa -3.87627808 -1.843488955 0.8209468511 0.188597852 I think what is happening is that running2 only has 5 rows while pca$scores has 55 Can anyone help here? Brett Stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Plotting principle components against individual variables
Dear R I am trying to plot some Principle component scores against the individual variables that made the first biplot. First I need to identify some points in the plot as follows running2 <- running[c("USA", "New Zealand", "Dominican Republic", "Western Samoa", "Cook Islands"),] this works fine, I then ask to do a plot plot(running$X100m, running.pca$scores[,1]) this works fine also I then need to specify points to highlight the countries of running2 And this is where I get stuck points(running2$X100m, running.pca$scores, col="red") Error in xy.coords(x, y) : x and y lengths differ What am I doing wrong here Brett Stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Principle Component Loadings
Dear R Could you help here I'm trying to decifer what the principle component loadings are in an R output. Are they in any way related to eigen vectors or eigen values? Brett Stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Principle Component Analysis in R
Dear R Should I be concerned if the loadings to a Principle Component Analysis are as follows: Loadings: Comp.1 Comp.2 Comp.3 Comp.4 X100m -0.500 0.558 0.661 X200m -0.508 0.379 0.362 -0.683 X400m -0.505 -0.274 -0.794 -0.197 X800m -0.486 -0.686 0.486 0.239 Comp.1 Comp.2 Comp.3 Comp.4 SS loadings 1.00 1.00 1.00 1.00 Proportion Var 0.25 0.25 0.25 0.25 Cumulative Var 0.25 0.50 0.75 1.00 I just got concerned that no loading value was given for X100m, component 3. I have looked at the data using list() and it all seems OK brett stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Subject [applying labels to a scatter plot matrix]
Dear R Is there a way to apply row names as labels to a scatter plot matrix , I tried pairs(dogs, labels=row.names) Error in strwidth(labels, "user") : cannot coerce type closure to character vector I'm not sure what this means, however maybe you might know of a way to do this? brett stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] font sizes for row.names of dendograms
Dear R I recently performed a cluster analysis. It produced the dendogram no problem but unfortunately the font size of the row.names were all cluttered due to their large size So I tried to change the font size using plclust(cluster.results, labels=iris$specie, cex=0.8) and R came back to me saying Error in plclust(cluster.results, labels = iris$specie, cex = 0.8) : unused argument(s) (cex ...) > what am I doing wrong here brett stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Complete Linkage Clustering techniques
Dear R I recently asked for a cluster analysis Using * cluster.results <- hclust(iris.dist, method="complete") * but nothing happened i.e the previous scatterplot matrix still showed up whereas I was expecting a dendogram. Could it be that because I had used cutree before on the scatter plots that it somehow mucked it up. I tried detach then attach and commenced making the data matrix again and followed the procedures through. Not sure what I've done wrong here, can anyone help me brett stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Highlighting points in a scatter plot matrix
Dear R I recently did a scatterplot matrix using the following command pairs(sleep[c("SlowSleep", "ParaSleep", "logbw", "logbrw", "loglife", "loggest")],col=1+as.integer(ParaSleep > 5.5 | SlowSleep > 15.7)) this highlighted outlying points for some of the x,y plots that I needed to identify. Unfortunately this highlights all the x,y plots some for which these points are not necessarily outliers. Is there a way to specify highlighting selected points at selected x,y plots within a matrix? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] NaN
Dear R What does NaN mean? I recently did a correlation on a batch of data for some reason it didn't like one column cor(sleep,use="complete.obs") BodyWt BrainWt SlowSleep ParaSleep TotalSleep BodyWt 1. 0.95584875 -0.3936373 -0.07488845 -0.3428373 BrainWt 0.95584875 1. -0.3867947 -0.07427740 -0.3370815 SlowSleep -0.39363729 -0.38679474 1.000 0.51824287 0.9676730 ParaSleep -0.07488845 -0.07427740 0.5182429 1. 0.7171864 TotalSleep -0.34283732 -0.33708151 0.9676730 0.71718643 1.000 Lifespan 0.46982146 0.62938940 -0.3722345 -0.26834006 -0.3824462 Gestation0.71434413 0.73353206 -0.6061048 -0.40893177 -0.6144743 PredIndex0.09588524 -0.01538017 -0.3526558 -0.39795310 -0.4047155 ExposeIndex 0.40563880 0.32318968 -0.5802789 -0.50363338 -0.6213578 DangerIndex 0.25932512 0.15093686 -0.5346247 -0.57194862 -0.6043029 logbrw 0.47461094 0.53992522 -0.6302266 -0.36884187 -0.6223073 loglife 0.37351520 0.45819097 -0.3549184 -0.38521174 -0.4028017 loggest 0.41308558 0.45045240 -0.5754478 -0.57234786 -0.6376850 logbw0.50905390 0.52255094 -0.6603217 -0.26930774 -0.6174775 logpara NaN NaNNaN NaNNaN Lifespan Gestation PredIndex ExposeIndex DangerIndex BodyWt 0.46982146 0.71434413 0.09588524 0.4056388 0.25932512 BrainWt 0.62938940 0.73353206 -0.01538017 0.3231897 0.15093686 SlowSleep -0.37223446 -0.60610477 -0.35265576 -0.5802789 -0.53462471 ParaSleep -0.26834006 -0.40893177 -0.39795310 -0.5036334 -0.57194862 TotalSleep -0.38244618 -0.61447431 -0.40471545 -0.6213578 -0.60430286 Lifespan 1. 0.64638866 -0.16973575 0.3157456 0.01468596 Gestation0.64638866 1. 0.09079823 0.5734727 0.30623551 PredIndex -0.16973575 0.09079823 1. 0.6256876 0.92731729 ExposeIndex 0.31574564 0.57347265 0.62568764 1.000 0.78980702 DangerIndex 0.01468596 0.30623551 0.92731729 0.7898070 1. logbrw 0.73584286 0.78178948 0.07112786 0.6132218 0.28600619 loglife 0.87677362 0.63260838 -0.09023386 0.5042496 0.14082719 loggest 0.56014783 0.88539870 0.09040680 0.5830778 0.30998808 logbw0.64683285 0.75938272 0.13046983 0.6473671 0.33957121 logpara NaN NaN NaN NaN NaN logbrw loglifeloggest logbw logpara BodyWt 0.47461094 0.37351520 0.4130856 0.5090539 NaN BrainWt 0.53992522 0.45819097 0.4504524 0.5225509 NaN SlowSleep -0.63022657 -0.35491836 -0.5754478 -0.6603217 NaN ParaSleep -0.36884187 -0.38521174 -0.5723479 -0.2693077 NaN TotalSleep -0.62230729 -0.40280169 -0.6376850 -0.6174775 NaN Lifespan 0.73584286 0.87677362 0.5601478 0.6468328 NaN Gestation0.78178948 0.63260838 0.8853987 0.7593827 NaN PredIndex0.07112786 -0.09023386 0.0904068 0.1304698 NaN ExposeIndex 0.61322176 0.50424965 0.5830778 0.6473671 NaN DangerIndex 0.28600619 0.14082719 0.3099881 0.3395712 NaN logbrw 1. 0.79233406 0.7771888 0.9514144 NaN loglife 0.79233406 1. 0.6417551 0.7079108 NaN loggest 0.77718882 0.64175514 1.000 0.7069276 NaN logbw0.95141435 0.70791078 0.7069276 1.000 NaN logpara NaN NaNNaNNaN 1 for some reason log para has this NaN symbol come up __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
I recently tried to make R highlight certain features in a scatterplot matrix pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5)) this worked fine but when I wanted to add another condition i.e where another variable SlowSleep = 7.7, this is what I got > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5 & SlowSleep=7.7)) Error: syntax error > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5 & SlowSleep= 7.7)) Error: syntax error > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5 & SlowSleep = 7.7)) Error: syntax error I then tried two separate col statements as below > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5) * col1=2+as.integer(SlowSleep = 7.7)) Error: syntax error > pairs(sleep[c("SlowSleep", "ParaSleep", "logbrw", "loglife", "loggest", "logbw")], * col=1+as.integer(ParaSleep > 5.5) * col=2+as.integer(SlowSleep = 7.7)) Error: syntax error But still no joy, can you recommend anything brett. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
Dear R I recently created some variables in R as in I opened a data set and then produced log base 10 transformations on some of the variables. When I ask R to do a simple x, y plot it recognises the raw data but does not recognise the log transformed variables. It says > plot(logbrw, ParaSleep, type="n") Error in plot(logbrw, ParaSleep, type = "n") : Object "logbrw" not found > text(logbrw, ParaSleep, labels=row.names(sleep), cex=0.8, col="blue") Error in text(logbrw, ParaSleep, labels = row.names(sleep), cex = 0.8, : Object "logbrw" not found So do I have to somehow change the data for R to recognise the newly created variables? What should I do? brett __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
Dear R I'm trying to do a correlation matrix for some variables I have. Unfortunately there are some NA entries for some of the variables I tried the following cor(sleep[c("logbw", "logbrw", "SlowSleep", "ParaSleep", "loglife", "loggest")]) but it told me Error in cor(sleep[c("logbw", "logbrw", "SlowSleep", "ParaSleep", "loglife", : missing observations in cov/cor How can I get R to conduct a correlation matrix for this data set?? brett __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
Dear R help Is there a way for R to ignore NA entries in a data set. I find I can do box plots for certain columns that have no NA entries but cannot do histograms or boxplots for the other columns that have NA entries Brett Stansfield __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
Dear R Can you tell me how to change the working directory of R It's just that I have some text files that I wish to save separately from the R filing structure eg. into C:/my documents and need to change the working directory of R so that it reads these files . This means if I ever upgrade the current version of R nothing will be effected. brett Brett Stansfield Environmental Scientist - Water Quality Hawke's Bay Regional Council 102 Vautier Street Private Bag 6006 Napier Phone (06) 835-9200 extn 9334 Fax (06) 835-3601 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
Average Monthly Temperatures at Nottingham, 1920-1939 precip Annual Precipitation in US Cities presidents Quarterly Approval Ratings of US Presidents pressureVapor Pressure of Mercury as a Function of Temperature quakes Locations of Earthquakes off Fiji randu Random Numbers from Congruential Generator RANDU rivers Lengths of Major North American Rivers rockMeasurements on Petroleum Rock Samples sleep Student's Sleep Data stack.loss (stackloss) Brownlee's Stack Loss Plant Data stack.x (stackloss) Brownlee's Stack Loss Plant Data stackloss Brownlee's Stack Loss Plant Data state.abb (state) US State Facts and Figures state.area (state) US State Facts and Figures state.center (state)US State Facts and Figures state.division (state) US State Facts and Figures state.name (state) US State Facts and Figures state.region (state)US State Facts and Figures state.x77 (state) US State Facts and Figures sunspot.month Monthly Sunspot Data, 1749-1997 sunspot.yearYearly Sunspot Data, 1700-1988 sunspotsMonthly Sunspot Numbers, 1749-1983 swiss Swiss Fertility and Socioeconomic Indicators (1888) Data treeringYearly Treering Data, -6000-1979 trees Girth, Height and Volume for Black Cherry Trees uspop Populations Recorded by the US Census volcano Topographic Information on Auckland's Maunga Whau Volcano warpbreaks The Number of Breaks in Yarn during Weaving women Average Heights and Weights for American Women Use 'data(package = .packages(all.available = TRUE))' to list the data sets in all *available* packages. Brett Stansfield Environmental Scientist - Water Quality Hawke's Bay Regional Council 102 Vautier Street Private Bag 6006 Napier Phone (06) 835-9200 extn 9334 Fax (06) 835-3601 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] FW: Document1
> -Original Message- > From: Brett Stansfield > Sent: Wednesday, 19 January 2005 4:25 p.m. > To: '[EMAIL PROTECTED]' > Subject: Document1 > > <> I was trying to get R to analyse one variable of the file > Chicken Weight. when I ask > > hist(data$weight) > R says "x must be numeric" > yet when I check the data using Editor, it says quite clearly that > variable name weight is numeric. > what am I doing wrong here? I have attached a view from the console > > Brett > Brett Stansfield > Environmental Scientist - Water Quality > Hawke's Bay Regional Council > 102 Vautier Street > Private Bag 6006 > Napier > Phone (06) 835-9200 extn 9334 > Fax (06) 835-3601 > > __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] FW: Document1
> -Original Message- > From: Brett Stansfield > Sent: Wednesday, 19 January 2005 4:25 p.m. > To: '[EMAIL PROTECTED]' > Subject: Document1 > > <> I was trying to get R to analyse one variable of the file > Chicken Weight. when I ask > > hist(data$weight) > R says "x must be numeric" > yet when I check the data using Editor, it says quite clearly that > variable name weight is numeric. > what am I doing wrong here? I have attached a view from the console > > Brett > Brett Stansfield > Environmental Scientist - Water Quality > Hawke's Bay Regional Council > 102 Vautier Street > Private Bag 6006 > Napier > Phone (06) 835-9200 extn 9334 > Fax (06) 835-3601 > > __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] selecting subsets of data for analysis
can you tell me how to ask R to analyse a subset of data eg. supposing the data set consists of 9 columns and I only want R to analyse columns 1, 3 and 5 how would I command R to conduct eg. boxplots of those variables only? thanks brett Brett Stansfield Environmental Scientist - Water Quality Hawke's Bay Regional Council 102 Vautier Street Private Bag 6006 Napier Phone (06) 835-9200 extn 9334 Fax (06) 835-3601 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html