Displaying 20 results from an estimated 7000 matches similar to: "Keeping Leading Zeros, Treating numbers as text"
2005 Jul 10
3
not supressing leading zeros when reading a table?
Dear R list,
I have a dataset with a column which should be read as character, like this:
name surname answer
1 xx yyy "00100"
2 rrr hhh "01"
When reading this dataset with read.table, I get
1 xx yyy 100
2 rrr hhh 1
The string column consists in answers to multiple choice questions, not all
having the same number of answers. I could format the
2011 Oct 06
1
Issue with read.csv treatment of numerics enclosed in quotes (and a confession)
Dear Help-Rs,
I've been dealing with this problem for some time, using a work-around to deal with it. It's time for me to come clean with my ineptitude and seek a what has got to be a more streamlined solution from the Help-Rverse.
I regularly import delimited text data that contains numerics enclosed in quotes (e.g., "00765288071"). Thing is, for some of these data, I need
2009 Jun 14
2
read.csv
If read.csv's colClasses= argument is NOT used then read.csv accepts
double quoted numerics:
1: > read.csv(stdin())
0: A,B
1: "1",1
2: "2",2
3:
A B
1 1 1
2 2 2
However, if colClasses is used then it seems that it does not:
> read.csv(stdin(), colClasses = "numeric")
0: A,B
1: "1",1
2: "2",2
3:
Error in scan(file, what, nmax, sep,
2006 Jun 16
3
Does HABTM support non "id" FKs?
Quick question. Say I have a geographical database with counties and zip
codes where counties have and belong to many zip codes.
zip_codes (id, zip_code)
counties (id, name)
When I create the association table, the Rails way says to do the
following: counties_zip_codes (county_id, zip_code_id).
However, given that zip_codes.zip_code is itself a candidate key, I
would much prefer to do the
2012 Oct 26
1
using match-type function to return correctly ordered data from a dataframe
I am regularly running into a problem where I can't seem to figure out how
maintain correct data order when selecting data out of a dataframe. The
below code shows an example of trying to pull data from a dataframe using
ordered zip codes. My problem is returning the pulled data in the correct
order. This is a very simple example, but it illustrates a regular problem
that I am running into.
2005 Jun 10
6
us zipcode data map
i've search the email archives, searched the documention
of various map packages and done an R-site search, but
have been unable to find direct resources for creating maps
of the US that are colored or annotated or ... by zipcode
data.
For example, create a map of the US and color each zipcode
region by its population using two vectors z,p containing the
zipcode and population,
2017 Nov 02
1
EXTERNAL: modestly priced laptop for C7
On 11/02/2017 01:42 PM, Fred Smith wrote:
> I'm looking to replace my (old, creaky) netbook (Acer Aspire One D255e,
> a screaming dual core 1.6 GHz Atom, and a whole 2 gigs of RAM) with
> something faster but not too large. Sometimes (usually) the netbook is
> painfully slow.
>
> Something like a hi-res 14 (or 15) inch screen (full HD), minimum of 4 gigs
> RAM, HD of a
2007 Jun 28
2
sampling question
I am interested in locating a script to implement a sampling scheme
that would basically make it more likely that a particular observation
is chosen based on a weight associated with the observation. I am
trying to select a sample of ~30 census blocks from each ZIP code area
based on the proportion of women in a ZCTA living in a particular
block. I want to make it more likely that a block will
2011 Nov 08
3
Reading a specific column of a csv file in a loop
Dear all:
I have two larges files with 2000 columns. For each file I am
performing a loop to extract the "i"th element of each file and create
a data frame with both "i"th elements in order to perform further
analysis. I am not extracting all the "i"th elements but only certain
which I am indicating on a vector called "d".
See an example of my code below
2006 Feb 03
4
Zipcode Search
Is there any package that I could use for zipcode search.
I want to display schools that near a particular zipcode. I have no idea how
to do this. It will be great if anyone can point me where I could find info
--
Rgds,
--Siva Jagadeesan
http://www.varcasa.com/
Education Through Collabration
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2010 Aug 31
2
Reading multiple text files where some files are empty
Hi All,
I have a problem with reading in multiple text files where some of the files
have no data and was hoping someone may be able to help me find a solution.
Each text file is a daily log of fish movement. However, on some occasions
no movements will be recorded on a particular day and therefore the text
file for that day is empty.
I'm currently using the following code to read the
2017 Jan 19
2
SELinux upgrade
I have experienced this myself. It is very upsetting.
(Sent from iPhone, so please accept my apologies in advance for any spelling or grammatical errors.)
> On Jan 19, 2017, at 2:57 AM, Fabian Arrotin <arrfab at centos.org> wrote:
>
> log
2007 Nov 01
5
monster method (too hard for my skill level)
I need to write a method for calculating the fee for medical
procedures with respect to area. I have all the tables and data but
its hard to give that here. Can someone take a look at this ''stub''
method and help me out?
def calculate_fee
# strip out the first 3 numbers of the user entered zip code
# use those 3 numbers to identify row in [zipcodes table] (between
upper and
2006 Jul 18
1
Need Help Updating Records
This is a stupid question I know, but it is driving me crazy - I am
missing something simple and basic here. I am trying to update missing
zip codes on a data table. I am doing something incorrectly as the data
in the Source table is not being updated, only the value in the array is
changed. How do I get this to update the actual DB record instead?
def add_missing_zips
#find all records in
2010 Oct 07
2
Truncating leading zeros in strings
I am new to R. I thing this will be simple, but I don't yet know my way
around.
I am generating character strings from the system clock that represent
integers, and I want to convert them to integer values. Strtoi works
well, except when there are leading zeros on the string. Could anyone
suggest a way to remove those leading zeros?
Thanks
Paul
--
E. Paul Wileyto, Ph.D.
2011 Sep 15
1
portfolio, portfolio.optim function not found
Hello,
After installing and loading the package "portfolio", I tried to run the
example code provided, and it would not run.
this is the link:
http://rss.acs.unt.edu/Rdoc/library/tseries/html/portfolio.optim.html
this is the example code, as found at the link:
x <- rnorm(1000)
dim(x) <- c(500,2)
res <- portfolio.optim(x)
res$pw
the error I get is:
Error: could not find
2012 May 22
3
pad leading zeros in front of strings
Dear All,
This question sounds very simple but I don't know where I am wrong. I just want to pad leading zeros in some string, for example, "123" becomes "00123". What is wrong if I do following?
> sprintf("%05s", "123")
[1] " 123"
It didn't return "00123", instead it padded with 'blank'.
Thank you for your help
2005 Dec 14
3
Geocode for Ruby
Hey,
Does anybody know of a good Geocode library for Ruby, similar to Perl''s
Geocode::Postal, that i could use in my rail app? I need to do some "within
5 miles" calculations of zipcodes and i dont have a nice ruby (or gem)
utility to do it.
any help would be appreciated.
thanks
adam
_______________________________________________
Rails mailing list
2006 Jul 19
5
Model Validation - with a twist
I''m stuck in a catch-22 type problem. I have an insert form for a table
that uses the validation in the model. i.e. When you click submit on the
form and haven''t filled in the required fields then you get the nice
rails error messages saying "field can not be blank". This works fine
until I introduce some more logic.
What I''m trying to do is to validate
2011 Aug 19
4
Leading zeros
An embedded and charset-unspecified text was scrubbed...
Name: n?o dispon?vel
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110819/e7764da5/attachment.pl>