similar to: name returned by lapply

Displaying 20 results from an estimated 1000 matches similar to: "name returned by lapply"

2006 Jan 09
3
two y-axis in xy-plot
Hi there, I am wondering if it is possible to do an xyplot with two y-axes. I'd like to print two parameters in a time series but they both have different scales. Which parameter in xyplot can I add to achieve this result? Thanks a lot for any help. Antje [[alternative HTML version deleted]]
2008 Dec 16
6
Find all numbers in a certain interval
Hi all, I'd like to know, if I can solve this with a shorter command: a <- rnorm(100) which(a > -0.5 & a < 0.5) # would give me all indices of numbers greater than -0.5 and smaller than +0.5 I have something similar with a dataframe and it produces sometimes quite long commands... I'd like to have something like: which(within.interval(a, -0.5, 0.5)) Is there anything I
2011 Feb 11
2
fitdistr question
Hello, I tried to fit a poisson distribution but looking at the function fitdistr() it does not optimize lambda but simply estimates the mean of the data and returns it as lambda. I'm a bit confused because I was expecting an optimization of this parameter to gain a good fit... If I would use mle() of stats4 package or mle2() of bbmle package, I would have to write the function by myself
2006 Nov 01
4
extract values from a vector
Hello, I'm looking for a solution for the following problem: I have two vectors V1 <- c("apple","honey","milk","bread","butter") V2 <- c("bread","milk") now, I would like to know for each element in V1 if it's equal to one of the elements in V2 I could do: which(V1 == V2[1] | V1 == V2[2]) but what if I
2009 Jan 20
5
from matrix to data.frame
Hello, I have a question how to reshape a given matrix to a data frame. # ---------------------------------- > a <- matrix(1:25, nrow=5) > a [,1] [,2] [,3] [,4] [,5] [1,] 1 6 11 16 21 [2,] 2 7 12 17 22 [3,] 3 8 13 18 23 [4,] 4 9 14 19 24 [5,] 5 10 15 20 25 > colnames(a) <- LETTERS[1:5] > rownames(a) <-
2009 Sep 28
2
Levelplot without margins
Hello, I'm not very experienced with lattice and I was wondering whether I get get some hints from you how to create a pure heatmap (using levelplot), without any axis, title, legend, margin at all... I just want to see the coloured squares, nothing else. Any suggestions? Antje
2008 Dec 05
6
levels update
Hello, I hope this question is not too stupid. I would like to know how to update levels after subsetting data from a data.frame. df <- data.frame(factor(c("a","a","c","b","b")), c(4,5,6,7,8), c(9,1,2,3,4)) names(df) <- c("X1","X2","X3") my.sub <- subset(df, X1 == "a" | X1 == "b")
2009 May 05
3
Heatmap without levelplot
Hi there, as I'm not sure to understand the coloring levelplot uses, I'm looking for another easy way to create a heatmap like this: library(lattice) mat <- matrix(seq(1,5, length.out = 12), nrow = 3) mat[1,2] <- 3.5 my.at <- seq(0.5,5.5, length.out = 6) my.col.regions <- rainbow(5) graph <- levelplot(t(mat[nrow(mat):1, ] ), at = my.at, col.regions = my.col.regions)
2008 May 23
2
Boxplot width
Hi there, assume that you have data with different sampling like d1 <- rnorm(100) d2 <- rnorm(150) now, I'd like to create two boxplots in one graph but each plot located at the sampling number at the x-axis. This, I can do with "at" l <- list(d1,d2) boxplot(l, at=c(length(d1), length(d2)), xlim=c(0,200) ) but both plots are very thin and I'd like to increase the
2011 Nov 16
3
access sublists by a variable
Dear list, I'd like to access the elements of a list within another list with the help of a variable. dict <- list( "24" = c(1,2,3,6,12,24,48,72,96,120,144,168,720), "168" = c(1,12,24,48,72,96,120,144,168,336,504,672), "8760" = c(1,24,168,730,4380,8760) ) dict$"24" works fine, but a <- "24" dict$a returns
2008 Nov 16
4
duplicate values
Hei R Users, i have the following dataframe: Datetime Temperature and many more collumns 1 2008-6-1 00:00:00 5 2 2008-6-1 02:00:00 5 3 2008-6-1 03:00:00 6 4 2008-6-1 03:00:00 0 5 2008-6-1 04:00:00 6 6 2008-6-1 04:00:00 0 7 2008-6-1 05:00:00 7 8 2008-6-1 06:00:00
2011 Feb 21
2
Console output
Hi there, I though there has been a possibility to force the output on the console with one element per line. Instead of this: > 1:10 [1] 1 2 3 4 5 6 7 8 9 10 something like this > 1:10 [1] 1 [2] 2 [3] 3 [4] 4 [5] 5 [6] 6 [7] 7 [8] 8 [9] 9 [10] 10 Can anybody help? Antje
2008 Dec 02
3
boxplot via plot command
Hi folks, I've just discovered that the following code leads to boxplot (surprisingly to me). Can anybody explain to me why? Is this documented somewhere? I've never consider this option before. x <- rnorm(300) l <- c(rep("label1",100), rep("label2",50), rep("label3",150)) df <- data.frame(as.factor(l), x) plot(df) Thank you! Antje
2005 Nov 21
3
Comparing rows of matrices with different dimensions
Hi there, I have a question, which I thought is very easy to solve, but somehow I can't find a solution. Probably someone could help me quickly? Here it is: I have two matrices: a [,1] [,2] [,3] [1,] 1 4 9 [2,] 2 6 10 [3,] 3 6 11 [4,] 4 8 12 b [,1] [,2] [1,] 1 4 [2,] 2 5 [3,] 3 6 Now I want to find
2008 Sep 07
4
XML - get node by name
Hi there, I try to rewrite some Java-code with R. It deals with reading XML files. I started with the XML package. In Java, I had a very useful method which gave me a node by using: name of the node index of appearance start point: global (false) / local (true) So, I could do something like this. setCurrentChildNode("data", 0); getValueOfElement("val",1,true); -->
2008 Sep 01
3
another histogram question
Hi there, I hope this question is not as stupid as the one before ... I tried to shorten my histogram (because the distribution is quite skewed and I simply don't want to see the long tail but still use the histogram plot). How can I do something like this? (The example does not work but I don't know why...) data <- rnorm(100) # as example, of course this is not skewed... h <-
2007 Aug 24
2
Package installation
Hello, I'm running R with windows. Could anybody help me how to install the package biOps (http://cran.mirroring.de/src/contrib/Descriptions/biOps.html) ? I cannot find it at any mirror provided by the GUI; I just found it as "tar.gz" which cannot be installed with the installation method... Maybe, I simply do something wrong? Thanks for any hint! Antje
2006 Aug 23
5
two density curves in one plot?
Hello, I was wondering if I can plot two curves I get from "density(data)" into one plot. I want to compare both. With the following commad, I just get one curve plotted: plot( density(mydata) ) Sorry for this stupid question but I could not find a solution until now... Antje
2008 Sep 22
2
paste with list
Hello, I guess the solution is rather simple but whatever I tried, I don't manage to get the result as I want to have it: I have several vectors of equal length in a list and I'd like to combine all first elements to a single string, all second elements to a single string, ..., all n-th elements to a single string. # Example code (how it should look like): t1 <- c(1,2,3) t2 <-
2008 Dec 03
2
Switch language
Hi there, I've installed R somewhen in German but I'd like to have it in English. The installation of a new version does not change the language setting though I think I've chosen "English" in the installation process (this choice was available, right?). Can anybody give me a hint? (Error-Messages in German are not easy to get a solution for...) Antje