similar to: ifelse returns

Displaying 20 results from an estimated 20000 matches similar to: "ifelse returns"

2011 Nov 15
2
Problem creating reference manuals from latex
R Community, I often am in need of viewing the reference manuals of packages and do not have Internet access. I have used the code: path <- find.package('tm') system(paste(shQuote(file.path(R.home("bin"), "R")),"CMD", "Rd2pdf",shQuote(path))) someone kindly provided from this help list to generate the manuals from the latex files. This
2013 Aug 24
3
Parts of Speach Tagging
I was using tagPOS function from openNLP package for parts-of-speach. Now the package is updated and the function is not present. Any suggestions how to do it now ? Thanks for your help. -- Regards, Siddharth Arun, Contact No. - +91 8880065278 [[alternative HTML version deleted]]
2011 Aug 30
2
url prep function (backslash issue)
Greeting R Community, I am a windows user so this problem may be specific to windows. I often want to source files from within R such as: C:\Users\Rinker\Desktop\Research & Law\Data\School Data 09-10. To source this file I need to go through the path and replace all the backslashes (\) with forward slashes (/). I usually do this in MS Word using the replace option, however, I'd like
2011 Aug 23
2
Opening package manual from within R
Simple question but searching rseek did not yield the results I wanted. Question: Is there a way to open a help manual for a package from within R. For instance I would like to type a function in r for the tm package and R would open that PDF as seen here: http://cran.r-project.org/web/packages/tm/tm.pdf -The vignette function exists for vignettes [vignette("package.name")] so I
2011 Mar 31
1
Sequential multiple regression
Hello, In the past I have tended to reside more in the ANOVA camp but am trying to become more familiar with regression techniques in R. I would like to get the F change from a model as I take away factors: SO... mod1<-lm(y~x1+x2+x3).......mod2<-lm(y~x1,x2).......mod3<-lm(y~x1) I can do this by hand by running several models in R and taking the MSr1/MSe1, MSr2/MSe2... This is
2011 Oct 19
1
Square ended segments
Good Afternoon R Community, I am working on plotting behavior codes over short durations of time (a few seconds at a time over 1-2 hrs). I am utilizing as.POSIXct to store the time. I wanted to make a quasi time line using these time. I utilized the segments function to represent these times. However the segments rounds off at the ends and does not have the crisp look I need for my purposes.
2011 Sep 21
1
Package dependency
Greetings R community, I am making my first package and have run into the need to use other packages. I pass all the checks in the command prompt running Rcmd check package.name. In the Description file I have included: Depends: R (>= 2.13), plotrix Repository: CRAN Now I create the zip file for windows 7. I delete my plotrix package from my library to create a setup where others
2011 Apr 03
1
Function for finding NA's
Quick question, I tried to find a function in available packages to find NA's for an entire data set (or single variables) and report the row of missing values (NA's for each column). I searched the typical routes through the blogs and the help manuals for 15 minutes. Rather than spend any more time searching I created my own function to do this (probably in less time than it would
2011 Nov 08
1
Rd2pdf error after 2.14 upgrade‏
> The command Rd2pdf was rather useful for opening a package's manual > when you don't have access to the Internet (by using latex to pdf > conversion). However the way the function seems to operate changed at > version 2.14 of R. The noted changes listed on CRAN for this function > are as follows (which doesn't seem like it would affect my usage as > below): >
2011 Mar 12
1
Passing a character argument onto a function
I am a new R user and am beginning to employ function creation in my statistical work. I am running into a problem when I want to pass on a character (text) to the function as an argument. I have a simple example below to demonstrate this problem. I cannot seem to find a fix in my R book or in the blog posts. I'm sure this has been covered before but my newbie status means I lack the R
2003 Jun 23
2
Summary for mode of a data set
Dear R People: thank you for the many helpful sets of code that I received!!! I combined several of the concepts for the following function: > mode1 function(x) { y <- rle(sort(x)) z <- y$values[y$lengths==max(y$lengths)] return(z) } > xm [1] 22 15 10 30 25 26 2 17 28 2 24 6 26 24 5 22 20 14 > mode1(xm) [1] 2 22 24 26 > This will pick
2006 Oct 21
2
problem with mode of marginal distriubtion of rdirichlet{gtools}
Hi all, I have a problem using rdirichlet{gtools}. For Dir( a1, a2, ..., a_n), its mode can be found at $( a_i -1)/ ( \sum_{i}a_i - n)$; The means are $a_i / (\sum_{i} a_i ) $; I tried to study the above properties using rdirichlet from gtools. The code are: ############## library(gtools) alpha = c(1,3,9) #totoal=13 mean.expect = c(1/13, 3/13, 9/13) mode.expect = c(0, 2/10, 8/10) #
2011 Aug 27
1
Make a function work on an environemnt
In my R learning I've come across a situation in which a piece of code that works on the work space outside a function does not work inside the function. WARNING THIS EMAIL CONTAINES THE CODE:#rm(list=ls()) THIS WILL CLEAR ALL OBJECTS FROM YOUR WORKSPACE! When I use rm(list=ls()) and then ls() it shows character(0) So I tried to make a quick function to speed this up as follows:
2012 Apr 06
1
Missing CRAN Mirror
Hello R community, This isn't a technical question about R: I have used http://lib.stat.cmu.edu/R/CRAN/ as my mirror for some time now. As of a few days now I don't seem to be able to use this mirror. The link from CRAN to this repository does not work either. Does anyone know the fate of this repository? Cheers,Tyler Rinker If this was not the appropriate place for this question
2012 Dec 10
1
Long equation in documentation
I have a long equation that I need to break in the R documentation of a package or it trails off the right hand side of the page. Here's the formula: \deqn{Cov(r_{ist}, r_{iuv})= [.5\rho_{ist}\rho_{iuv}(\rho_{isu}^2 + \rho_{isv}^2 + \rho_{itu}^2 + \rho_{itv}^2) + \rho_{isu}\rho_{itv}+ \rho_{isv}\rho_{itu}-(\rho_{ist}\rho_{isu}\rho_{isv} + \rho_{its}\rho_{itu}\rho_{itv}) +
2012 Sep 19
2
Data Frame (Very Simple Problem)
Hi List Members, This is a very stupid problem but I am not able to know what the solution can be. I am trying to run a query like below *Program Flow :* 1. a <- data.frame(table( cut( Sys.time() + seq(0,82800,3600), "60 mins") )) # It generates the 60 minute intervals. Thanks David 2. b <- data.frame(a$Var1) # To extract only First Column i.e.
2011 Jun 29
1
library(doBy) will not load
Greetings R Community, One of my favorite packages won't load and I'm not sure why. It loaded earlier today. The problem appears with the snow package, which doBy requires. I tried reinstalling both packages again ,shutting [R] down, reinstalling [R] in the workspace (shortcut). Here's the weird thing. The same exact library loads in another workspace using the same version of [R]
2011 Jul 14
1
(no subject)
Good Afternoon R Community, I often work with very large data bases and want to search for select cases by a particular word or numeric value. I created the following simple function to do just that. It searchs a particular column for the phrase and returns a data frame with the rows that contain that phrase (for a particular column). Search<-function(term, dataframe, column.name,
2012 Dec 18
1
multi dimensional optim problem
I am attempting to use optim to solve a neural network problem. I would like to optimize coefficients that are currently stored in a matrix Y=270 x 1 X= 27- x 14 b1= 10x14 b2= 11x1 V= 10 x 14 set of prior variances. I have the following function: posterior.mode1=function(y,X,b_0,b2,V) { log.like=function(b1) { a_g=compute(b1) z_g=tanh(a_g); z_g=cbind(1,z_g)
2018 May 01
2
How would I color points conditional on their value in a plot of a time series
How would I color points conditional on their value in a plot of a time series. Something like this: ## demonstration data ttt <- ts(rpois(12, lambda = 8), start = c(2000, 1), freq = 4) ttt plot(ttt, type = "p") ## doesn't work--all points the same color plot(ttt, type = "p", col = ifelse(ttt < 8, "black", "red")) ## also doesn't work--all