Displaying 20 results from an estimated 10000 matches similar to: "add identifier column by row"
2013 Apr 18
6
count each answer category in each column
Hey,
Is it possible that R can calculate each options under each column and
return a summary table?
Suppose I have a table like this:
Gender Age Rate
Female 0-10 Good
Male 0-10 Good
Female 11-20 Bad
Male 11-20 Bad
Male >20 N/A
I want to have a summary table including the information that how many
answers in each category, sth like this:
X
2013 May 07
4
create unique ID for each group
Hey All,
I have a dataset(dat1) like this:
ObsNumber ID Weight
1 0001 12
2 0001 13
3 0001 14
4 0002 16
5 0002 17
And another dataset(dat2) like this:
ID Height
0001 3.2
0001 2.6
0001
2013 Apr 12
2
split date and time
Hi R experts,
For example I have a dataset looks like this:
Number TimeStamp Value
1 1/1/2013 0:00 1
2 1/1/2013 0:01 2
3 1/1/2013 0:03 3
How can I split the "TimeStamp" Column into two and return a new table like
this:
Number Date Time Value
1 1/1/2013 0:00 1
2 1/1/2013 0:01 2
3 1/1/2013 0:03 3
Thank!
[[alternative HTML version
2013 Apr 10
3
how to calculate average of each column
Hey All,
I have a large dataset and I want to calculate the average of each column
then return a new dataset.
Here is my question: I dont know if there is a function that can allow me
to calculate the average every 60 records of data in the whole dataset, and
return a new data frame. Not sure if I have to divide the dataset first for
every 60, then do the mean or can i directly do that.
thanks
2013 May 03
3
color by group in ggplot
Hey,
I have a dataset like this:
ID Var1 Var2 Group
A1 1 1 BB
A2 1 2 AA
B1 2 1 CC
B2 1 3 DD
C1 1 2 EE
I would like to plot the points of Var1 and Var2, use "ID" as X-axis, but
color the points by "Group". I can
2013 Apr 16
2
plot 2 y axis
Hi,
I want to plot two variables on the same graph but with two y axis just
like what you can do in Excel. I searched online that seems like you can
not achieve that in ggplot. So is there anyway I can do it in a nice way in
basic plot?
Suppose my data looks like this:
Weight Height Date
0.1 0.3 1
0.2 0.4 2
0.3 0.8 3
0.6 1
2009 Nov 03
1
hierarchical clustering with Jaccard index
hi,
I want to do hierarchical clustering with Jaccord index. I tried to do with vegan package for finding index and hierarchical clustering with hclust function. While doing clustering it is showing an error message as "invalid distance method". I would be grateful if anyone tells how to rectify the error.
Thanks in advance,
kind regards,
Ms.Karunambigai M
PhD Scholar
Dept. of
2009 Aug 24
1
Unique command not deleting all duplicate rows
Hello everyone, when I run the "unique" command on my data frame, it deletes
the majority of duplicate rows, but not all of them. Here is a sample of my
data. How do I get it to delete all the rows?
6 -115.38 32.894 195 162.94 D 8419 D
7 -115.432 32.864 115 208.91 D 8419 D
8 -115.447 32.773 1170 264.57 D 8419 D
9 -115.447 32.773 1170 264.57 D 8419 D
10 -115.447 32.773 1170
2011 Mar 11
1
Partial Cross Correlation
Does anyone know of any R code for computing partial cross-correlation? I have examples of cross correlation functions (ccfs) that are not smooth but rather consist of a peak of several high values in consecutive lags, with sharp drops on either side. This indicates that y(t) is a function of some average of x(t-tau) at the set of lags tau over which the ccf is high. I could sort out these
2011 Jul 25
1
ARIMA simulations
Hello,
I have estimated an ARIMA model and I would like to make simulations from
this estimated model 1,5 and 10 steps ahead. Does anybody know how to do
this?
Thank You
Felipe Parra
[[alternative HTML version deleted]]
2011 Apr 18
2
Using jitter function with differing variable lengths
Hi,
I am trying to make a scatter plot with 4 different categories using the
jitter function. My code returns a variable length error and will not plot
because my four categories have different numbers of samples. When I delete
samples from my spreadsheet so that each of the categories has the same
number of variables, it plots just fine.
Is there any way to get around this and plot all of my
2009 Oct 04
3
Stranger Behavior -maybe not
Hello everyone,
When I run a for loop I noticed that the looping variable gets assigned the
last value in the loop:
For example, if I let h=200, and I run
for(i in 1:h),
i gets the value 200. What's wrong here?
--
-Tony
[[alternative HTML version deleted]]
2009 Sep 16
2
How not to keep the redundant space when convert a data frame with as.matrix()?
Hi,
The first column in as.matrix(x) has extra spaces (" "), which I don't
want. Is there a way not to generate those spaces?
Regards,
Peng
> x=data.frame(x=1:10,y=letters[11:20])
> as.matrix(x)
x y
[1,] " 1" "k"
[2,] " 2" "l"
[3,] " 3" "m"
[4,] " 4" "n"
[5,] " 5"
2008 Jan 29
1
coherency and phase plots
I am having a hard time interpreting the phase and coherency plots.
x is two timeseries that occur at the same time i.e.
a b
1 11.2 12.3
16 11.3 12.4
31 11.4 12.5
46 11.5 12.6
...etc
even though my example is does not show this they are oscillating at
more or less the same frequency just shifted by t=x (imagine two sine
waves offset with the 2nd sine
2011 Jan 28
4
Months in alphabetical order rather than chronological order in graph
Greetings
Though I have months in chronological order in my data table, the data
were sampled every other month (i.e., February, April, June, August,
October, December), every time I try to plot them (on the x-axis) they are
plotted in alphabetical order. What am I missing?
Cheers
Kurt
***************************************************************
Kurt Lewis Helf, Ph.D.
Ecologist
EEO
2011 Mar 01
3
Export R dataframes to excel
I'm trying to do this in several ways but havent had any result. Im asked to
install python, or perl.... etc. Can anybody suggest a direct, easy and
understandable way? Every help would be appreciated.
Thx.
--
View this message in context: http://r.789695.n4.nabble.com/Export-R-dataframes-to-excel-tp3330399p3330399.html
Sent from the R help mailing list archive at Nabble.com.
2011 Sep 18
2
graph bugs using R on MAC
This is has been bugging me for a long time. Nobody around me seems to
have this problem. I hope someone on the forum could help me.
When I generate a R graph and want to bring the image into Word. I
cannot copy and paste it like many of my classmates can do. The
"Select" in Edit menu have all options grayed out. So what I ended up
doing is to save it as pdf file and bring it
2008 Sep 16
5
How to find the index
Dear R experts,
i have a vector z , i have to do something after z is sorted. how
can i find the original index, i.e., before sorting, of a certain
element in the sorted vector .
thanks in advance
regards
-----------------------------------------------
Peng Jiang ?? ,Ph.D. Candidate
Antai College of Economics & Management
????????
Department of Mathematics
???
Shanghai Jiaotong
2012 Nov 26
3
wrong data interpretation in R
Hi,
maybe somebody would be kind enough to help a bloody and unprofessional
beginner like me (and I hope I did not overlook the answer to my question on
the website). I've imported a csv data frame into R, but I can't run a
regression because R interprets 4 out of 5 variables as factors (rather than
numeric vectors). I tried the as.numeric() command, but R says it is invalid
to change the
2012 Nov 20
2
Help with loess
Not sure what I'm doing wrong. Can't seem to get loess values. It looks like
loess is returning the same values as the input.
j <-loess(x1$total~as.numeric(index(x1)
plot(x1$total,type='l', ylab='M coms/y global',xlab='')
lines(loess(total~as.numeric(index(x1)),x1))
The plot statement works fine
No errors with the "lines" statement
But I don't