haotu : an open lab notebook

2010/04/30

FB Privacy

Filed under: Networking — S @ 00:22

Go to Privacy Settings -> Applications and Websites

edit the privacy setting so companies cannot use your information for marketing

http://www.npr.org/blogs/alltechconsidered/2010/04/29/126394012/npr-listeners-react-to-facebook-privacy-changes

2010/04/29

Fat Freddys Drop

Filed under: Music — S @ 20:23

British reggae dub rnb eclectic band

www.fatfreddysdrop.com/

Suppress Warnings in R

Filed under: R — S @ 06:26

options(warn=-1) for a windows machines

try(expr, silent = FALSE)
try is a wrapper to run an expression that might fail and allow the user's code to handle error-recovery.
Good for for loops

R Internal Constants

Filed under: R — S @ 06:13

?letters

Internal constants of R like a vector of the English lowercase letters

Capital and Lowercase Letters in R

Filed under: R — S @ 04:04

Two functions that can be used to test if a string is completely capitalized. Can be changed to lowercase if the letters constant is used in place of LETTERS
is.char.cap<-function(char){any(char==LETTERS)}
is.word.cap<-function(string){all(sapply(unlist(strsplit(string, NULL)),is.char.cap))}

Also, to capitalize (lower) letters can use the following functions found here:
http://tolstoy.newcastle.edu.au/R/help/04/09/4146.html
###########

capply<-function(str, ff)
{


sapply(lapply(strsplit(str, NULL), ff), paste, collapse="")

}
#############
cap <- function(char) {

# change lower letters to upper, others leave unchanged
if (any(ind <-letters==char))
{

LETTERS[ind]} else {char}
}


############
capitalize <- function(str) { # vector of words

ff <- function(x) paste(lapply(unlist(strsplit(x, NULL)),cap),collapse="")


capply(str,ff)
}
############

lower <- function(char) {

# change upper letters to lower, others leave unchanged    
if (any(ind <- LETTERS==char)) letters[ind]    else char
}

#############

lowerize <- function(str) {

ff <- function(x) paste(lapply(unlist(strsplit(x, NULL)),lower),collapse="")

capply(str,ff)
}

###########
CapLeading <- function(str) {ff <- function(x) {r <- x; r[1]<-cap(x[1]); r}  ;  capply(str,ff)}

#############
examples

cap("f")
cap("R")
capitalize(c("TruE","faLSe"))
capitalize(c("faLSe","TruE"))
lower("f")
lower("R")
lowerize("TruE")
lowerize("faLSe")

How to make project repositories and index a data set with TortoiseSVN

Filed under: Subversion Code Control — S @ 01:41

1. make a repository for the project

2. inside of this repository, make a folder of the same name as the data folder

3. check out the folder in the folder that is above the data folder

4. you will get a warning that the folder is not empty

5. then clean up the folder using the clean up Tortoise function

6. Then add the files to the repository as usual.

Here are the instructions given in the manual

4.2.2. Import in Place

Assuming you already have a repository, and you want to add a new folder structure to it, just follow these steps:

  1. Use the repository browser to create a new project folder directly in the repository.
  2. Checkout the new folder over the top of the folder you want to import. You will get a warning that the local folder is not empty. Now you have a versioned top level folder with unversioned content.
  3. Use TortoiseSVN → Add… on this versioned folder to add some or all of the content. You can add and remove files, set svn:ignore properties on folders and make any other changes you need to.
  4. Commit the top level folder, and you have a new versioned tree, and a local working copy, created from your existing folder.

2010/04/28

Digital Archives

Filed under: Misc — S @ 14:24

Many publically accessible books and other media are available here:

http://www.archive.org/

There is also a specific library for biodiversity studies:

Ten major natural history museum libraries, botanical libraries, and research institutions joined together to form the Biodiversity Heritage Library Project. They are developing a strategy and operational plan to digitize the published literature of biodiversity held in their respective collections and make it available through a global “biodiversity commons.” The digitized texts are being archived here.

http://www.archive.org/details/biodiversity

R symbols

Filed under: R — S @ 14:14

?Quotes  Tells you what symbols like /t and /f mean in R syntax

?regex too

sometimes just putting a \ or \\ in front of the symbol works too eg. “\\(“

Fisheries Bulletin NOAA

Filed under: Uncategorized — S @ 14:10

Fisheries Bulleten by NOAA has a lot of fish diet data in old papers. Some is quite detailed.

http://fisherybulletin.nmfs.noaa.gov/fcontent.htm

This will likely be a blog you will not want to look at

Filed under: Uncategorized — S @ 13:54

Here I plan to put notes to myself on how I did certain things. Most of them will be about manipulating data or writing computer code or getting certain computer programs to work. I have found that the science I do is such that I figure something out just long enough to get it to work for my purposes, but then it slips out of my mind as soon as I no longer have a need for it. Perhaps this is the human condition, but it is my condition and this blog I hope will help out with it and in so doing perhaps others will gain some help from it as well

Blog at WordPress.com.