[R] row sum with all absence in a presence-absence matrix

2013-10-08 Thread Elaine Kuo
Dear list I have a matrix composed of islandID as rows and speciesID as columns. IslandID: Island A, B, C….O (15 islands in total) SpeciesID: D0001, D0002, D0003….D0100 (100 species in total) The cell of the matrix describes presence (1) or absence (0) of the species in an island. Now I

[R] Compare species presence and absence between sites

2013-09-27 Thread Elaine Kuo
Dear List, I want to compare the presence and absence of bird species based on the sites in a matrix. The matrix has 5 rows for Island A, B, C, D, and E. It has 100 columns for bird species D001-D100. In each cell of the matrix, the presence-absence of bird species will be recorded as 1 or

Re: [R] Compare species presence and absence between sites

2013-09-27 Thread Elaine Kuo
,]))}) #using Rui's function names(lst1)- paste(dat1[,1],dat1[,2],sep=_) A.K. - Original Message - From: Rui Barradas ruipbarra...@sapo.pt To: Elaine Kuo elaine.kuo...@gmail.com Cc: r-help@r-project.org r-help@r-project.org Sent: Friday, September 27, 2013 7:39 AM Subject: Re

[R] search species with all absence in a presence-absence matrix

2013-09-20 Thread Elaine Kuo
Dear list I have a matrix composed of islandID as rows and speciesID as columns. IslandID: Island A, B, C….O (15 islands in total) SpeciesID: D0001, D0002, D0003….D0100 (100 species in total) The cell of the matrix describes presence (1) or absence (0) of the species in an island. Now I

[R] to retrieve specific data from a matrix

2013-09-11 Thread Elaine Kuo
Dear list, I want to retrieve a specific data from a matrix with 3000 columns. The matrix has island ID as its rows and species ID as its columns. There are 20 rows and 3000 columns in the matrix. (Island ID: Species 1- Species 20/ species ID: Species 1- Species 3000) The contents of the matrix

Re: [R] merge matrix row data

2013-08-01 Thread Elaine Kuo
(mat1)),];!!colSums(x1)})) #D0989 D9820 D5629 D4327 D2134 #IslandA TRUE TRUE FALSE TRUE FALSE #IslandB FALSE TRUE TRUE FALSE TRUE # *1 will replace TRUE with 1 and FALSE with 0. A.K. From: Elaine Kuo elaine.kuo...@gmail.com To: arun

Re: [R] merge matrix row data

2013-08-01 Thread Elaine Kuo
- mat1[match(gsub(.*\\s+,,get(x)),mat1[,1]),-1];(!!colSums(x1))*1})) #D0989 D9820 D5629 D4327 D2134 #IslandA 1 1 0 1 0 #IslandB 0 1 1 0 1 A.K. From: Elaine Kuo elaine.kuo...@gmail.com To: arun smartpink

Re: [R] merge matrix row data

2013-08-01 Thread Elaine Kuo
:24 PM, Elaine Kuo elaine.kuo...@gmail.com wrote: Hello Arun Thank for comments. You are right. GID is the first column in the matrix this time. In the second row of the first column, it used to be GID 1 in the first e-mail. But you are also right. You answered it already, and this time

[R] merge matrix row data

2013-07-31 Thread Elaine Kuo
Dear list, I have a matrix showing the species presence-absence on a map. Its rows are map locations, represented by GridCellID, such as GID1 and GID 5. Its columns are species ID, such as D0989, D9820, and D5629. The matrix is as followed. Now I want to merge the GridCellID according to

Re: [R] merge matrix row data

2013-07-31 Thread Elaine Kuo
)),];(!!colSums(x1))*1} )) res #D0989 D9820 D5629 D4327 D2134 #IslandA 1 1 0 1 0 #IslandB 0 1 1 0 1 A.K. - Original Message - From: Elaine Kuo elaine.kuo...@gmail.com To: r-h...@stat.math.ethz.ch r-h...@stat.math.ethz.ch Cc: Sent

Re: [R] [R-sig-eco] extract beta.sim from dist type data (package betapart)

2013-07-19 Thread Elaine Kuo
sarah.gos...@gmail.comwrote: Replied to on the R-sig-ecology list, with a request not to cross-post. Briefly, the output is a list with named components, so can be extracted as usual. Sarah On Wed, Jul 17, 2013 at 5:50 AM, Elaine Kuo elaine.kuo...@gmail.com wrote: Dear List

[R] how to calculate the average values of each row in a matrix

