Displaying 20 results from an estimated 31 matches for "stochastickang".
2009 Aug 27
5
Help on efficiency/vectorization
Dear R users,
I am trying to extract the rownames of a data set for which each columns
meet a certain criteria. (condition - elements of each column to be equal
1)
I have the correct result, however I am seeking for more efficient (desire
vectorization) way in implementing such problem as it can get quite messy if
there are hundreds of columns.
Arbitrary data set and codes are shown below for
2009 Nov 20
2
Finding & replacing non-ASCII characters
Hi guys,
Are there any feasible methods in searching & finding non-ASCII characters
in R?
For example, from the following object,
x <- mia. SzaÌmitaÌó
The desired output is,
x.out <- mia. SzaImitaIA
Your help in resolving this would be greatly appreciated.
[[alternative HTML version deleted]]
2009 Nov 22
5
Removing "+" and "?" signs
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091123/36ef28cf/attachment-0001.pl>
2009 Sep 10
2
"Read.csv" in R with dynamic file (1st) argument
Dear R users,
I have numerous data sets (csv files) saved in the folder which has the same
name as individual data.
(i.e data x1 saved in x1 folder, data x2 in x2 folder etc)
I would like to read in the desired data set name using 'scan' function and
assign this inputted value to an object so that it can be used in the
'read.csv' function.
For example,
x <- scan()
1: 0708
2009 Aug 25
2
Removing objects from workspace
Hi all,
I am currently woking with hundreds of objects in workspace and whenever I
invoke ls() to observe the names of the objects, there are too much of
unnecessary variables.
For example, if I only require say 3 or 4 objects from hundreds of objects
in workspace, are there any methods that may do the job?
I have tried rm(-c(x,xx,xxx)), but no luck..
Your feedback in this problem would be
2010 Jul 16
2
Storing processed results back into original objects
Hi all,
There are matrices with same column names but arranged in different orders
and I desire columns of these matrices to have same order.
For example, below are 2 arbitrary data sets with columns arranged in
different order. I require columns of these to have same order as specified
in "columns" object and the results stored in the original object names.
I know this can be done
2010 Jan 24
2
Creating directories & folders
Dear R users,
I would like to create the following 3 folders (FUND1, FUND2, MARINE) within
the 'parent.dir' as defined below.
FUND1 <- "FD1 Q4 2009"
FUND2 <- "FD2 Q4 2009"
MARINE <- "MARINE Q4 2009"
parent.dir <- "D:/....................."
folders <- c("FUND1", "FUND2", "MARINE")
for (i in
2010 Jun 16
1
"Write.table" problem
Hi all,
I have imported csv file for processing and exported as txt file (using *
"write.table"* with sep = "\t", row.names = FALSE options)
However, when I import this txt file in R (*"read.delim"* with header =
TRUE, sep = "\t" options) the dimension (i.e number of rows) is inconsistent
with the original file.
Any solution to this problem would be
2010 Aug 04
1
Carriage return character issue
Hi all,
I imported a file (in CSV format) into R for processing, then imported the
result into MySQL. However, there are *carriage return* characters
(hexadecimal: *0D*) that are appended to the characters in the last field of
the table.
i.e *\r* appended to the character values (as shown below)
Before importing into MySQL: asdf
After importing into MySQL: asdf*\r*
**
**
Are there any options
2009 Sep 15
1
Header names when importing csv/excel data sets
Dear R users,
Suppose the csv file contains header names such as *"Nike, dunk"*, *"Converse,
All stars"* etc
When imported to R (with header = T option), the column names are given by:
*"Nike..dunk"* *"Converse..All.stars"*
I have tried the following command to convert these column names to the
original names as in the input source.
2010 Sep 29
2
String split and concatenation
Hi R users,
I desire to transform the following vector consisting of repeated characters
x <- rep(letters, 3)
into this exact format (i.e a single string containing each characters in
quotation mark separated by comma between each; al ).
("a", "b", "c", "d", ........"a", "b", "c", "d", ...........,
2010 Mar 10
1
Generating records from data frame
Hi all,
I wish to generate additional records according to one of the field values
in a data frame.
For example, unique record from the input data is required to be generated
number of times as specified in the 'Number' field in the following code.
> x <- data.frame(Name = c("a", "b", "c", "d"), Group = c("VR", "MR",
2010 Aug 05
3
Date conversion
Hi all,
I am trying to convert all the dates (all days that are not Friday) in data
frame into dates to next Friday.
The following works but the result is returned as vector rather than the
original class.
It would be greatly apprecited if you could provide any solution to this
problem.
Many thanks in advance.
# Define arbitrary initial date value
ini <- as.Date("2010/1/1",
2010 Jan 05
2
Dynamic arguments in "rbind" function
Hi, all
Basically, I have unknown number of data that need to be imported and
collapsed row-wisely.
The code below works fine, however the "rbind" function may require 50
arguments if there are 50 data files...
Thus, I would like to explore whether there are any methods in using dynamic
objects (i.e from the resulting objects in the for loop) as an argument in
the *"rbind"*
2009 Sep 11
2
Accumulating results from "for" loop in a list/array
Dear R users,
I would like to accumulate objects generated from 'for' loop to a list or
array.
To illustrate the problem, arbitrary data set and script is shown below,
x <- data.frame(a = c(rep("n",3),rep("y",2),rep("n",3),rep("y",2)), b =
c(rep("y",2),rep("n",4),rep("y",3),"n"), c =
2009 Sep 04
1
User defined function's argument as Subset function's input
Dear R users,
I have a data where I desire to subset according to certain conditions.
However, the script is very messy as there are about 30 distinct conditions.
(i.e. same script but with different conditions)
I would like to make a user defined function so that I can input the desired
conditions and just get the results accordingly.
Below is an arbitrary data set & sample statements
2010 Aug 06
1
apply family functions
Hi all,
I would like to flag each record in the data according to certain conditions
as specified below.
For example,
If "Close_date" in *dat* is between ("Open" & "Close") or ("Open1" &
"Close1") or ("Open2" & "Close2") in *oc, *flag the records as "Valid",
otherwise "Invalid"
I would like to
2009 Oct 29
3
Removing & generating data by category
Dear R users,
Basically, from the following arbitrary data set:
a <-
data.frame(id=c(c("A1","A2","A3","A4","A5"),c("A3","A2","A3","A4","A5")),loc=c("B1","B2","B3","B4","B5"),clm=c(rep(("General"),6),rep("Life",4)))
> a
2009 Sep 11
3
For sending my R package as part of R-project
...ath <- 'macintoshhd/users/me/myfolder/ # or whatever you need
read.csv(eval(paste(fpath,fnam,sep="")) #worked for me
Carl
-----------
Try this:
read.csv(sprintf("D://R//Data//%04d//%04d.csv", x, x), header = TRUE)
On Wed, Sep 9, 2009 at 9:32 PM, Steven Kang <stochastickang at gmail.com>wrote:
> Dear R users,
>
>
> I have numerous data sets (csv files) saved in the folder which has the
> same
> name as individual data.
> (i.e data x1 saved in x1 folder, data x2 in x2 folder etc)
>
> I would like to read in the desired data set n...
2009 Nov 02
1
Using processed objects as arguments of a function
Dear R users,
I wish to utilise processed and saved objects as arguments of a function.
Specifically, I have created objects using *"assign"* & *"paste"* functions
with an incremental index i, the names of the objects are:
fund1, fund2, fund3,....., fund80,..... (where the numerical value
increments according to the index i & class of these objects are