Displaying 20 results from an estimated 4000 matches similar to: "help with counting how many times each value occur in each column"
2009 Feb 26
1
ggplot2: labels points with different colors or idnumbers
Dear list,
Using ggplot2 I could produce both boxplot and points in the same plot but instead of points I would like to label the different
subjects with different colors or their idnumbers. Is there away to do it? Also how can I put three plots on the same graph with ggplot2?
mfrow=c(3,1) did not do the job.
> dat
group time id freq
1 1 00 0018 5.21
2 1 00 3026 3.13
2008 Feb 04
7
adding the mean and standard deviation to boxplots
Dear list,
How can I add the mean and standard deviation to each of the boxplots using the example provided in the boxplot function?
boxplot(len ~ dose, data = ToothGrowth,
boxwex = 0.25, at = 1:3 - 0.2,
subset = supp == "VC", col = "yellow",
main = "Guinea Pigs' Tooth Growth",
xlab = "Vitamin C dose mg",
2008 Mar 31
1
Reorder the x-axis using lattice
Dear list,
Is there a way to reorder the xaxis using lattice. Using the following data, the x-axis is ordered as BP GH MH PF RE RP SF VT but I would like the x-axis to be ordered as PF RP BP GH VT SF RE MH.
Kön Skalor Tillfälle Medelvärde
1 Kvinnor BP 1-inskrivning 36.45283
2 Kvinnor GH 1-inskrivning 38.62255
3 Kvinnor MH 1-inskrivning 62.88889
4
2007 Sep 20
1
help with making a function of scatter plot with multiple variables
Dear list,
I have done a scatter plot of multiple variables in the same graph, with different col and pch. I managed to do it with the following code but not know how to make a function of these so that next time if I want to do similar graph but with new variables, I dont have to copy the code and then change the old variables with the new ones but just call a function with the new
2008 Jan 15
1
help with reshaping data into long format (correct question)
Dear list,
I have the following data set
id 1 2 3 4 5 6 7 8 9 10
disease a b c d e f g h i j
age 23 40 32 34 25 32 22 35 29 21
city NY LD NY SG NY LD VG SA LD SG
sex 1 1 2 2 2 2 1 1 1 2
treat_a y y y y
treat_b n n n n n n
ques1_1 2 4 5 6 8 3 1 2 4 5
ques1_2 6 4 5 12 10 9 8 4 5 7
2008 Jan 15
0
Help with reshape data into long format
Dear list,
I have the following data set
id 1 2 3 4 5 6 7 8 9 10
disease a b c d e f g h i j
age 23 40 32 34 25 32 22 35 29 21
city NY LD NY SG NY LD VG SA LD SG
sex 1 1 2 2 2 2 1 1 1 2
treat_a y y y y
treat_b n n n n n n
ques1_1 2 4 5 6 8 3 1 2 4 5
ques1_2 6 4 5 12 10 9 8 4 5 7
2007 Aug 11
0
DOE and interaction plot general question
This is a general question about Design of experiments. If i am not allowed
to post general questions like this here please accept my apologies and
ignore the question.
I did a DOE with six factors in eight runs. I know i cannot check for
interactions using this design, but i tried the interaction plot and it
showed me many interactions. After this I foldover the design and ran the 8
runs to learn
2006 Jan 18
2
Display an Image on a Plane
Hi,
I am new to R and I would like to display an image on a plane in a 3D plot,
i.e. I would like to be able to specify a theta and a phi parameters like in
the function persp to display a 2D image on an inclined plane.
Regards,
vincent
[[alternative HTML version deleted]]
2006 Jan 18
2
Display an Image on a Plane
Hi,
I am new to R and I would like to display an image on a plane in a 3D plot,
i.e. I would like to be able to specify a theta and a phi parameters like in
the function persp to display a 2D image on an inclined plane.
Regards,
vincent
[[alternative HTML version deleted]]
2008 Oct 01
3
"tapply versus by" in function with more than 1 arguments
Hi. I searched the list and didn't found nothing similar to this. I simplified my example like below:
#I need calculate correlation (for example) between 2 columns classified by a third one at a data.frame, like below:
#number of rows
nr = 10
#the third column is to enforce that I need correlation on two variables only
dataf =
2005 Oct 07
1
returning a modified fix()-ed dataframe
Dear all,
In order to ease the transition from SPSS to R for some of my colleagues, I am
trying to create a function which would show the variables and their labels
(if those exist), using function "label" in package Hmisc.
A toy example would be this:
my.data <- data.frame(age=c(24,35,28), gender=c("Male", "Female", "Male"))
require(Hmisc)
2006 Mar 07
3
glm automation
Hello,
I have two problems in automating multiple glm(s) operations.
The data file is tab delimited file with headers and two columns. like
"ABC" "EFG"
1 2
2 3
3 4
dat <- read.table("FILENAME", header=TRUE, sep="\t", na.strings="NA",
dec=".", strip.white=TRUE)
dataf <- read.table("FILENAME", header=FALSE,
2010 Jul 22
1
Updating a Data Frame
Hi,
I have a global data-frame in my R script.
At some point in my script, I want to update certain columns of this
data-frame by calling in an update function.
The function looks like this:
# get events data. This populates a global event data frame in the R-script
events <- getEvents(con, eventsFilePath)
# events has columns eventid, timeStamp, isSynchronized, timeDiff; with
millions of
2006 Jan 05
2
Suggestion for big files [was: Re: A comment about R:]
[ronggui]
>R's week when handling large data file. I has a data file : 807 vars,
>118519 obs.and its CVS format. Stata can read it in in 2 minus,but In
>my PC,R almost can not handle. my pc's cpu 1.7G ;RAM 512M.
Just (another) thought. I used to use SPSS, many, many years ago, on
CDC machines, where the CPU had limited memory and no kind of paging
architecture. Files did
2006 Jun 04
4
xy.coords(MATRIX) bug in code or documentation (PR#8937)
Hi, people.
xy.coords() does not behave like its documentation says, when given some
matrices. ?xy.coords says:
If 'y' is 'NULL' and 'x' is a [...] formula [...] list [...]
time series [...] matrix with two columns [...]
In any other case, the 'x' argument is coerced to a vector and
returned as *y* component [...]
Now, consider this short
2009 Aug 12
2
Symbolic references - passing variable names into functions
Hello All,
I am trying to write a function which would operate on columns of a
dataframe specified in parameters passed to that function.
f = function(dataf, col1 = "column1", col2 = "column2") {
dataf$col1 = dataf$col2 # just as an example
}
The above, of course, does not work as intended. In some languages one
can force evaluation of a variable, and then
2011 Nov 15
2
Models with ordered and unordered factors
Hello;
I am having a problems with the interpretation of models using ordered or
unordered predictors.
I am running models in lmer but I will try to give a simplified example
data set using lm.
Both in the example and in my real data set I use a predictor variable
referring to 3 consecutive days of an experiment. It is a factor, and I
thought it would be more correct to consider it ordered.
Below
2004 Jun 24
3
The "median" function in R does not work properly.
Hi,
1.) The "median" function does not work well. Please refer to the data
below (same data is attached as txt-delimited). This is what I try to
do in R:
median ( dataf [2:9] )
I get warning: "needs numeric data"
2.) BUT if apply the median to a single vector:
median ( dataf [,2]] )
then it works:
3.) How come the "median"
2006 Oct 04
2
Suitability of R for Algorithm simulations
Greetings,
Sorry for the basic question, but I am trying to find out if R is a suitable platform for what I want to do...
I am interested in creating simulations of distributed algorithms (i.e. team formation, Byzantine Generals , P2P communication modeling, mobile networks) that would be represented in GUIs. I would like to be able to instantiate an object for each node in my simulated
2007 Aug 16
4
Combine matrix
Hi R user,
I am new to R, and I have a very simple question for you. I have two matrix
A and B, with internally redundant rownames (but variables are different).
Some, but not all the rownames are shared among the two matrix. I want to
create a greater matrix that combines the previuos two, and has all the
possible combinations of matching rownames lines among matrix A and B.
looking for the