Rely,
 I second Alex's comments but also look carefully at any error messages R
does give you:
the last says "SpPDF not found", so look to see where that is created ( a
couple of lines further up). The error message here is "unexpected symbol".
This line starts with a + indicating that R thinks the previous line (where
you create trdata) is not finished. If you look you'll see you need a
couple of ')' at the end of the line where you create trdata to make the
parentheses balance.
hope that helps
cheers
rob


********* #BOU13 Conference: Bird Population Dynamics March 26-28 **********
*********** For details and booking www.bou.org.uk/bou-conferences/************

Dr Rob Robinson, Principal Ecologist
British Trust for Ornithology, The Nunnery, Thetford, Norfolk, IP24 2PU
Ph: +44 (0)1842 750050     E: rob.robinson@bto.org
Fx: +44 (0)1842 750030     W: www.bto.org/about-bto/our-staff/rob-robinson

====== "How can anyone be enlightened, when truth is so poorly lit" =======



On 4 February 2013 12:06, Alexandre Villers <villers.alexandre@gmail.com>wrote:

> Good afternoon,
>
> You should be more specific when reporting an error if you want people to
> help you. Check this link first http://www.r-project.org/**
> posting-guide.html <http://www.r-project.org/posting-guide.html>
> - Stating "Result error in below" is not really the best sentence to
> attract one's attention. What is the problem exactly?
> - You could also try to provide us with a reproducible example that can be
> sent straightforwardly to R (withtout needing to, e.g., remove the '>' at
> the beginning of each line)
> - State where exactly you got the example from
>  -Report the sessionInfo()
> etc...
>
> HTH
>
> Alex
>
>
> On 04/02/2013 13:19, Rely Al Dianty wrote:
>
>> Dear R users,
>>
>>
>> I'm begginer in  R and using Package "SP" for my project to tried sample
>> make SpatialPolygons object from gridTopology object , I follow the
>> example
>> of the script but got error.
>>
>> # Example
>>   >library(lattice)
>>   >grd <- GridTopology(cellcentre.**offset=c(-175,55), cellsize=c(10,10),
>>   >cells.dim=c(4,4))
>>   >SpP_grd <- as.SpatialPolygons.**GridTopology(grd)
>>   >plot(SpP_grd)
>>   >text(coordinates(SpP_grd), sapply(slot(SpP_grd, "polygons"),
>> function(i) slot(i, "ID")), cex=0.5)
>>
>>> trdata <- data.frame(A=rep(c(1,2,3,4), each=4), B=rep(c(1,2,3,4),
>>>
>> each=4), row.names=sapply(slot(SpP_grd, "polygons") *
>> *SpPDF <- SpatialPolygonsDataFrame(SpP_**grd, trdata) *
>> *>spplot(SpPDF)*
>>
>>
>> Result error in below
>>
>>   > trdata <- data.frame(A=rep(c(1,2,3,4), each=4), B=rep(c(1,2,3,4),
>> each=4), row.names=sapply(slot(SpP_grd, "polygons")
>> + SpPDF <- SpatialPolygonsDataFrame(SpP_**grd, trdata)
>> Error: unexpected symbol in:
>> "trdata <- data.frame(A=rep(c(1,2,3,4), each=4), B=rep(c(1,2,3,4),
>> each=4), row.names=sapply(slot(SpP_grd, "polygons")
>> SpPDF"
>>   > spplot(SpPDF)
>> Error in spplot(SpPDF) :
>>     error in evaluating the argument 'obj' in selecting a method for
>> function 'spplot': Error: object 'SpPDF' not found
>>
>>
>> Please, any one can help me. Thank u very much
>>
>>
>> Best Regards,
>>
>>
>> Rely
>>
>>
>>
>> --
>> View this message in context: http://r-sig-geo.2731867.n2.**
>> nabble.com/Error-in-sample-**package-SP-tp7582471.html<http://r-sig-geo.2731867.n2.nabble.com/Error-in-sample-package-SP-tp7582471.html>
>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>>
>> ______________________________**_________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>>
>>
>>
> ______________________________**_________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>

	[[alternative HTML version deleted]]

