search for: radinger

Displaying 20 results from an estimated 58 matches for "radinger".

2012 Feb 03
2
Assigning objects to variable and variable to list in a for loop
...did something similar but with a matrix: Thus I created an empty matrix before the loop and indexed the matrix inside the loop to assign values. But here it is about assigning ojects to variables and coercing these to a list. Any suggestions are mostly welcomme. Thank you, best regards, Johannes Radinger --
2011 Dec 06
5
Argument validation within functions
Hi, I just started with writing functions in R and so some questions popped up. I provide some values as argument to my function such as: function(a,b,c){} Now i want that the function first checks if the arguments are valid for the function. E.g argument "a" has to be a number in the range 0-1. How can that easily done? So far I have: a <- as.numeric(a) if(0 <= a &&
2011 Aug 15
2
Extracting information from lm results (multiple model runs)
...ith an anova...how can I compare the results of lets say two models with each 1000 model runs? Thank you very much /johannes -------- Original-Nachricht -------- > Datum: Mon, 15 Aug 2011 08:33:52 -0300 > Von: Alexandre Camargo Martensen <acmartensen at gmail.com> > An: Johannes Radinger <JRadinger at gmx.at> > Betreff: Re: [R-sig-eco] Extracting information from lm results > Hi Johannes, > > try this > > results.df<-data.frame(results) > #results.df > > p<-t(results.df[4,]) > r<-t(results.df[5,]) > > mean(p) > mean(r) >...
2012 Jun 08
4
Sort 1-column dataframe with rownames
Hi, I have a 1-column dataframe with rownames and I want to sort it based on the single column. The typical procedure that is recommended in diverse posts is to use order in the index. But that "destroys" my dataframe structure. Probabaly it is a very simple solution. Here is a short reproducable example: x <- c(1,3,51,2,34,44,12,33,2,8) df <- data.frame(x) rownames(df) <-
2012 Jan 25
4
x11() graphic device, displaying raster
Hello, I am wondering about the X11() graphic device on Windows. I try to plot a raster image but nothing gets displayed. I found some pages where it is mentioned that x11() not always supports raster rendering. Is there any add on for x11, any update or any R-package which solves that displaying problem in Windows? What I try to test it is an example from the package {raster}: library(raster)
2012 Jan 25
4
x11() graphic device, displaying raster
Hello, I am wondering about the X11() graphic device on Windows. I try to plot a raster image but nothing gets displayed. I found some pages where it is mentioned that x11() not always supports raster rendering. Is there any add on for x11, any update or any R-package which solves that displaying problem in Windows? What I try to test it is an example from the package {raster}: library(raster)
2013 Mar 13
5
string split at xth position
Hi, I have a vector of strings like: c("a1b1","a2b2","a1b2") which I want to spilt into two parts like: c("a1","a2","a2") and c("b1","b2,"b2"). So there is always a first part with a+number and a second part with b+number. Unfortunately there is no separator I could use to directly split the vectors.. Any idea
2012 Sep 27
4
Colsplit, removing parts of a string
Hi, I am using colsplit (package = reshape) to split all strings in a column according to the same patterns. Here an example: library(reshape2) df1 <- data.frame(x=c("str1_name2", "str3_name5")) df2 <- data.frame(df1, colsplit(df1$x, pattern = "_", names=c("str","name"))) This is nearly what I want but I want to remove the words
2002 Feb 04
5
slowdown and reiserfs
hi i got 2 questions and maybe someone could shed some light: a) i'm using kernel 2.4.17 and use ext3 in it. is it possible that the whole system is slower than with ext2? i switched back to ext2 (great feature!!!) and the system's response seemed somewhat better. should/could there be such a effect as double writing of journaled data? i didnt activate debugging (jbd). b) is reiserfs
2012 May 31
3
Remove columns from dataframe based on their statistics
Hi, I have a dataframe and want to remove columns from it that are populated with a similar value (for the total column) (the variation of that column is 0). Is there an easier way than to calculate the statistics and then remove them by hand? A <- runif(100) B <- rep(1,100) C <- rep(2.42,100) D <- runif(100) df <- data.frame(A,B,C,D) # if want to conditionally remove column B and
2012 Feb 14
3
Wildcard for indexing?
Hi, I'd like to know if it is possible to use wildcards * for indexing... E.g. I have a vector of strings. Now I'd like to select all elements which start with A_*? I'd also need to combine that with logical operators: "Select all elements of a vector that start with A (A*) OR that start with B (B*)" Probably that is quite easy. I looked into grep() which I think might
2012 Dec 11
5
Renaming column names according to another dataframe
Hi, I've got a dataframe having a code as column name. Addtionally I have another dataframe with a two columns (and lots of rows), the first containing the code and the second some Text (real name). Now I'd like to use the information (pairs of code and name) of the second dataframe to rename all the columnnames in the first dataframe. How is it possible to achieve that? Here a small
2013 Jan 11
3
split & rbind (cast) dataframe
Hi, I would like to split dataframe based on one colum and want to connect the two dataframes by rows (like rbind). Here a small example: # The orgininal dataframe df1 <- data.frame(col1 = c("A","A","B","B"),col2 = c(1:4), col3 = c(1:4)) # The datafame how it could look like df2 <- data.frame(A.col2 = c(1,2), A.col3 = c(1,2), B.col2 = c(3,4), B.col3
2011 Aug 15
2
MCMC regress, using runif()
Hello, just to follow up a question from last week. Here what I've done so far (here an example): library(MCMCpack) Y=c(15,14,23,18,19,9,19,13) X1=c(0.2,0.6,0.45,0.27,0.6,0.14,0.1,0.52) X2a=c(17,22,21,18,19,25,8,19) X2b=c(22,22,29,34,19,26,17,22) X2 <- function()runif(length(X2a), X2a, X2b) model1 <- MCMCregress(Y~X1+X2()) summary(model1) but I am not sure if my X2-function is
2012 Jul 25
3
Installing packages "xslx" on Ubuntu (32bit)
Hi, I just recently changed my OS to Ubuntu 12.04 (32bit). Now I tried to install some packages required by my old and working scripts. Unfortunately I fail when trying to install the package "xslx". Maybe it is related to the 32bit version of my R (its not possible to install a 64 bit version). Can anyone help me to sucessfully install xslx? Here some console output (e.g.
2011 Nov 24
2
dataframe indexing by number of cases per group
Hello, assume we have following dataframe: group <-c(rep("A",5),rep("B",6),rep("C",4)) x <- c(runif(5,1,5),runif(6,1,10),runif(4,2,15)) df <- data.frame(group,x) Now I want to select all cases (rows) for those groups which have more or equal 5 cases (so I want to select all cases of group A and B). How can I use the indexing for such questions? df[??]...
2012 Feb 08
2
Split dataframe into new dataframes
Hi, I want to split a dataframe based on a grouping variable (in one column). The resulting new dataframes should be stored in a new variable. I tried to split the dataframe using split() and to store it using a FOR loop, but thats not working so far: df <- data.frame(A=c("A1","A1","A2","A2"),B=seq(1:4)) Fsplit <- function(x,y){ ls <-
2012 May 11
2
text(): combine expression and line break
Hi, I would like to plot some extra text in my plot. This should be a two line text including a special character (sigma). I tried so far a to use expression in combination with paste and "\n"... but I can't get the line break... Here what I've done so far: plot(1,type="n", xaxt='n', yaxt='n', ann=FALSE) text(1,1,labels=expression(paste(sigma,"\n
2012 Jan 13
2
multidimensional array calculation
Hello, probably it is quite easy but I can get it: I have mulitple numeric vectors and a function using all of them to calculate a new value: L <- c(200,400,600) AR <- c(1.5) SO <- c(1,3,5) T <- c(30,365) fun <- function(L,AR,SO,T){ exp(L*AR+sqrt(SO)*log(T)) } How can I get an array or dataframe where all possible combinations of the factors are listed and the new value is
2011 Nov 03
2
variable transformation for lm
Hello, I am doing a simple regression using lm(Y~X). As my response and my predictor seemed to be skewed and I can't meet the model assumptions. Therefore I need to transform my variables. I wanted to ask what is the preferred way to find out if predictor and/or response needs to be transformed and if yes how (log-transform?). I found a procedure in "A modern approach to Regressoin in