Why does the output in the following say 2 and not 6? > count.fields(textConnection("LL1532Ap,ABC# Depot-A+,,1971,8,2 + LL1532Ap,ABC# Depot-A+,Bhutan,1971,6,1 + LL1532Ap,ABC# Depot-A+,China,1971,17,1 + LL1532Ap,ABC# Depot-A+,China,1971,33,1 + LL1532Ap,ABC# Depot-A+,HongKong,1971,16,2 + LL1532Ap,ABC# Depot-A+,HongKong,1971,17,1 + LL1532Ap,ABC# Depot-A+,HongKong,1971,22,1 + LL1532Ap,ABC# Depot-A+,HongKong,1971,49,1 + LL1532Ap,ABC# Depot-A+,Kazakhstan,1971,20,1 + LL1532Ap,ABC# Depot-A+,Kazakhstan,1971,27,1 + LL1532Ap,ABC# Depot-A+,Kazakhstan,1971,33,1 + LL1532Ap,ABC# Depot-A+,Kazakhstan,1973,15,1 + LL1532Ap,ABC# Depot-A+,Romania-Europe,1971,10,1 + LL1532Ap,ABC# Depot-A+,Romania-Europe,1973,4,1 + LL1532Ap,ABC# Depot-A+,Sanchez-America,1973,9,1 + LL1532An,ABC# Depot-A-,,1971,8,2"),sep=",") [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 >
On Fri, Mar 16, 2012 at 10:59 PM, David Winsemius <dwinsem...@comcast.net>wrote: Looks like an encoding mismatch. You have not offered the requested information about you setup so further comment would all be guesswork. But you can perhaps educate yourself by reading: ?Encoding And line ten has 7 elements. > count.fields(textConnection(",**,,1968,21,0 + ,,Boston,1968,13,0 + ,,Boston,1968,18,0 + ,,Chicago,1967,44,0 + ,,Providence,1968,17,0 + ,,Providence,1969,48,0 + ,,Binky,1968,24,0 + ,,Chicago,1968,23,0 + ,,Dally,1968,7,0 + ,,Raleigh, North Carol,1968,25,0 + Addy ABC-Dogs Stars-W8.1,,Providence,1968,**38,0 + DEF_REQPRF/,,Dartmouth,1967,**31,1 + PL,,,1967,38,1 + XY,PopatLal,,1967,5,1 + XY,PopatLal,,1967,6,8 + XY,PopatLal,,1967,7,7 + XY,PopatLal,,1967,9,1 + XY,PopatLal,,1967,10,1 + XY,PopatLal,,1967,13,1 + XY,PopatLal,Boston,1967,6,1 + XY,PopatLal,Boston,1967,7,11 + XY,PopatLal,Boston,1967,9,2 + XY,PopatLal,Boston,1967,10,3 + XY,PopatLal,Boston,1967,7,2"),**sep=",") [1] 6 6 6 6 6 6 6 6 6 7 6 6 6 6 6 6 6 6 6 6 6 6 6 6 > > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.