Pollen counting tool

March 21, 2014
WDG

Extracting data from tropical pollen records can be difficult, and time consuming, because of the high floristic diversity. Ecology of the past contributor and PhD researcher Bryan Valencia has developed a method for turning your computer into a tally counter. Bryan’s method allows the easy recording of diverse assemblages, and saves time on data entry. The tally counter can be used to count whatever you like…

Watch the video to find out how:

Use the R-project code below to make it happen.

Code for use with R-project

# assign keys modifiying the code that is between asterisk maks (below)
# when key assignements is done,copy & run the entire code.
# record your counts using any text editor,
# then type: PollenCount(” “) and paste your counts (text)
# between the quatation marks & press enter: e.g. PollenCount(“11ww33f”)
# Done

PollenCount<-function(AA) { # created a function named PollenCount
CountData<-c(AA)
nchar(CountData) # Counts character numbers
CountList<-substring(CountData,1:nchar(CountData),1:nchar(CountData)) # retrieve characters

length(which(CountList[]==”1″))->PollenType.1
length(which(CountList[]==”2″))->PollenType.2
length(which(CountList[]==”3″))->PollenType.3
length(which(CountList[]==”4″))->PollenType.4
length(which(CountList[]==”5″))->PollenType.5
length(which(CountList[]==”6″))->PollenType.6
length(which(CountList[]==”7″))->PollenType.7
length(which(CountList[]==”8″))->PollenType.8
length(which(CountList[]==”9″))->PollenType.9
length(which(CountList[]==”0″))->PollenType.0
length(which(CountList[]==”a”))->PollenType.a
length(which(CountList[]==”b”))->PollenType.b
length(which(CountList[]==”c”))->PollenType.c
length(which(CountList[]==”d”))->PollenType.d
length(which(CountList[]==”e”))->PollenType.e
length(which(CountList[]==”f”))->PollenType.f
length(which(CountList[]==”g”))->PollenType.g
length(which(CountList[]==”h”))->PollenType.h
length(which(CountList[]==”i”))->PollenType.i
length(which(CountList[]==”j”))->PollenType.j
length(which(CountList[]==”k”))->PollenType.k
length(which(CountList[]==”l”))->PollenType.l
length(which(CountList[]==”m”))->PollenType.m
length(which(CountList[]==”n”))->PollenType.n
length(which(CountList[]==”o”))->PollenType.o
length(which(CountList[]==”p”))->PollenType.p
length(which(CountList[]==”q”))->PollenType.q
length(which(CountList[]==”r”))->PollenType.r
length(which(CountList[]==”s”))->PollenType.s
length(which(CountList[]==”t”))->PollenType.t
length(which(CountList[]==”u”))->PollenType.u
length(which(CountList[]==”v”))->PollenType.v
length(which(CountList[]==”w”))->PollenType.w
length(which(CountList[]==”x”))->PollenType.x
length(which(CountList[]==”y”))->PollenType.y
length(which(CountList[]==”z”))->PollenType.z

Counts<-c( PollenType.1, PollenType.2, PollenType.3, PollenType.4, PollenType.5, PollenType.6, PollenType.7, PollenType.8, PollenType.9, PollenType.0, PollenType.a, PollenType.b, PollenType.c, PollenType.d, PollenType.e, PollenType.f, PollenType.g, PollenType.h, PollenType.i, PollenType.j, PollenType.k, PollenType.l, PollenType.m, PollenType.n, PollenType.o, PollenType.p, PollenType.q, PollenType.r, PollenType.s, PollenType.t, PollenType.u, PollenType.v, PollenType.w, PollenType.x, PollenType.y, PollenType.z )

#*************** Modify the code below *******************************

# Modify the code below to asign names of the labels
# Example: to asign SOLANACEAE to key w find “PollenType.w” and change it to “SOLANACEAE.w”
# To asign Poaceae to key 4 find “PollenType.4” and change it to “Poaceae.4”
# When done, save the file, select all the code and run it.

NAMES<-c(“PollenType.1”, “PollenType.2”, “PollenType.3”, “PollenType.4”, “PollenType.5”, “PollenType.6”, “PollenType.7”, “PollenType.8”, “PollenType.9”, “PollenType.0”, “PollenType.a”, “PollenType.b”, “PollenType.c”, “PollenType.d”, “PollenType.e”, “PollenType.f”, “PollenType.g”, “PollenType.h”, “PollenType.i”, “PollenType.j”, “PollenType.k”, “PollenType.l”, “PollenType.m”, “PollenType.n”, “PollenType.o”, “PollenType.p”, “PollenType.q”, “PollenType.r”, “PollenType.s”, “PollenType.t”, “PollenType.u”, “PollenType.v”, “PollenType.w”, “PollenType.x”, “PollenType.y”, “PollenType.z” )

#*********************************************************************

A<-matrix(data=Counts, nrow=36, ncol=1, dimnames=list(NAMES,c(“Counts”)))
print(A)
print(“The sum of grains is:”)
print(sum(A))
print(“Excel file named PollenCounts.csv was created in folder:”)
print(getwd())
write.table(A, file=”PollenCounts.csv”, sep=”,”)
}

Leave a Reply

Required fields are marked *.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.
%d bloggers like this: