Displaying 20 results from an estimated 8000 matches similar to: "Sorting a data frame by one of the variables"
2005 Dec 12
3
question about date's
Hi,
Given a frame with calendar date's:
"2005-07-01", "2005-07-02","2005-07-03","2005-07-04","2005-07-05",etc.
I want to extract the following from these dates:
week number
month number
year number
Any ideas how to accomplish this?
Many thanks.
Regards,
Richard
2008 Dec 21
2
data format issue
Dear all-
I have a dataset (see a sample below - but the whole dataset is June
2005 - June 2008). The "LST" format is "YYMMDDHHmm" and I would like to
get the hourly average of the "mph" for the summer months (spanning all
years). I have been trying to use "aggregate" but am not having much
success at all! any thoughts would be greatly appreciated.
2006 Mar 02
1
Curious subsetting behavior
I have a simple vector, called tmp that I want to subset based on another
vector called vec. Everything works as expected except for below where the
subsetting returns something other than the original data. Any ideas?
> vec <- c(1,2,3,4,5,59,60,27,32,21)
> tmp
[1] 1.0 1.1 2.0 2.1 2.2 3.0 3.1 4.0 5.0 5.1 6.0 7.0 8.0 8.1
9.0
[16] 9.1 9.2 10.0 10.1 11.0 12.0 13.0 14.0
2008 Nov 21
1
question about shapiro.test()
Hi all!
I tried to perform Shapiro-Wilk test for my sample of 243 values.
> Us
[1] -10.4 -13.1 -12.2 38.1 -18.8 -13.3 -11.7 29.3 49.7 6.8 12.7 16.3
[13] 5.8 -0.7 -29.4 4.1 38.8 -1.4 8.8 15.6 32.9 -5.3 19.1 35.8
[25] 4.0 -1.5 0.6 -4.2 -10.0 -4.0 1.1 48.9 -21.0 -5.3 5.8 -10.8
[37] 21.9 8.2 -3.2 -3.9 -2.3 12.6 -4.7 -8.0 11.8 27.4 -9.5 -20.8
[49]
2005 Oct 20
5
search a value in variables dataset
Dear R-list,
I have a dataset, say (the real dataset is 20 columns,110200 rows).
> my.reducedID
V1 V2 V3 V4 V5 V6 V7 V8 V9
[1,] 1 0 0 1 14 3 1 0 2
[2,] 2 0 0 1 14 3 1 0 2
[3,] 0 1 0 1 14 2 1 0 2
[4,] 0 0 1 1 14 3 1 0 2
[5,] 0 1 1 0 14 2 1 0 2
[6,] 0 0 0 1 14 3 1 0 2
[7,] 0 0 0 1 0 3 1 0 2
[8,] 0
2013 Jan 03
2
Sas by function in R
Hello,
It's an alternative to use SAS by function in R?
I want to plot d histograms by plot.from example bellow:
Thank you!
plot d
1 1 16.3
2 1 25.0
3 1 57.8
4 1 17.0
5 2 10.8
13 2 96.4
17 3 76.0
18 3 32.0
19 3 11.0
20 3 11.0
24 3 106.0
25 3 12.5
21 4 19.3
22 4 12.0
26 4 15.0
27 5 99.3
32 7 11.0
36
2010 Apr 16
2
managing data and removing lines
Hi,
I am very new to R and I've been trying to work through the R book to gain a
better idea of the code (which is also completely new to me).
Initially I imputed my data from a text file and that seemed to work ok, but
I'm trying to examine linear relationships between gdist and gair, gdist and
gsub, m6dist and m6air, etc.
This didn't work and I think it might have something to do
2012 Jun 30
3
How to adjust the start of a series to zero? (i.e. subtract the first value from the sequence)
Hello,
I'd have a time series, where I am plotting the means and sd of a distance
for a variety of positions along a bird's bill. I'd like to set each line
(represented by "point") to start at zero, so that I can look at the
absolute change along the series. At the moment I only know how to do that
in Excel, by subtracting the value of time 1, point 1 from all other times
2005 Oct 12
1
arima with R
Hi,
I'm using R for some arima models. In the past I used for arima models Rats and Tsp. Using the R arima function, I get only the statistics sigma^2 and log likelihood; with Rats and Tsp it is possible to obtain more statistics, such as R, R square, Durbin Watson, standard error, etc.
Is it possible using R to have the statistics mentioned?
My best regards,
2005 Oct 23
1
factorizing many columns of a dataframe
Hi guys,
I have a large number of columns of a dataframe that I want to apply a common factorization to; the columns are all numeric and the factorization collapses some of these values into common groups (labels). How can I do this systematically?
Is there an analog to sapply that can pass columns as vectors to FUN?
Thanks in advance,
Gregory Gentlemen
---------------------------------
2005 Oct 20
2
information about Loess
Hello,
I'm currently using a tool that provides a Loess fitting, but I obtained results that are slightly different from those provided by R implementation of the Loess. That's why I would like to know if you could give me a source (bibliography or web) that explains in a clear way each step of the algorithm, with the possible options to choose, etc.. in order for me to understand those
2005 Jul 27
2
logistic regression: categorical value, and multinomial
I have two questions:
1. If I want to do a binomial logit, how to handle the
categorical response variable? Data for the response
variables are not numerical, but text.
2. What if I want to do a multinomial logit, still
with categorical response variable? The variable has 5
non-numerical response levels, I have to do it with a
multinomial logit.
Any input is highly appreciated! Thanks!
Ed
2007 Apr 20
2
sorting data in R
hello,
I'd like know how to sort a data frame in R for example how I should do to sort by Catholic with swiss data frame like below
thanks
Fertility Agriculture Examination Education Catholic Infant.Mortality
Courtelary 80.2 17.0 15 12 9.96 22.2
Delemont 83.1 45.1 6 9 84.84 22.2
2005 Jul 26
3
text on some lines
Hi,
I would like to write text on 2 lines for example.
For example, if you have a long sentence and you want to cut it at the 45 caracter and put the continuation underneath!
Is it possible?
Thanks
Sabine
---------------------------------
[[alternative HTML version deleted]]
2005 Dec 06
7
R is GNU S, not C.... [was "how to get or store ....."]
======= 2005-12-06 22:16:17 伳侜佋佢伬伌佇伵佒佇佇伌伒伬仯伜=======
>Martin Maechler a 侀crit :
>
>> please, please, these trailing ";" are *so* ugly.
>> This is GNU S, not C (or matlab) !
>>
>> but I'll be happy already if you could
>> drop these ugly empty statements at the end of your lines...
>
>May I disagree ?
>I find missing ";" at
2005 Oct 07
3
index question
All,
I'm having a problem selecting directly from a vector. I've written ways to do this
indirectly, but I'd rather do it directly and didn't see this in the manual.
Essentially, I have:
> group.label.new
[1] 7 9 6 1 10 4 8 3 2 5
> junk
[1] 1 2
> group.label.new[junk && 8:10]
[1] 7 9 6 1 10 4 8 3 2 5
I'd like to select the elements
2005 Aug 03
1
abline and linearity over groups
Dear R users, please can you help me understand the behaviour of abline using function lm.
I'm trying to learn linearity over groups. So I make three groups with 10 values each:
test=data.frame(cbind(
l=c(rnorm(10,0,30),rnorm(10,100,30),rnorm(10,200,30)),
t = c(rep(0,10), rep(1,10), rep(2,10))
))
when I do:
plot(test$l~test$t)
abline(lm(test$l~test$t))
the abline is a straight line
2009 Apr 22
2
function output with for loop and if statement
Hello all, turns out i'm having a bad R week. I am at my wits end with a function that I am trying to write. When I run the lines of code outside of a function, I get the desired output. When I wrap the lines of code into a function it doesn't work as expected. Not sure what is going on here. I suspected that the syntax of the if statement with the for loop was the culprit, but when I
2012 Aug 29
4
Sorting of columns of a matrix
Dear all,
Please suggest me how can I do it.
I have a matrix which look like following:
x1 x2 x3 t1 .01 0.3 0 t2 0 0.1 0.01 t3 0 .01 .01 t4 0 0 t5 5 0 0 t6
0 0 0 t7 0 0 0 t8 0 0 0 t9 0.6 0 0 t10 0 0 0.66 t11 0 0.6 0.11 t12 0
0.4 0
I want to sort decreasing order in each column based on rows. and then to
display only those rows which has a value. The expected out put matrix will
2005 Jul 28
4
Running Internet Explorer from Withing R
Good morning,
Is it possible to open an html file using IE but from within R? I wrote a small function to generate tables in html but I'd like to write another function to call IE and open the html file.
Thanks,
Walt Paczkowski
________________________
Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
(V) 609-936-8999
(F) 609-936-3733