Displaying 20 results from an estimated 4000 matches similar to: "aggregate months to years"
2008 Jul 29
2
'for' loop, two variables
Dear Rusers,
I am still an unexperienced builder of functions and loops, so my question is
very basic: Is it possible to introduce a second variable (j) into my loop.
To examplify:
# This works fine:
fn <- function (x) {if (x>46 & x<52) 1 else 0}
res <-NULL
for (i in 40:60) res <-c(res,fn(i))
res
# But here, there is an error in the "for" expression:
fn <-
2008 Jul 14
1
rm(l*)
Dear Rusers,
how can I designate various objects the names of which start (or end) with
the same letter to remove them all together?
For instance:
> ls()
"a","b","c","l1","l2","x"
> rm(list=ls("l*"))
> ls()
"a","b","c",""x"
Is there some parallel to the MySQL query: where
2014 Oct 07
2
Changing date format
Dear All,
How can I change the format of date of day of the year ? for example r
(i.e. "17 Apr" rather than "108").
The following is the type of the dataset I have
head(Samaru)
Year Start End Length
1 1930 108 288 180
2 1931 118 288 170
3 1932 115 295 180
4 1933 156 294 138
5 1934 116 291 175
6 1935 134 288 154
Any idea is welcome. Thanks!!!
2008 Nov 04
1
perform Kruskal-Wallis test without using the built-in command in R
Hi,
again i am stuck in my presentation, and i have never learn R before in my
life but need this to be done, so please help me out for a favour:
http://www.nabble.com/file/p20333155/kew.dat kew.dat
run this in R and these comes up:
Month Year Rain
1 Jan 1900 74.400000
2 Feb 1900 80.500000
3 Mar 1900 23.600000
4 Apr 1900 23.600000
5 May 1900 25.100000
6
2004 Jun 11
3
Einlesen von Daten unter R
Sehr geehrte Damen und Herren,
An der Fachhochschule Winterthur wurde f??r mich im Rahmen einer
Diplomarbeit (Prof. Ruckstuhl) ein R-Programm zur Auswertung von
IR-Spektren (line-shape-Analyse zur quantitativen Analyse von
Gasmischungen) entwickelt. Die Daten werden einer Excel-Tabelle
entnommen. Bisher werden die spektroskopischen Daten ??ber den Inhalt von
64 Kan??len ??ber die
2010 Feb 23
0
subtracting 100 from strptime year vector generates missing values in POSIXct where none appear to exist in strptime year vector
Thanks Don MacQueen for this reply to my initial query - please SEE MY REPLIES TO THESE IDEAS AND FURTHER INFORMATION BELOW
>From: Don MacQueen [macq at llnl.gov]
>Sent: 23 February 2010 21:25
>To: Jonathan Williams; r-help at r-project.org
>
>Subject: Re: [R] Problem with strptime generating missing values where none appear to exist
>
>What happens if you do all that NA
2016 Mar 12
2
Regression in strptime
On 3/12/16 12:33 AM, peter dalgaard wrote:
>> On 12 Mar 2016, at 00:05 , Mick Jordan <mick.jordan at oracle.com> wrote:
>>
>> This is definitely obscure but we had a unit test that called .Internal(strptime, "1942/01/01", %Y/%m/%d") with timezone (TZ) set to CET.
> Umm, that doesn't even parse. And fixing the typo, it doesn't run:
>
>>
2010 Feb 23
1
Problem with strptime generating missing values where none appear to exist
Dear R Helpers,
I am having difficulty with strptime. I wish to find the differences between
two vectors of times. I have apparently no difficulty to convert the vectors
to the appropriate format using strptime. But, then difftime does not
calculate all the differences.
Here is the code and output:-
dob=strptime(as.character(datx$BDT),'%d-%b-%y'); dob$year=dob$year-100
2004 Oct 04
7
Strange Matrix Multiplication Behaviour
Hi there fellow R-users,
Im seeing some strange behaviour when I multiply a vector by a matrix
Here is my script:
> tr
1 2 3 4 5 6
0.2217903 0.1560525 0.1487908 0.1671354 0.1590643 0.1471667
>
> ex1
a b c d e f
1 0.2309579 -3.279045 -0.6694697 -1.1024404 0.2303928 -1.5527404
2
2013 Mar 13
2
merge datas
Hello all!
I have a problem with R. I try to merge data like this:
structure(c(2.1785, 1.868, 2.1855, 2.5175, 2.025, 2.435, 1.809,
1.628, 1.327, 1.3485, 1.4335, 2.052, 2.2465, 2.151, 1.7945, 1.79,
1.6055, 1.616, 1.633, 1.665, 2.002, 2.152, 1.736, 1.7985, 1.9155,
1.7135, 1.548, 1.568, 1.713, 2.079, 1.875, 2.12, 2.072, 1.906,
1.4645, 1.3025, 1.407, 1.5445, 1.437, 1.463, 1.5235, 1.609, 1.738,
1.478,
2008 May 09
1
data management question
Hi all,
I have a data management question. I am using an panel dataset read into
R as a dataframe, call it "ex". The variables in "ex" are: id year x
id: a character string which identifies the unit
year: identifies the time period
x: the variable of interest (which might contain NAs).
Here is an example:
> id <- rep(c("A","B","C"),2)
2008 May 10
3
question about subseting a dataframe
Hi!
I am using R version 2.7.0 and am working on a panel dataset read into R as
a dataframe; I call it "ex". The variables in "ex" are: id year x
id: a character string which identifies the unit
year: identifies the time period
x: the variable of interest (which might contain NAs).
Here is an example:
> id <- rep(c("A","B","C"),2)
>
2013 Mar 12
5
extract values
Hello all!
I have a problem to extract values greater that for example 1820.
I try this code: x[x[,1]>1820,]->x1
Please help me!
Thank you!
The data structure is:
structure(c(2.576, 1.728, 3.434, 2.187, 1.928, 1.886, 1.2425,
1.23, 1.075, 1.1785, 1.186, 1.165, 1.732, 1.517, 1.4095, 1.074,
1.618, 1.677, 1.845, 1.594, 1.6655, 1.1605, 1.425, 1.099, 1.007,
1.1795, 1.3855, 1.4065, 1.138, 1.514,
2013 Apr 07
2
group data in classes
Hello all!
I have a problem to group my data (years) in 10 years classes. For example
for year
year decade
1598 1590-1600
1599 1590-1600
1600 1590-1600
1601 1600-1610
---
my is like this>
[1] 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611
1612
[16] 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626
1627
[31] 1628 1629 1630 1631 1632 1633
2003 Feb 05
7
Winbind on HPUX 11, some small progress
Hi All,
Well, i've managed to enable some debugging in syslog, I had to put in
/etc/syslog.conf
;*.debug
on the syslog line.
So at least I have an error which is being returned into syslog from
winbind.
This is what I get from winbind
Feb 4 21:13:17 coastdr pam_winbind[20753]: Verify user `lonnie'
Feb 4 21:13:18 coastdr pam_winbind[20753]: user 'lonnie' granted acces
Feb 4
2004 Jan 28
5
Julian dates
Hi all,
I have problems with years of dates using "chron" package.
I don't understand why R by this istruction:
> dates("01/02/29",out.format="d/m/year")
[1] 02/Jan/2029
> dates("01/02/30",out.format="d/m/year")
[1] 02/Jan/1930
reads "29" as 2029
and "30" as 1930. How could I change to read "00" to
2002 Feb 12
10
Winbind - Why won't you authenticate???
Well, I managed to get Samba 2.2.3 up and running on our Solaris 8 machine.
I installed with the winbind option and everything went though just find.
I was able to join the NT domain and now I can do a wbinfo -u "and get a
domain user list as well as a "wbinfo -g and get a group list. For some
reason though, the authentication isn't working.
I tried to "wbinfo -a" and
2012 Jan 18
2
Table Intersection
I've got two tables....
first one(table1):
ID chrom start end
Ex1 2 152 180
Ex2 10 2000 2220
Ex3 15 3000 4000
second one ( table2):
chrom location name
2 160 Alv
2 190 GNN
2 100
2010 Sep 20
2
interpreting one-way anova tables
Hi, I am trying to reconcile anova table in R (summary(lm)) with individual t.test.
datafilename="http://personality-project.org/R/datasets/R.appendix1.data"
data.ex1=read.table(datafilename,header=T) #read the data into a table
summary(lm(Alertness~Dosage,data=data.ex1))
gives:
Call:
lm(formula = Alertness ~ Dosage, data = data.ex1)
Residuals:
Min 1Q Median 3Q Max
2013 Mar 29
1
problem with data
Hello all!
I have a problem with my data in R. When I want to plot the following data,
I have a problem with y scale. The maximum value is cc. 10 degrees and in R
is about 100.
I use this code:
fasy<-read.table("gridd1.txt",sep="\t",dec=",",header=T,row.names=1)
# here are the years:
x <- as.numeric(rownames(fasy))
# extract a series that you want to plot:
y