2013-07-19 Thread Elaine Kuo
Hello, I have a matrix (class matrix) composed of GridCell (row and column). The matrix value is the beta diversity index value between two grids. Now I would like to get the average value of each GridCell. Please kindly advise how to make the calculation. Thank you. Elaine The matrix looks

[R] extract beta.sim from dist type data (package betapart)

2013-07-17 Thread Elaine Kuo
Dear List, This is Elaine. I am using beta.part to calculate the beta diversity index. The function of beta.part can generate three kinds of beta diversity indice at one time. However, it is Simpson index that I want. The calculation result is composed of three rows and N/A columns (dist class).

Re: [R] error of betadiver in vegan

2013-07-12 Thread Elaine Kuo
) ## The beta sim index (Lennon 2001) d - betadiver(dataR, sim) On Fri, Jul 12, 2013 at 2:13 PM, Jari Oksanen jari.oksa...@oulu.fi wrote: Elaine Kuo elaine.kuo.tw at gmail.com writes: Hello, I am using betadiver (vegan) to calculate beta diversity. However, an error message shows

[R] memory problem of betadiver of vegan

2013-07-12 Thread Elaine Kuo
Hello List, This is Elaine. I am running betadiver for a dataset of 4873 rows and 2749 columns. (4873 rows = 4873 gridcell of the study region and 2749 columns for the bird species) The dataset was produced by combing 5 dbf. When running the code o, an error message jumped out, saying Error:

Re: [R] memory problem of betadiver of vegan

2013-07-12 Thread Elaine Kuo
Hello List, I solved the problem by using the code with 31 votes http://stackoverflow.com/questions/1358003/tricks-to-manage-the-available-memory-in-an-r-session On Sat, Jul 13, 2013 at 6:15 AM, Elaine Kuo elaine.kuo...@gmail.com wrote: Hello List, This is Elaine. I am running betadiver

[R] error of betadiver in vegan

2013-07-11 Thread Elaine Kuo
Hello, I am using betadiver (vegan) to calculate beta diversity. However, an error message shows Error in ifelse(x 0, 1, 0) : (list) object cannot be coerced to type 'double' R version: 3.0.0 Please kindly advise how to solve the issue. Also, please kindly tell if any more information is

[R] pearson correlation significant level

2013-05-17 Thread Elaine Kuo
Hello I am using package Hmisc to calculate the pearson correlation and the significant level for the matrix of t_i and t_r. (temperature minimum and temperature range) However, I have difficulty interpreting the result, even after checking the manual. Please kindly help to indicate if the

Re: [R] R package for bootstrapping (comparing two quadratic regression models)

2013-05-06 Thread Elaine Kuo
, the second one does not. Isn't y2 in the second equation equal to the estimated y1 from the first equation? You need to talk with someone about what you have, where it came from, and what questions you are trying to answer. Jean On Fri, May 3, 2013 at 6:08 PM, Elaine Kuo elaine.kuo

[R] slope coefficient of a quadratic regression bootstrap

2013-05-05 Thread Elaine Kuo
Hello, I want to know if two quadratic regressions are significantly different. I was advised to make the test using step 1 bootstrapping both quadratic regressions and get their slope coefficients. (Let's call the slope coefficient *â*^1 and *â*^2) step 2 use the slope difference

Re: [R] slope coefficient of a quadratic regression bootstrap

2013-05-05 Thread Elaine Kuo
} boot.fit2 - boot(dataN, function.fit2, 1000) On Mon, May 6, 2013 at 7:36 AM, Elaine Kuo elaine.kuo...@gmail.com wrote: Hello, I want to know if two quadratic regressions are significantly different. I was advised to make the test using step 1 bootstrapping both quadratic regressions

[R] compare two quadratic regression using bootstrap

2013-05-05 Thread Elaine Kuo
Hello, I want to know if two quadratic regressions are significantly different. I was advised to make the test using step 1 bootstrapping both quadratic regressions and get their slope coefficients. (Let's call the slope coefficient *â*^1 and *â*^2) step 2 use the slope difference

Re: [R] significantly different from one (not zero) using lm

2013-05-04 Thread Elaine Kuo
), lower.tail = FALSE, df = lm1$df.residual) myt (Intercept) x -9.550359 -9.158166 mypval (Intercept)x 1.145542e-15 8.126553e-15 On Tue, Apr 30, 2013 at 9:07 PM, Elaine Kuo elaine.kuo...@gmail.com wrote: Hello, I am work with a linear regression model

[R] significant test of two quadratic regression models (lm)

