On Mon, 23 Jul 2007, Agustin Lobo wrote:
Roger,
read.shapefile() and read.dbf() yields weird symbols for non-ascii characters
in the input file also.
Exporting to csv and reading in with read.csv(filename,sep=";") works fine
(yes, it's odd, excel puts ";" instead of "," for CSV in spanish loc
I am developing functions to plot 3d maps using the rgl package. I'm
approaching the problem of plotting polygons by dividing polygons into
triangular facets that then can be plotted as surfaces using the
triangles3d function. This has turned out to be somewhat cumbersome
using my approach which is
You'll need something like
x <- rnorm(100)
y <- 0.5 * x + rnorm(100) + 1
fit <- lm(y ~x)
paste("y =", round(fit$coef[2], 2), "x +", round(fit$coef[1], 2))
Please note that this is R-sig-geo, the R mailing list dedicated to
spatial issues. For more general questions (like this one) you'll get
more
I have several plots where I'd like to add the formula from the linear model
automatically, i.e. in form of y=ax+b, to the plot. I used lm() for a simple
scatter plot.
I was able to add the r-sqare to the plot, using summary(lm$r.square) to
extract the value for r^2. but for the coefficients a and