Hi Johannes,

did you transform your SpatialPointsDataFrame to a regular data.frame?

point.df=data.frame(point.spdf)
subset(points.df, points.df[,"value"] > 0 , select = c(1, 2))
coordinates(points.df) = ~X + Y ##You should keep those columns (X,Y) in
the subset command in order to backtransform the dataframe in a
SpatialPointsDataFrame
points.spdf=point.df

hope this helps

Sam

On Tue, Mar 6, 2012 at 10:09 AM, Johannes Radinger <JRadinger@gmx.at> wrote:

> Hi,
>
> I just wanted to know how I have to use the
> subset() command for a SpatialPointsDataFrame correctly.
>
> I'd like to get all records of the SpatialPointsDataFrame where the column
> "value" is > 0. Furthermore I want to select only two columns of that
> dataframe with these records. The subset command would be:
>
> subset(points.df, value > 0 , select = c(column1, column2))
>
> When I do that I get following error:
>
> Error in subset.SpatialPointsDataFrame(points.df, value > 0, select =
> c(column1,  :
>  Object 'value' not found
>
> I also tried:
> subset(points.df, points.df["value"] > 0 , select = c(column1, column2))
>
> Error in points.df["value"] > 0 :
>  Vergleich (6) ist nur f"ur atomare und Listentypen m"oglich (sorry is in
> German)...
>
> Best regards,
> Johannes
>
> --
>
> Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