2013-05-03 Thread Elaine Kuo
Hello, I am work with two quadratic regression models y=ax^2+bx+c with the function of lm. y1= observed migration distance of butterflies(y1=a1x^2+b1x+c1) y2= predicted migration distance of butterflies (based on body mass) (y2=a2x^2+b2x+c2) x= body mass of butterflies Now I would like to

[R] R package for bootstrapping (comparing two quadratic regression models)

2013-05-03 Thread Elaine Kuo
Hello , I want to compare two quadratic regression models with non-parametric bootstrap. However, I do not know which R package can serve the purpose, such as boot, rms, or bootstrap, DeltaR. Please kindly advise and thank you. Elaine The two quadratic regression models are y1=a1x^2+b1x+c1

[R] significantly different from one (not zero) using lm

2013-04-30 Thread Elaine Kuo
Hello, I am work with a linear regression model: y=ax+b with the function of lm. y= observed migration distance of butterflies x= predicted migration distance of butterflies Usually the result will show if the linear term a is significantly different from zero based on the p-value. Now

[R] MOS-test using package vegan

2013-04-20 Thread Elaine Kuo
Dear all, I am using MOStest in vegan to examine the hump-shaped of a quadratic regression model. In the manual of vegan, it mentions that the value of MOStest include isHump. My result showed the quadratic regression is hump-shaped according to the p-value (nearly 0). However, the value isHump

[R] failed to download vegan

2013-04-16 Thread Elaine Kuo
Hello, This is Elaine. I am using R 3.0 to download package vegan but failed. The warning message is package ‘vegan’ successfully unpacked and MD5 sums checked Warning: unable to move temporary installation ‘C:\Users\elaine\Documents\R\win-library\3.0\file16c82da53b1b\vegan’ to

Re: [R] failed to download vegan

2013-04-16 Thread Elaine Kuo
Hello All, I manually moved the vegan.zip to ‘C:\Users\elaine\Documents\R\ win-library\3.0\vegan’. Then unzipping the file. It worked to require vegan Elaine On Wed, Apr 17, 2013 at 8:56 AM, Elaine Kuo elaine.kuo...@gmail.com wrote: Hello, This is Elaine. I am using R 3.0 to download

[R] put strip below the panel (dotplot)

2013-02-28 Thread Elaine Kuo
Hello I am using lattice dotplot and I would like to put the strip under the panel. I found the code “strip” is for the strip above the panel, and “strip.left” for the strip left to the panel. Please kindly advise how to write the code for the strip under the panel Thank you Elaine

[R] resizing panels but some strip letters disappeared (dotplot)

2013-02-28 Thread Elaine Kuo
Hello, I am using library(latticeExtra) resizePanels to have better visual display in dotplot (lattice). However, some panels became smaller and the strip letters of those panels were partially missing. Please kindly advise how to keep all strip letters remaining when resizing panels. Thank you.

Re: [R] locating boxplot in bwplot (lattice)

2013-02-27 Thread Elaine Kuo
Hello, I used group in dotplot to classify diet by colors. Elaine On Mon, Feb 25, 2013 at 6:27 AM, Elaine Kuo elaine.kuo...@gmail.com wrote: Hello sorry that I did not make the letter clearly stated. Now I have 21 boxplots (No. 1, No. 2No. 21 from the left to the right)(lattice). I

Re: [R] locating boxplot in bwplot (lattice)

2013-02-24 Thread Elaine Kuo
Martínez armand...@gmail.com wrote: Hi Elaine, In your dataset create a vector with the order in which you want appear the levels, then use that vector in the argument reorder. Andrés AM El 24/02/2013, a las 00:59, Elaine Kuo elaine.kuo...@gmail.com escribió: Hello, I tried

Re: [R] locating boxplot in bwplot (lattice)

2013-02-24 Thread Elaine Kuo
, No. become red.) Please kindly advise R-code that can specify the red color for No. 1 and 2, the blue color for the rest. Thanks again. Elaine On Mon, Feb 25, 2013 at 4:17 AM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2013-02-24 03:50, Elaine Kuo wrote: Hello Thank you for the advice

Re: [R] locating boxplot in bwplot (lattice)

2013-02-23 Thread Elaine Kuo
:29 AM, Ben Bolker bbol...@gmail.com wrote: Elaine Kuo elaine.kuo.tw at gmail.com writes: Hello I am using lattice bwplot to draw migration distance of three groups of birds. The boxplots from the left to right is displayed in alphabetic order of the boxplot names, as the default

[R] locating boxplot in bwplot (lattice)

