Displaying 20 results from an estimated 22 matches for "jzhang1982".
2010 Apr 04
2
One question about saving graph by using xyplot
...uot;)
pdf(filename,width=6.5,height=4.5)
plot(lat ~ long, data = quakes)
graphics.off()
}
# I can open the pdf files.
Hope you can help me.
Thanks so much,
---
Jian Zhang
Department of Renewable Resources
University of Alberta
Edmonton, Alberta T6G 2H1, Canada
Phone (office): 780-492-8670
Email: jzhang1982@gmail.com; zjian@ualberta.ca
[[alternative HTML version deleted]]
2007 Jun 22
3
How to run "mathematica" or "c" programs in R?
I have some programs which were writen in mathematica or c language, but I
donot know how to use these software. So I want to run them in R.
Can I do it ?
How to run "mathematica" or "c" programs in R?
Jian Zhang
[[alternative HTML version deleted]]
2006 May 25
1
how to get the data in a circle
I want to get the data in a circle from a large square plot.
If the data includes only two columns or more columns which is number style,
I can do it.
But if the data includes other columns which is not number style (e.g.
species name), I donot know how to do it. And I donot want to delete the
columns because it is useful to me.
e.g. species x y
a 12
2006 May 26
1
I cannot load the package "Rcmdr"
I can load the package in other R file, but I can not do it in the file.
How to solve the question?
> local({pkg <- select.list(sort(.packages(all.available = TRUE)))
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
Loading required package: tcltk
Loading required package: car
Error in parse(file, n, text, prompt) : syntax error in "*"
Error: .onAttach failed in
2007 Jan 23
1
"tapply" and "data.frame"?
I want to transform the data by "tapply" to one dataframe. But I can not get
it.
For example:
> tst=tapply(point,pp,length)
> tst[1:10]
p1 p10 p100 p1000 p1001 p1002 p1003 p1004 p1005 p1006
1 5 1 8 6 5 8 7 4 4
> res=as.data.frame(tst) # I try to transform it
> res[1:10,]
p1 p10 p100 p1000 p1001 p1002 p1003 p1004 p1005 p1006
1 5 1 8 6 5
2007 Jul 07
1
one question about the loop
Hi.
I want to get a series data just like this:
sp1 sp2
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5
I can get one part of the data every time, but I can get the data directly.
I try to use the loop, but it can not work. How to get it ? Thanks.
pair.fn=function(i,sp=5){res=data.frame(sp1=rep(i,(sp-i)),sp2=(i+1):sp)
return(res)}
pair.fn(1)
pair.fn(2)
.....
[[alternative HTML
2006 Apr 18
2
what happen?
Hi!
I want to choose part of the data. But it has a question.
> attach(PIKO)
> PIKO[1:5,]
code species dbh x y tag status branch
92 10142 PIKO 38.9 6.05 12.81 10165 alive 0
109 10213 PIKO 41.0 6.71 26.21 10202 alive 0
135 10222 PIKO 48.3 18.98 21.28 10214 alive 0
146 10223 PIKO 47.0 19.45 22.83 10224 alive 0
147 10223 PIKO 20.0 19.74
2007 Jul 14
1
How to remove the quote "" in the data frame?
If I do not add "ress" into the data frame "res", there is no quote in the
data frame. However, I add "ress", all column were found the quote.
How to remove it?
If you can delete the quote in the file "ress", that is better.
Thanks.
> ress[1:10]
[1] "ABHO.ABNE" "ABHO.ACBA" "ABHO.ACGI" "ABHO.ACKO"
2006 Jun 02
2
a question about a simply figure
I think there is a question in R. I donot know the reason.
This is my data about comulative percentage figure. The result is not right.
The first point (no=1,leiji=26.94350) in the plot figure was showen in a
lower location. Why?
Thanks !
> fre
no leiji
1 1 26.94350
2 2 46.86401
3 3 60.59032
4 4 72.17355
5 5 77.85521
6 6 82.05853
7 7 85.56495
8 8 87.64378
9 9
2007 Jul 07
2
random sampling with some limitive conditions?
I want to gain thousands of random sampling data by randomizing the
presence-absence data. Meantime, one important limition is that the row and
column sums must be fixed. For example, the data "tst" is following:
site1 site2 site3 site4 site5 site6 site7 site8 1 0 0 0 1 1 0 0 0 1 1 1 0
1 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0 0
0 0 0 0 0 0 0 0 1 0 1 0
2007 Dec 03
2
Why is the program too slow?
Hi,everyone.
I use the following program calculates Fisher's alpha from counts of individuals and species. The program is wrote by Prof. Kyle Harm.
However, when I run the program, it can work very quickly sometimes, but it can not work very well sometimes. It depends on the counts of individuals and species.
For example,
> calc.alpha(1000,70)
[1] 17.14375
> calc.alpha(10000,70)
[1]
2007 Jul 14
3
How to read many files at one time?
I want to load many files in the R. The names of the files are "Sim1.txt", "
Sim2.txt", "Sim3.txt", "Sim4.txt", "Sim5.txt" and so on.
Can I read them at one time? What should I do? I can give the same names in
R.
Thanks.
For example:
> tst=paste("Sim",1:20,".txt",sep="") # the file names
> tst
[1]
2007 Jul 07
2
How to calculate the index "the number of species combinations"?
I want to analyze the co-occurrence of some species. In some papers, the
authors said that the index"the number of species combinations (COMBO)" is a
good index. I try to calculate the index by R language. But I can not get
the right value. I think that I do not understand the concept of the index
because my english is not good.
The concept:
*The number of species combinations *This
2006 Apr 04
1
how to delete the bar in the right of "filled.contour" map
I did the contour map by "filled contour" and I want to add some points in
this map.
But It cannot be added truely because the bar is in the right.
I want to know how to delete the bar in the right or add the points in
the contour map.
Thanks!
[[alternative HTML version deleted]]
2006 Jun 08
0
Error in plot.new() : plot region too large ?
Hello.
I want to draw the contour map by package "CTFs".
But:
Error in plot.new() : plot region too large
# the plot area is 1000 * 500.
How to solve this trouble?
Thanks!
Jian zhang
[[alternative HTML version deleted]]
2006 Dec 19
2
how to replace some objects?
I want to replace some objects in one row or column.For example,
One colume: a,b,a,c,b,b,a,a,c.
I want to replace "a" with "1", "b" with "2", and "c" with "3".
Like this: 1,2,1,3,2,2,1,1,3.
How to do it? I donot know how to do it. Thanks.
[[alternative HTML version deleted]]
2010 Feb 05
1
Strange "rownames"
I find one row in my large dataset. But when I use the "rownames" for the
data on the 100,000 row, the result show nothing.
I try it by the following example, it still likes that.
> tst[rownames(tst)==100000,]
[1] x y
<0 rows> (or 0-length row.names)
##############
> tst=data.frame(x=1:200000,y=200000:1)
> tst[rownames(tst)==1,]
x y
1 1 200000
>
2010 Jul 12
1
Change the colour of lines in the xyplot?
I want to add the legend for my figure using "auto.key" in the xyplot function (library(lattice)). But I don't know how to change the colors of the lines in the "legend" part. I tried to add "col=1:8" in the "auto.key", but it changes the colors of the text of my Legend, not the lines. How can I change the colors of the lines?
2011 Dec 10
0
Correlations for spatio-temporal data ?
I have a dataset like this:
sites years Var1 Var2
1 1960 505 3.013833
1 1961 533 4.118784
1 1962 609 14.96386
1 1963 465 -3.74409
1 1964 837 41.70164
1 1965 727 29.53478
2 1960 493 3.269235
2 1961 535 5.386015
2 1962 608 16.26244
2 1963 469 -2.09736
2 1964 830 42.01942
2 1965 715 29.92867
3 1960 489
2007 Dec 12
1
How to plot the grid figure using R?
Now I have the forest plot data with x, y locations, and I measured the DBH for every indivicuals.
The data looks like that:
x=runif(100,0,100)
y=runif(100,0,100)
dbh=runif(100,1,100)
rdata=data.frame(x,y,dbh)
> rdata[1:5,]
x y dbh
1 99.5354145 1.412844 34.10112
2 0.8259361 87.737036 39.12914
3 6.5678613 65.699032 22.55990
4 67.2987881 72.053877 45.83978
5 2.2491372