similar to: counting strings in a column

Displaying 20 results from an estimated 4000 matches similar to: "counting strings in a column"

2009 Apr 29
2
reading csv file : blanks
Hi, I have a comma seperated data file which has blanks in it. I am trinying to import it to R using data1<-read.csv("oa_2006.csv", header = TRUE, sep = ",", quote="\"", dec=".") I want the missing values to be "NA". instead R reads them as "U". Any idea why this happens ? Thanks in advance. Regards, Nataraju GM
2009 Apr 24
2
displaying percentage in bar plot
Hi, I have a query regarding barplot I have a following data AIS LEvel 1 2 3 body region A 10 15 20 B 15 25 15 Now I want to plot a barplot and in each bar (corresponding a body region), I need a percentage of AIS level 1 displayed in the plot. Is there an
2009 Apr 30
1
factor issue
Hi, I have a column which I have to convert from factors to numeric. I am using the command as.numeric(variable) to do this. But when I convert the numeric value becomes different from factor . for example. > class(B) [1] "factor" > B [1] 180 <NA> 183 175 163 155 <NA> 188 191 160 170 165 152 170 165 [16] 163 160 163 165 <NA> > as.numeric(B)
2007 Oct 26
2
function in R that's equivalent to SQL's "IN"
Hi all, I'm trying to find something like the "==" operator that will work on vectors or something equivalent to SQL's "IN" function. For e.g., if I have: x <- c(1,2,3,4,5) y <- c("apples", "oranges", "grapes", "bananas", "pears") z <- data.frame (x,y) w <- c(2,4,5) I want R to return the values
2011 Aug 11
1
help with loops
hi I need help with list object. I have a list object > a <- c('apple','orange','grape') > b <- c('car','truck','jeep') > c <- list(a,b) > names(c) <- c('fruit','vehicle') > c $fruit [1] "apple" "orange" "grape" $vehicle [1] "car" "truck"
2006 Jul 06
3
Comparing two matrices [Broadcast]
It might be a bit faster to do matrix indexing: R> tbm <- as.matrix(tb) # turn it into a character matrix R> tmat[cbind(match(tbm[,2], rownames(tmat)), match(tbm[,1], colnames(tmat)))] <- 1 > tmat Apple Orange Mango Grape Star A 1 1 1 0 0 O 1 1 0 0 0 M 0 0 1 0 0 G 0 0 0 0 0 S 1 1 1 0
2006 Jul 06
3
Comparing two matrices
hi: I have matrix with dimensions(200 X 20,000). I have another file, a tab-delim file where first column variables are row names and second column variables are column names. For instance: > tmat Apple Orange Mango Grape Star A 0 0 0 0 0 O 0 0 0 0 0 M 0 0 0 0 0 G 0 0 0 0 0 S 0 0 0 0 0
2004 Oct 18
2
答复: 答复: R plot problems
Yes! You are right ! It is perpendicular to the axis. Thank you very much! Could I choose the angle ,such as 45 degree? Best Regards! Ivy Li YMS in Production & Testing Semiconductor Manufactory International(ShangHai) Corporation #18 ZhangJiang Road, PuDong New Area, Shanghai, China Tel: 021-5080-2000 *11754 Email: Ivy_Li at smics.com -----orig--- Hi Ivy, How about x <-
2010 Jan 08
2
How to Merge based on Rows
Let's say that I have a bunch of matrices. They look like this (pardon using fruit for examples, my actual data tables are far too enormous): Matrix1 Apples Oranges Pears A 5 6 7 B 5 3 4 C 8 9 10 D 11 13 14 E 15 3 8 F 1 4 5
2008 Mar 19
1
Radio Buttons or similars
Hello companions!!! I have a function that creates a Radio Buttons, and I need that this function return the selected value in the Radio Buttons. I would like that, if somebody know as I could return the value, you say me as do it. Next, I show the function function1<-function(){ require(tcltk) tt <- tktoplevel() rb1 <- tkradiobutton(tt) rb2 <- tkradiobutton(tt) rbValue <-
2004 Oct 18
3
答复: R plot problems
Thank you for your help! I gave you an example, you could run it in R . Maybe you will understand my meaning clearly. x <- data.frame(main.name="AAA", x.name=rep(c("Apply","Watermelon","Lemon","Banana",
2013 Sep 13
2
xtable use plus minus
I am using a similar dataset to the following: a= c("Fruits", "Adam","errorA", "steve", "errorS", "apples", 17.1,2.22, 3.2,1.1, "oranges", 3.1,2.55, 18.1,3.2 ) a_table=data.matrix(t(matrix(a,nrow=5))) I would like to plus minus every second column starting from errorA (using xtable/ hmisc) example output (ignoring
2013 Jun 26
3
XYZ data
I have x, y, z data. The x, y fields dont change but Z does. How do I add a very small number onto the end of each x, y data point. For example: Original (X) Original (Y) Original (Z) 15 20 30 15 20 40 New (X) New (Y)
2007 Feb 26
1
match() function with a little enhancement
Dear R users, I was wondering if R has a built-in function doing the following : my_match(values_vector,lookup_vector) { for each value of values_vector : if value %in% lookup_vector, then value is unchanged else, value is changed the the closest element of lookup_vector, "closest" meaning "the one that would come just after if we sorted them using order()" } For example :
2005 Aug 15
2
randomForest Error passing string argument
I'm attempting to pass a string argument into the function randomForest but I get an error: state <- paste(list("fruit ~", "apples+oranges+blueberries", "data=fruits.data, mtry=2, do.trace=100, na.action=na.omit, keep.forest=TRUE"), sep= " ", collapse="") model.rf <- randomForest(state) Error in if (n==0) stop ("data(x) has 0
2010 Jul 28
0
[LLVMdev] Why are LLVM libraries enormous?
On Jul 27, 2010, at 4:11 PM, Óscar Fuentes wrote: > Why would be relevant that XCode produces library > files smaller than Visual Studio? Its comparing apples to oranges. The size of static libraries is relevant because it places an upper bound on the size of the executable. Otherwise we can only speak anecdotally about "typical" executables that use "some" of the
2004 Feb 09
5
simple question on picking out some rows of a matrix/data frame
Hi, I have a simple question about matrix/data frame manipulation. I have a data frame that looks a something like this X Y Z 1 0 "apples" -1 -1 "oranges" ... 0 -1 "bananas" and I'd like to pull out all the rows for which X and Y are (un)equal into a submatrix. How can I do that? Many thanks, Roger Levy
2003 Sep 19
3
SHN
I am interetsed to know views on how does best quality ogg compression compare with SHN or whether this is this really comparing apples with oranges because SHN does not compress that greatly? I am on a Music list that is doing a Tape Tree. I guess Grateful dead have made SHN the cult leader format. -- Raena Lea-Shannon --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg
2006 Apr 24
2
Ror has problems with memory usage??
I saw this on a forum for MODx (a CMS which seem very good, built on standards, with clean XHTML/CSS, using PHP). "RoR is a killer application, but is either a crusher when it comes to memory usage or SQL usage. Even simple seeming things can kill a server if it''s not dedicated to the application. In addition, RoR is much more complex really than MODx if you''re not
2004 Aug 05
1
Using pipe for input data
Hi. I have asked this question before and Aaron J. Mackey and Tony Plate gave me some great insight but I still can't figure out how to do what I am trying to accomplish. So let me ask again... What I am trying to do is to make R read data from pipe (stdin). Say I have following files on my directory my.dat apple 1 orange 2 grape 3 my.R d <- read.table(