2013-02-22 Thread Elaine Kuo
Hello I am using lattice bwplot to draw migration distance of three groups of birds. The boxplots from the left to right is displayed in alphabetic order of the boxplot names, as the default setting. However, I would like the boxplots from the left to right to be displayed according to the

[R] how to make a median line thicker in bwplot (lattice)

2013-02-11 Thread Elaine Kuo
Hello, I am drawing a boxplot using bwplot in lattice. I would like to learn how to draw a thicker median line instead of the default setting. Thank you. Code bwplot(, pch=rep(|,2)) Elaine [[alternative HTML version deleted]] __

[R] how to change whisker width in bwplot (lattice)

2013-02-11 Thread Elaine Kuo
Hello, I am using lattice to draw boxplots. I would like to make the whisker look shorter than the box width. Please kindly advise how to modify the code. Thank you. Elaine code bwplot(x,y, pch=rep(|,2), box.umbrella = list(col = black, lty = 1)) [[alternative HTML version deleted]]

[R] how to draw confidence interval lines of a fitted curve of polynominal regression

2013-02-06 Thread Elaine Kuo
Hello, I drew a plot of weight and height of people and fitted it with a polynominal regression x^2. (using curve()) Now I would like to draw the confidence interval line for the fitted curve. Please kindly advise the code for the purpose. Thank you. Elaine [[alternative HTML version

[R] customize color in xyplot

2013-01-12 Thread Elaine Kuo
Hello I want to draw a plot and classify the dot by different color, according to the habitats. I am using xyplot in lattice but do not know how to assign specific colors to the habitats. Please kindly advise how to modify the code. Thank you. Elaine code dataN

[R] add categorical labels in plot

2013-01-11 Thread Elaine Kuo
Hello I want to draw a plot using the code below. Further, I want to add labels (White, Yellow, Red) to x-axis. Please kindly advise how to add the categorical labels, by modifying the code. Thank you. Elaine Code dataN -read.csv(H:/skin_color.csv,header=T, row.names=1) dim(dataN)

[R] two-group comparison in boxplot

2013-01-11 Thread Elaine Kuo
Hello I have a data composing three columns: body weight, body length, and sex. I want to draw a box plot, X-axis for body weight, Y-axis for body length. In the boxplot, I want to compare the body length between two sexes of three groups of body weight: 50, 51-100, 101 kg. (For instance,

[R] how to change font size of axis label (not axis title)

2013-01-11 Thread Elaine Kuo
Hello, I am using lattice to produce xyplot. I want to change the font size of axis-X label. Please kindly advise how to write the code. Thank you. For changing the font size of axis-X title it would be xlab=list(Diet of Breeding Ground, cex = 1.4) Elaine [[alternative HTML version

[R] panel failure in xyplot

2013-01-11 Thread Elaine Kuo
Hello I ran the code below but it said: no object 'panel.xyplot.intermediate.hh' Please kindly advise how to modify the code. thank you. (It works with panel.bwplot.intermediate.hh) Elaine code library(HH) # data input dataN -read.csv(H:/R_data/Mig_bird_586.csv,header=T, row.names=1)

[R] color in xyplot

2013-01-11 Thread Elaine Kuo
Hello I want to draw a xyplot. Its dots will have three colors: red for meat, green for vegetable, and blue for both. I used the code below but could not make the dot in the same group show the same color. Please kindly advise how to modify it. Thank you. code library (lattice) diet.code -

[R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
Hello, I have data of Body length and Body weight of 8 boys and 7 girls. I want to draw the plot of Body length (for X) and Body weight (for Y) based on sex. Then the two plots want to be overlapped for comparison. I used the code below but found the unit length of X axis of boy and girl plot

Re: [R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Elaine Kuo Sent: Monday, January 07, 2013 9:27 AM To: r-help@r-project.org Subject: [R] plot xaxp issue Hello, I have data of Body length and Body weight of 8 boys and 7 girls. I want to draw

Re: [R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
places. Elaine On Mon, Jan 7, 2013 at 8:11 PM, Elaine Kuo elaine.kuo...@gmail.com wrote: Thanks a lot. Please kindly indicate the meaning of the c(8,7). together - rbind(boy, girl) together$sex - factor(rep(c(boy, girl), c(8,7))) Elaine On Mon, Jan 7, 2013 at 4:55 PM, PIKAL Petr petr.pi

Re: [R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
Hello, Thanks again. But something wrong with the subset after lm It is not about drawing plot many times but coding points or graphic objects by some factor. In your case sex. Instead of boyline-lm(body_weight ~ body_length, boy) use collective data frame together and subset only one

Re: [R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
On Tue, Jan 8, 2013 at 8:40 AM, Elaine Kuo elaine.kuo...@gmail.com wrote: boyline-lm(body_weight ~ body_length, data=together, subset(together,sex==boy)) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] error in a abline loop

2013-01-07 Thread Elaine Kuo
Hello I have data of body length and body weight of people of different skin colors. I tried to write a code to plot body length and body weight according to the skin colors. (Thanks for Petr's advice so far.) A loop is used but an error shows up in the following code. It says: unexpected '}'

Re: [R] error in a abline loop

2013-01-07 Thread Elaine Kuo
==levels(data$skin_color)[i] line-lm(body_weight~body_length, data=subset(data, subset=subs)) #closing parentheses abline(line,col=c(yellow,chocolate1,darkorange2, red3,saddlebrown,coral4,grey38)[i],lwd=2) } A.K. - Original Message - From: Elaine Kuo elaine.kuo

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
--- David From: Elaine Kuo [mailto:elaine.kuo...@gmail.com] Sent: Sunday, December 16, 2012 5:17 PM To: dcarl...@tamu.edu; r-help@r-project.org; r-sig-...@stat.math.ethz.ch Subject: Re: [R] averaging X of specific Y (latitude) Thank you, David. Your answer reminded me of rearranging the order

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
Thank you, Berend. I tried 1. dput (datam, datam) 2. dput (datam) both worked Elaine On Mon, Dec 17, 2012 at 7:30 PM, Berend Hasselman b...@xs4all.nl wrote: On 17-12-2012, at 12:06, Elaine Kuo wrote: Hello, Thank you again, David. I tried with the first step of the command deput

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
)), .Names = c(Species, Range, + Latitude), class = data.frame, row.names = c(NA, -11L))) - Original Message - From: David L Carlson dcarl...@tamu.edu To: 'Elaine Kuo' elaine.kuo...@gmail.com; r-help@r-project.org; 'r-sig-geo' r-sig-...@stat.math.ethz.ch Cc: Sent: Sunday

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
(9.45, 10.2, 9.3, 16.4, 10.54, 10.87, + 16.79, 18.3, 12.98, 12.67, 18.07)), .Names = c(Species, Range, + Latitude), class = data.frame, row.names = c(NA, -11L))) Elaine On Mon, Dec 17, 2012 at 7:40 PM, Elaine Kuo elaine.kuo...@gmail.com wrote: One more question: Please kindly explain why

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
. ** ** -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 ** ** *From:* Elaine Kuo [mailto:elaine.kuo...@gmail.com] *Sent:* Monday, December 17, 2012 5:56 AM *To:* dcarl...@tamu.edu; r-help@r

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
of Anthropology Texas AM University College Station, TX 77843-4352 From: Elaine Kuo [mailto:elaine.kuo...@gmail.com] Sent: Monday, December 17, 2012 6:37 PM To: dcarl...@tamu.edu Cc: r-help@r-project.org Subject: Re: [R] averaging X of specific Y (latitude) Thank you, David. Now I know how to use

Re: [R] averaging X of specific Y (latitude)

2012-12-16 Thread Elaine Kuo
calculation? Thank you. Elaine - Original Message - From: David L Carlson dcarl...@tamu.edu To: 'Elaine Kuo' elaine.kuo...@gmail.com; r-help@r-project.org; 'r-sig-geo' r-sig-...@stat.math.ethz.ch Cc: Sent: Sunday, December 16, 2012 11:32 AM Subject: Re: [R] averaging X of specific Y

[R] average X value of specific Y

2012-12-15 Thread Elaine Kuo
Hello I have a table describing butterfly range traits. It is composed of three columns as below Species name range size (X)latitude of range midpoint (Y) There are 11 kinds of butterflies. Each has its range size, and the latitude of each range midpoint ranges from 9 to 19. I

[R] averaging X of specific Y (latitude)

2012-12-15 Thread Elaine Kuo
Hello I have a table describing butterfly range traits. It is composed of three columns as below Species name range size (X)latitude of range midpoint (Y) There are 11 kinds of butterflies. Each has its range size, and the latitude of each range midpoint ranges from 9 to 19. I

Re: [R] [R-sig-Geo] averaging X of specific Y (latitude)

2012-12-15 Thread Elaine Kuo
...@r-project.org [r-sig-geo-boun...@r-project.org] on behalf of Elaine Kuo [elaine.kuo...@gmail.com] Sent: Saturday, December 15, 2012 10:15 PM To: r-help@r-project.org; r-sig-geo Subject: [R-sig-Geo] averaging X of specific Y (latitude) Hello I have a table describing butterfly range traits

Re: [R] change lm log(x) to glm poisson

2012-10-30 Thread Elaine Kuo
and the concept of link functions. Cheers, Josh On Sun, Oct 28, 2012 at 8:01 PM, Elaine Kuo elaine.kuo...@gmail.com wrote: Hello list, I am running a regression using lm(Y~A+B+log(C)+log(D)) Now, I would like to test if glm can produce similar results. So the code

[R] change lm log(x) to glm poisson

2012-10-28 Thread Elaine Kuo
Hello list, I am running a regression using lm(Y~A+B+log(C)+log(D)) Now, I would like to test if glm can produce similar results. So the code was revised as glm(Y~A+B+C+D, family=poisson) (code 1) However, I found some example using glm for lm. It suggests that the code should be revised

[R] lm and glm

2012-10-23 Thread Elaine Kuo
Dear list, I am making a linear regression of the following format. lm(Y~X1+X2+log(X3)+log(X4)) Now I would like to check the linear regression above using generalized linear model. Please kindly if the following format is correct and thank you. (If it is wrong, please indicate why.)

[R] two indirect effects of path analysis

2012-10-06 Thread Elaine Kuo
Hello, This is Elaine. I am trying a path analysis using lavaan Package. There are three explanatory variables: X, Z, and M. The response variable is Y. A, b, and c have direct effects on Y. On the other hand, X and Z also have direct effects on M. In other words, X and Z have indirect effects

Re: [R] changing outlier shapes of boxplots using lattice

2012-09-28 Thread Elaine Kuo
question, and that reading ?par will tell you why. Sarah On Thursday, September 27, 2012, Elaine Kuo wrote: Hello This is Elaine. I am using package lattice to generate boxplots. Using Richard's code, the display was almost perfect except the outlier shape. Based

[R] changing outlier shapes of boxplots using lattice

2012-09-27 Thread Elaine Kuo
Hello This is Elaine. I am using package lattice to generate boxplots. Using Richard's code, the display was almost perfect except the outlier shape. Based on the following code, the outliers are vertical lines. However, I want the outliers to be empty circles. Please kindly help how to modify

Re: [R] boxplot of different colors

2012-09-25 Thread Elaine Kuo
=panel.bwplot.intermediate.hh, col=Diet.colors, pch=rep(|,13), scales=list(x=list(rot=90)), par.settings=list(box.umbrella=list(lty=1))) On Mon, Sep 24, 2012 at 11:13 PM, Elaine Kuo elaine.kuo...@gmail.comwrote: Hello Richard, Your answer is a great help to my problem

[R] boxplot of different colors

2012-09-24 Thread Elaine Kuo
Hello, I am making a boxplot of 13 boxes. I tried to color the box using 13 colors but failed. Only red and brown were displayed. Green, blue, and grey disappeared. Please kindly advise modification after checking the code below. Thank you in advance. Elaine R code # data input dataN

Re: [R] boxplot of different colors

2012-09-24 Thread Elaine Kuo
= 1.4), panel=panel.bwplot.intermediate.hh, col=Diet.colors, pch=rep(|,13)) On Mon, Sep 24, 2012 at 6:23 PM, Elaine Kuo elaine.kuo...@gmail.comwrote: Hello, I am making a boxplot of 13 boxes. I tried to color the box using 13 colors but failed. Only red and brown were

