[R] ggplot2 axis label German formatting

2014-01-12 Thread Stageexp
Hi all I have a problem with formatting my ggplot2 graph. Let's look at this example: library(ggplot2) library(scales) x - rnorm(100, mean=100, sd = 1) * 100 y - rnorm(100, mean=100, sd = 1) * 100 df - data.frame(x,y) p.new - ggplot(df,aes(x,y)) + geom_point() print(p.new) This is

Re: [R] ggplot2 axis label German formatting

2014-01-12 Thread Stageexp
Works like a charm! Thank you so much! One more comment: I either had to add a second input parameter ... to gcomma or remove the ... from the code, otherwise I got an error. -- View this message in context:

Re: [R] Apply function to one specific column / Alternative to for loop

2013-11-17 Thread Stageexp
Hi, Try: indx - grep(Test,test_df[,1])  ##assuming that there is some pattern  res - within(test_df[-indx,],titel - rep(test_df$titel[indx], diff(c(indx,nrow(test_df)+1))-1)) ## If you need to change the class res[] - lapply(res,function(x) if(any(grepl([[:alpha:]],x))) as.character(x) else

[R] Apply function to one specific column / Alternative to for loop

2013-11-16 Thread Stageexp
Hi guys, I am a total newbie to R, so I hope this isn't a totally dumb question. I have a dataframe with a title in one row and the corresponding values in the next rows. Let's take this example: test_df - data.frame(cbind(titel = , x = 4:5, y = 1:2)) test_df = rbind(cbind(titel=1.Test, x=, y=),