Hi Emily,
I haven't tested this exhaustively, but it seems to work:
df<-data.frame(id=2001:3300,yrssmoke=sample(1:40,1300,TRUE),
cigsdaytotal=sample(1:60,1300,TRUE),yrsquit=sample(1:20,1300,TRUE))
dfNA<-sapply(df$id,"%in%",c(2165,2534,2553,2611,2983,3233))
# create your NA values
df[dfNA,c("yrsqu
> On May 6, 2016, at 5:15 PM, Ashta wrote:
>
> Thank you very much David.
>
> So there is no general formal that works year all round.
>
> The first one work only Jan to Nov
> today <- Sys.Date()
> nextmo<- paste0( month.abb[ as.numeric(format(today, format="%m"))+1] ,
> format
Please use reply-all to keep the mailing list in the loop, and use plain text
rather than HTML to make sure the your message gets through uncorrupted.
?merge
?lapply
# untested
# align rows by date
df1a <- merge( df1, df2, by="date", all.x=TRUE )
# like-named columns have .x or .y appended
df1
Dear all,
I am reading a modest dataset (2297 x 644) with specific values I want to
change. The code is inelegant but looks like this:
df <- read.csv("mydata.csv", header = TRUE, stringsAsFactors = FALSE)
# yrsquit, packyrs missing for following IDs. Manually change.
for(myid in c(2165, 2534, 2
You could install and load the 'lubridate' package, which has month()
and month<-() functions so you can do the following:
> z <- as.Date(c("2015-01-29", "2016-01-29", "2016-05-07", "2016-12-25"))
> z
[1] "2015-01-29" "2016-01-29" "2016-05-07" "2016-12-25"
> month(z) <- month(z) + 1
> z
[1] NA
Thank you very much David.
So there is no general formal that works year all round.
The first one work only Jan to Nov
today <- Sys.Date()
nextmo<- paste0( month.abb[ as.numeric(format(today, format="%m"))+1] ,
format(today,"%Y") )
[1] "Jun2016"
The second one works only for th
To add to what David said, maybe you want ?sink or ?capture.output .
If you're really looking to combine your own text and R output, than
knitr is probably what you want. The RStudio ide integrates this
stuff, so you may want to look at that, too.
Cheers,
Bert
Bert Gunter
"The trouble with hav
> On May 6, 2016, at 4:30 PM, David Winsemius wrote:
>
>
>> On May 6, 2016, at 4:11 PM, Ashta wrote:
>>
>> Hi all,
>>
>> I am trying to ge get the next month of the year.
>>
>> today <- Sys.Date()
>> xx<- format(today, format="%B%Y")
>>
>> I got "May2016", but I want Jun2016. How do I d
Thanks, John.
The trouble with that solution is that it gives the index for where the
cursor was before clicking rather than the cell that was clicked. The
solution is that the binding gives the x, y pixel coordinates of
the click to the callback, and those just need to be translated to cell
inde
> On May 6, 2016, at 4:11 PM, Ashta wrote:
>
> Hi all,
>
> I am trying to ge get the next month of the year.
>
> today <- Sys.Date()
> xx<- format(today, format="%B%Y")
>
> I got "May2016", but I want Jun2016. How do I do that?
today <- Sys.Date()
nextmo<- paste0( month.abb[ as.numeric(fo
Why would you want to use a for loop? Is this homework?
--
Sent from my phone. Please excuse my brevity.
On May 6, 2016 4:15:09 PM PDT, Saba Sehrish via R-help
wrote:
>
>
>Hi
>
>I have two dataframes(df1, df2) with equal number of columns (1566) but
>lesser rows in df2 (2772 in df1 and 40 in
Hi
I have two dataframes(df1, df2) with equal number of columns (1566) but lesser
rows in df2 (2772 in df1 and 40 in df2). Row names are
identical in both dataframes (date). I want to replace NAs of df1 with the
values of df2 for all those rows having identical row names (date) but
without
Hi all,
I am trying to ge get the next month of the year.
today <- Sys.Date()
xx<- format(today, format="%B%Y")
I got "May2016", but I want Jun2016. How do I do that?
My other question is that, I read a data and do some analysis and I
want to send all the results of the analysis to a pdf f
You may want to read http://rpubs.com/hadley/157957, which captures my
latest thinking (and tooling) around this problem. Feedback is much
appreciated.
Hadley
On Fri, May 6, 2016 at 2:14 PM, David Winsemius wrote:
>
>> On May 6, 2016, at 5:47 AM, Spencer Graves
>> wrote:
>>
>>
>>
>> On 5/6/201
Thanks Sarah, downloaded the sp package separately and that resolved the error.
> On May 6, 2016, at 5:43 PM, David Winsemius wrote:
>
>
>> On May 6, 2016, at 1:41 PM, Sarah Goslee wrote:
>>
>> On Fri, May 6, 2016 at 4:33 PM, Jeff Newmiller
>> wrote:
>>> I am puzzled why the original insta
> On May 6, 2016, at 1:41 PM, Sarah Goslee wrote:
>
> On Fri, May 6, 2016 at 4:33 PM, Jeff Newmiller
> wrote:
>> I am puzzled why the original install.packages call did not also download
>> the sp package, since the default argument dependencies = NA should have
>> triggered installation of im
> On May 6, 2016, at 2:12 PM, Lida Zeighami wrote:
>
> Hi there,
>
> Is there any way to find out high correlated variables among a big matrix?
> for example I have a matrix called data= 2000*5000 and I need to find the
> high correlated variables between the variables in the columns! (Need 100
Are you rying to find clusters of variables according to some distance
metric?
Clint BowmanINTERNET: cl...@ecy.wa.gov
Air Quality Modeler INTERNET: cl...@math.utah.edu
Department of Ecology VOICE: (360) 407-6815
PO Box 47600
Hi there,
Is there any way to find out high correlated variables among a big matrix?
for example I have a matrix called data= 2000*5000 and I need to find the
high correlated variables between the variables in the columns! (Need 100
high correlated variables from 5000 variables in column)
I could
On Fri, May 6, 2016 at 4:33 PM, Jeff Newmiller wrote:
> I am puzzled why the original install.packages call did not also download
> the sp package, since the default argument dependencies = NA should have
> triggered installation of imports including spDep, which should in turn have
> installed th
I am puzzled why the original install.packages call did not also download the
sp package, since the default argument dependencies = NA should have triggered
installation of imports including spDep, which should in turn have installed
the dependencies including the sp package. Anyone have a theor
This is a plain-text email list, so your red doesn't show up, but
since the error message said that the installer couldn't find the sp
package, I'd start by installing that.
Sarah
On Fri, May 6, 2016 at 12:35 PM, Phillips,Douglas A wrote:
> Hi, I just downloaded the Agricolae package and tried t
> On May 6, 2016, at 5:47 AM, Spencer Graves
> wrote:
>
>
>
> On 5/6/2016 6:46 AM, peter dalgaard wrote:
>> On 06 May 2016, at 02:43 , David Winsemius wrote:
>>
On May 5, 2016, at 5:12 PM, Spencer Graves
wrote:
I want a function to evaluate one argument
in the en
Hi, I just downloaded the Agricolae package and tried to access it using the
commands listed below (and received the error messages in red). Any
suggestions on resolving these errors?
Thanks for your assistance.
Doug
> install.packages("agricolae")
% Total% Received % Xferd Average S
This is not a code writing service. Posters are expected to first make
an honest effort and show us their code as part of their post. Please
read the posting guide to learn what is expected.
However, a hint to get you started: see ?cut
If you have not already gone through an R tutorial or two, pl
M1 M2 M4
60 86 48
72 90 86
66 86 62
69 60 48
66 86 58
I want to frequency table by binning the data in 0-60, 61-80,80-100
and want output as
M1 M2 M3
0-60
61-80
80-100
How to do
[[alternative HTML version deleted]]
__
R-help
I am looking at results of a random forest. In the documentation, it says
the following for categorical variables:
"For categorical predictors, the splitting point is represented by an
integer, whose binary expansion gives the identities of the categories that
goes to left or right. For example, i
I am trying to install 'openssl' on ubuntu 14.04. I already of libssl-dev
and libcurl4-openssl-dev installed. But when I try to install I get a
bunch of errors complaining about 'unknown type 'u_char''.
Thoughts?
Excerpt of output:
Found pkg-config cflags and libs!
Using PKG_CFLAGS=
Using PKG_
Hi
I need a bootstrapping code with ordered categorical data(five categories)
to re-samplling a real data with 16 variables and 200 sample size.
Any help please
--
Thanoon Y. Thanoon
PhD
Department of Mathematical Sciences
Faculty of Science
University Technology Malaysia, UTM
E.Mail: thano
On 5/6/2016 6:46 AM, peter dalgaard wrote:
On 06 May 2016, at 02:43 , David Winsemius wrote:
On May 5, 2016, at 5:12 PM, Spencer Graves
wrote:
I want a function to evaluate one argument
in the environment of a data.frame supplied
as another argument. "attach" works for
this, but "with" d
Em Sex 6 mai. 2016, às 06:20, kende jan via R-help escreveu:
> Hi, I'd like to access to the different elements in a svyciprop object
> (to the confidence intervals in particular...). But none of the functions
> I know works.Thank you for your help !
I don't know what data set you are using, so fo
Your post in HTML format came through garbled. Please post plain text email on
this list.
Your question is unclear as well. Perhaps you are not familiar with using the
str() function preview what is in an object?
--
Sent from my phone. Please excuse my brevity.
On May 6, 2016 2:20:00 AM PD
On 06 May 2016, at 02:43 , David Winsemius wrote:
>
>> On May 5, 2016, at 5:12 PM, Spencer Graves
>> wrote:
>>
>> I want a function to evaluate one argument
>> in the environment of a data.frame supplied
>> as another argument. "attach" works for
>> this, but "with" does not. Is there a wa
Dear R userers,
I am running truncated regressions with the 'truncreg' package. My sample
is large (6,000 observations), the data is left-truncated at 1 and the
left tail of the data is heavily centered at 1. When I am running the
regression I receive the following error message:
Error in o
Hi, I'd like to access to the different elements in a svyciprop object (to the
confidence intervals in particular...). But none of the functions I know
works.Thank you for your help !
> grr <- svyciprop(~temp==bzz, dclus1)> grr 2.5%
> 97.5%temp == bzz 0.040719697
On 5/5/2016 11:17 PM, Bert Gunter wrote:
... and it's exactly with.default's code !
Thanks for pointing that out. Unfortunately, it didn't work inside
another function. However, if I had looked at it, I might have been
able to thought to try it. Spencer
Cheers,
Bert
Bert Gunter
"Th
36 matches
Mail list logo