Re: [R] boxplot of different colors

2012-09-24 Thread Elaine Kuo
. Sarah On Mon, Sep 24, 2012 at 6:23 PM, Elaine Kuo elaine.kuo...@gmail.com wrote: Hello, I am making a boxplot of 13 boxes. I tried to color the box using 13 colors but failed. Only red and brown were displayed. Green, blue, and grey disappeared. Please kindly advise modification

[R] boxplot of multi box color

2012-09-24 Thread Elaine Kuo
Hello, I want to draw a boxplot using 13 colors for 13 boxes. Each box represents a type of diet of birds. Y axis is the breeding range of the birds. I checked the previous r-help and found a possible solution. However, it did not work by showing error in ncol(Diet_B), Diet_B not found. Please

[R] To predict Y based on only one sample of X and Y

2012-08-27 Thread Elaine Kuo
Hello I want to predict wing length using regression commands. (lm and predict) The data details are as followed Data: Bird physiological data 1. body mass 2. body length 3. wing length Data type: Order A: consisting of 20 species, body mass and length of all 20 species are

[R] how to generate response variables using simple regression

2012-08-26 Thread Elaine Kuo
Hello, I have weight and wing length data of 5 kinds of birds (B1 to B5). Weight data (predictor) and wing data (response) were used to generated a simple regression. (using lm) Now some weight data are found but without wing data (B6, B7). I want to use the generated simple regression to

