similar to: Open user's R function

Displaying 20 results from an estimated 20000 matches similar to: "Open user's R function"

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 Apr 26
6
Tell the difference between characters
Dear all, I just want to determine if the characters in a character string are the same or not. For example, temp <- c("aa", "aA", "ab") How do I determine the first one have the two same ?a?, and the second and third have the different characters? Thanks in advance. Lisa -- View this message in context:
2009 Dec 04
1
User's function
Hello, All, I want to write a function to do some works based on the arguments. For example, bind some variables (arguments) as this: myfunction <- function(arg1, arg2, arg3, ?) { x <- cbind(arg1, arg2, arg3, ?) } myfunction(arg1, arg2, arg3, ?) The function can automatically determine the number of arguments and bind them, which means if I assign 2 arguments, the function can bind
2010 Jan 25
5
Data transformation
Dear all, I have a dataset that looks like this: x <- read.table(textConnection("col1 col2 3 1 2 2 4 7 8 6 5 10"), header=TRUE) I want to rewrite it as below: var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 1 0 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 0 0
2011 Apr 27
4
Pause the execution of a function
Dear all, I am trying to write a script to pause the execution of a function and provide some additional commands to the function and then continue execution of the function. For example, when my function detects a wrong number in a dataset, the function pauses automatically and returns information on the screen: ?There is a wrong number in the dataset. Would you like to correct it? ? If I
2010 Jan 08
4
Arguments of a function
Dear all, I have a question about how to set arguments in my own function. For example, I have a function that looks like this: my.f <- function(a = x1, b = x2) { x1 = equation 1 x2 = equation 2 x3 = equation 3 y = a + b } x1, x2, and x3 are temporary variables (intermediate results) calculated from other variables within the funciton. I want to use two of these three
2010 Jan 29
2
How to use escape characters in a string
Hi, I want to use a character as below in R, as.character("`X^`R\`S") [1] "`X^`R`S" Warning messages: 1: '\`' is an unrecognized escape in a character string 2: unrecognized escape removed from "`X^`R\`S" But I found errors. Can I use some option in as.character() to change this? Thanks Mary [[alternative HTML version deleted]]
2007 Aug 07
2
"Unrecognized escape sequence" from puppetmaster
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I''m using the "delete_lines" definition from http://reductivelabs.com/trac/puppet/wiki/SimpleTextRecipes . However, when I use it to remove a line with the pattern "/proc/kmsg" I need to escape the slashes for sed/grep and so I end up with "\/proc\/kmsg", but then I get this notices in the log of
2009 Dec 03
3
dataset index
Hello, All, I have a dataset that looks like this: x <- matrix(c( 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1), ncol = 5, byrow = T, dimnames = list(1:10, c("gender", "race", "disease"))) I want to write a function to produce several matrices including only ?TRUE? and ?FALSE? for the different levels of the
2009 Jun 26
1
should Sys.glob() cope with a UNC windows path beginning with backslashes?
I find that Sys.glob() doesn't like UNC paths where the initial slashes are backslashes. The help page for Sys.glob() doesn't specificly mention UNC paths, but does say: "File paths in Windows are interpreted with separator \ or /." Is the failure to treat a path beginning with a double-backslash as a UNC network drive path the intended behavior? E.g., on a Windows system
2011 Aug 11
2
UNC windows path beginning with backslashes: normalizePath bug??
Hi, Back in June I posted the message below, but had no replies. I've made a little progress since then so this is to update anyone interested (!) and to ask for comments. Brief problem statement: Under Windows, some parts of R don't handle UNC paths beginning with backslashes. Specifically a) Sys.glob() fails to find some files breaking (e.g.) Rcmdr plugins
2010 Jan 25
2
Delete components of a list
Dear all, I have a question about deleting components of a list. For example, I have a list that looks like this: [[1]] var1 var2 var3 1 3 4 2 2 1 [[2]] var1 var2 var3 2 5 1 2 1 7 [[3]] var1 var2 var3 1 6 7 3 8 4 How to delete, say, the first columns of the list or the second rows? Thank in advance. Lisa -- View
2011 Nov 04
3
replace double backslash with singel backslash
I want to replace \\ with \ in: str <- "C:\\DOKUME~1\\u0327336\\LOKALE~1\\Temp\\RtmpQ5NJ8X\\TIRIS_PICS\\1_Img.jpg" and tried: gsub("\\\\", "\\", str) but this removes the \\ without replacing them by \ Any help much appreciated, Kay ----- ------------------------ Kay Cichini Postgraduate student Institute of Botany Univ. of Innsbruck ------------------------
2011 Jun 01
5
Recode numbers
Dear all, I have two sets of numbers that look like a <- c(1, 2, 3, 3, 4, 4, 5, 6, 1, 2, 2, 3, 1, 2, 1, 2, 3, 3, 4, 5, 1, 2, 3, 4) b <- c(1, 5, 8, 9, 14, 20, 3, 10, 12, 6, 16, 7, 11, 13, 17, 18, 2, 4, 15, 19) I just want to use ?b? to encode ?a? so that ?a? looks like a1<- c(1, 5, 8, 8, 9, 9, 14, 20, 3, 10, 10, 12, 6, 16, 7, 11, 13, 13, 17, 18, 2, 4, 15, 19) Does anyone have a
2009 Dec 15
2
Reconstruct a dataset
Dear all, I have a dataset that looks like this: inividual var1 var2 ? 1 1 1 ? 2 1 2 ? 3 2 1 ? 4 2 2 ? ? ? ? ? I will random sample 2 individuals from this dataset based on a set of random numbers, e.g., rn1 <- c(0, 0, 1, 1), rn2 <- c(0, 0, 2, 0), rn3 <- c(1, 0, 0, 1), rn4 <-
2011 May 26
3
Suppress intermediate results on console
Dear all, I have a question about how to suppress intermediate results in a function on console. For example, I will use summary() in my own function that looks like: myfunction <- function(?) { ? Summary(x) ? } Then myfunction() will print ?x? on console that is intermediate result and doesn?t need showing. Does someone have any idea or any suggestion? Thank you in advance. Lisa
2011 Oct 05
2
(no subject)
Hi. I am trying to install using the following. Can someone suggest what is wrong? I am using Windows 7 64bit, and R 2.10.1 ('C:\Users\Bill\Desktop\DMwR_0.2.1.zip', repos=NULL ) Warning in install.packages("C:UsersBillDesktopDMwR_0.2.1.zip", repos = NULL) :   argument 'lib' is missing: using 'C:\Users\Bill\Documents/R/win-library/2.10' Error in zip.unpack(pkg,
2006 Aug 03
3
(no subject)
Hey everyone, I'm trying version 1.0rc2, via the rpm at ATrpms. I'm running on CentOS 4.3 on an Opteron system. I have this running stably on a 32 bit system, but I'm crashing constantly on a 64 bit system. Here's what I'm getting in my mail logs when I try to log in via IMAP: Aug 3 15:01:21 lisa dovecot: imap-login: Login: user=<scottz>, method=PLAIN,
2011 Mar 18
3
Arguments of a function
Hi, everybody, I just want to pass arguments to a function as below: range <- c(0.1, 0.5) runif(1, range) But it doesn?t work. Does anyone have any suggestions to offer? Thanks. Lisa -- View this message in context: http://r.789695.n4.nabble.com/Arguments-of-a-function-tp3387643p3387643.html Sent from the R help mailing list archive at Nabble.com.
2009 Nov 24
5
Split column
Hello, R users, I have a dataset that looks like this: id var1 var2 1 1 3 2 3 1 3 2 1 4 1 2 5 2 3 I want to split one column to two columns with 1 = 1 and 1, 2 = 1 and 2, 3 = 2 and 2: id var1.1 var1.2 var2.1 var2.2 1 1 1 2 2 2 2 2 1 1 3 1 2