Skip to content
Prev 395118 / 398502 Next

Odd result

On 23/09/2023 6:55 p.m., Parkhurst, David wrote:
Many Excel spreadsheets have a lot of garbage outside the range of the 
data.  Sometimes it is visible if you know where to look, sometimes it 
is blank cells.  Perhaps at some point you (or the file creator) 
accidentally entered a number in line 973.  Then Excel will think the 
sheet has 973 lines.  I don't know the best way to tell Excel that those 
lines are pure garbage.

That's why old fogies like me recommend that you do as little as 
possible in Excel.  Get the data into a reliable form as soon as possible.

Once it is an R dataframe, you can delete lines using negative indices. 
In this case use

     fixed <- KurtzData[-(47:nrow(KurtzData)), ]

which will create a new dataframe with only rows 1 to 46.

Duncan Murdoch