Re: [R] how to print km square in the form of km2

2012-02-29 Thread Elaine Kuo
...@xtra.co.nz wrote: On 21/02/12 12:54, Elaine Kuo wrote: Hello, This is Elaine. I am drawing a plot with x-axis label with km square as the unit. Now I want to print km square in the form of km2 and output 2 as the uppercase. Please kindly help suggest command to show the uppercase. When

[R] how to print km square in the form of km2

2012-02-20 Thread Elaine Kuo
Hello, This is Elaine. I am drawing a plot with x-axis label with km square as the unit. Now I want to print km square in the form of km2 and output 2 as the uppercase. Please kindly help suggest command to show the uppercase. Thank you. Elaine [[alternative HTML version deleted]]

[R] to check if a group of values is randomly distributed

2011-05-13 Thread elaine kuo
Dear list, I have 603 numbers depicting range sizes of birds in Japan. I would like to learn if the 603 range sizes are randomly distributed or not, in order to check if they meet mid-domain effects. Please kindly advise if any R package or function can check the fit. Also, any more references

[R] How to calculate squared R of spatial autoregressive models

2010-11-21 Thread elaine kuo
Dear List, I am comparing the squared R values of linear models and its spatial autoregressive counterparts. (SARerror) (1. lm (Y~X1) 2. lm (Y~ X1+X2) 3. lm(Y~X1+X2+X3)) The squared R values of linear models are generated by command summary (lm). Similarly, I tried to produce those of

