Thank Rainer and Jim!!
The end result was:
#Makes a new data set name "MyData_Minus_MW01" that contains all the data
where the Location Column is not equal to MW01 and the comma after that
ensures that all columns are copied into the amended data.frame.
MyData_Minus_MW01 <- MyData[ MyData$Location
Hi David,
You "just" need to learn how to subset your data.frame, see functions
like ?subset and ?"[", as well as a good guide to understand the subtleties!
Some graphic functions also have a built-in argument to subset within
the function (e.g. argument 'subset' in 'plot.formula'), although
Reading in the data from the file
x <- read.csv( "ExampleData.csv", header = TRUE, stringsAsFactors = FALSE )
Subsetting as you want
x <- x[ x$Location != "MW01", ]
This selects all rows where the value in column 'Location' is not equal to
"MW01". The comma after that ensures that all
Say I have a dataset that looks like
LocationYear GW_Elv
MW011999 546.63
MW021999 474.21
MW031999 471.94
MW041999466.80
MW012000545.90
MW022000546.10
The whole dataset is at http://doylesdartden.com
4 matches
Mail list logo