[R] discerning plot dots using colors

2010-10-26 Thread elaine kuo
Dear List, I am using the command plot to present the relationship between bird richness (Y axis) and elevation (X axis). However, I would like to observe the distributions of bird richness in different administrative areas (A, B, C, …., G) in this plot. For example, the dots in area A

[R] delta AIC for models with 2 variables using MuMIn

2010-10-12 Thread elaine kuo
Dear List, I want to ask a AIC question based on package library(MuMIn) The relative importance of 16 explanatory variables are assessed using delta AIC in a generalized linear model. Please kindly advise if it is possible to show models with any two only certain variables. Thank you.

[R] Extracting data subset for plot

2010-10-11 Thread elaine kuo
Dear list, I want to make a plot based on the following information, using the command plot. variable A for x axis : temperature (range: -20 degrees to 40 degree) variable B for y axis : altitude (range: 50 m to 2500 m ) The data below 0 degree of X variable wants to be erased tentatively.

[R] How to set the limit of abline (regression line of lm)

2010-09-20 Thread elaine kuo
Dear List, I ran a regression model using lm and produced a regression line using abline. The line ranges from -20 to 20 in x axis, and the section I only want is from -20 to 0. Please kindly advise any function in abline () to set the range of x axes. Thank you Elaine

[R] how to show the number of each axis interval (plot)

2010-09-20 Thread elaine kuo
Dear List, I am using plot for homework. The x-axis covered from 0 to 80, with 4 intervals. However, the plot only showed 0, 40, 80. 20 and 60 disappeared. Please kindly advise how to show 0, 20, 40, 60, 80 for the axis interval. Thank you. Elaine [[alternative HTML version deleted]]

Re: [R] how to plot y-axis on the right of x-axis

2010-08-25 Thread elaine kuo
code plot(1:5,axes=FALSE) axis(1) axis(4) box() On Wed, Aug 25, 2010 at 5:39 PM, Jim Lemon j...@bitwrit.com.au wrote: On 08/25/2010 09:12 AM, elaine kuo wrote: Dear List, I have a richness data distributing across 20 N to 20 S latitude. (120 E-140 E longitude). I would like to draw

Re: [R] how to plot y-axis on the right of x-axis

2010-08-25 Thread elaine kuo
Yes, I appreciated your answers which well hit my questions. (esp the perfect model parts). About the plot part, one more question. Is it possible to make the two plots (northern and southern richness) sharing the same Y axis (latitude = 0, the equator) ? In other words, southern richness would

[R] how to plot y-axis on the right of x-axis

2010-08-24 Thread elaine kuo
Dear List, I have a richness data distributing across 20 N to 20 S latitude. (120 E-140 E longitude). I would like to draw the richness in the north hemisphere and a regression line in the plot (x-axis: latitude, y-axis: richness in the north hemisphere). The above demand is done using plot.

Re: [R] AIC in MuMIn

2010-08-19 Thread elaine kuo
Please kindly advise if it is possible to show the singular model with only one certain variable using the command subset. (or maybe others) I tried the command subset=X3 but it returned multiple models including X3. The above demand might look unnecessary when visual inspection

Re: [R] AIC in MuMIn

2010-08-18 Thread elaine kuo
Hmmm. Thinking some more, I might not have answered your (unstated) question. What do your mean by GLM? = I meant generalized linear model as well. Thanks for the references. The first one was mentioned first in my life time after keeping asking the same question. I mean the Generalized

Re: [R] AIC in MuMIn

2010-08-18 Thread elaine kuo
Please suggest how to define subset in my case How would I know? I still haven't seen your data. You seem to be mistaken on what is and is not included in your model and you fitted it. What hope do we have...? However, given the model 'mig.stds' from above in this email: mig.stds

Re: [R] AIC in MuMIn

2010-08-18 Thread elaine kuo
at 5:37 PM, elaine kuo elaine.kuo...@gmail.com wrote: Please suggest how to define subset in my case How would I know? I still haven't seen your data. You seem to be mistaken on what is and is not included in your model and you fitted it. What hope do we have...? However, given the model

Re: [R] AIC in MuMIn

2010-08-18 Thread elaine kuo
, subset=X3) On Wed, Aug 18, 2010 at 9:18 PM, Gavin Simpson gavin.simp...@ucl.ac.ukwrote: On Wed, 2010-08-18 at 21:11 +0800, elaine kuo wrote: A cause other than data based on standardized regression was identified. It is that the manual command added with target - at the left hand side. C1

[R] AIC in MuMIn

2010-08-17 Thread elaine kuo
Hello, I am using package MuMIn to calculate AIC for a full model with 10 explanatory variables. Thanks in advance in sharing your experience. Q1 In the AIC list of all models, each model is differentiated by model number. Please kindly advise if it is possible to find the corresponding

Re: [R] AIC in MuMIn

2010-08-17 Thread elaine kuo
Thank you. Most of the answers solved the puzzles. Q2 I tried to display sub-model with only temp_ran using the code below but failed. Please kindly suggest the potential failure cause. code library(MuMIn) datam -read.csv(c:/migration/Mig_ratio_20100817.csv,header=T,

[R] AIC for model selection in Package ‘MuMIn ’

2010-08-16 Thread elaine kuo
Dear List, Ben's recommendation to MuMIn is of great importance to research with over ten independent variables. However, the criteria in this package for model selection are AICc (second-order AIC) and QAIC (quasi-AIC). Please kindly share if it is possible to carry AIC rather than the metrics

Re: [R] AIC for model selection in Package â� �MuMInâ��

2010-08-16 Thread elaine kuo
= AIC) print(dd) Elaine On Mon, Aug 16, 2010 at 9:21 PM, Ben Bolker bbol...@gmail.com wrote: elaine kuo elaine.kuo.tw at gmail.com writes: [re: MuMIn package] However, the criteria in this package for model selection are AICc (second-order AIC) and QAIC (quasi-AIC). Please kindly share

[R] Independent variables omitted in lm and glm

2010-08-16 Thread elaine kuo
Dear List, Some independent variable were missing in calculation using lm and glm (gaussian). (X= Y1+Y2+…..+Y16, Independent number: 16 variable) However, those variables did work well in cor(X, Y) respectively. str(dataframe) was also run to ensure that the variables were all numbers.

Re: [R] Independent variables omitted in lm and glm

2010-08-16 Thread elaine kuo
sorry I forget the attachments Dear List, Some independent variable were missing in calculation using lm and glm (gaussian). (X= Y1+Y2+…..+Y16, Independent number: 16 variable) However, those variables did work well in cor(X, Y) respectively. str(dataframe) was also run to ensure that

[R] how to display delta AIC of all models

2010-08-15 Thread elaine kuo
Dear all, I am making model selection of generalised linear models based on delta AIC, using the command step(AIC). Also, I would like to learn the explanatory powers of each independent variable. To phrase differently, it is in need to show the delta AIC of all models rather than the final

Re: [R] what is scaling in plot

2010-08-14 Thread elaine kuo
: elaine kuo elaine.kuo.tw at gmail.com writes: Pls kindly advise what scaling is in plot. Sometime it could be negative but sometimes it might be positive .(I guess it is the proportion between the plot and the margin) Your question is unclear. Please give more context and/or details

  1   2   >